xref: /netbsd/sys/arch/i386/include/sysarch.h (revision c4a72b64)
1 /*	$NetBSD: sysarch.h,v 1.12 2002/06/07 04:04:47 gmcgarry Exp $	*/
2 
3 #ifndef _I386_SYSARCH_H_
4 #define _I386_SYSARCH_H_
5 
6 /*
7  * Architecture specific syscalls (i386)
8  */
9 #define I386_GET_LDT	0
10 #define I386_SET_LDT	1
11 #define	I386_IOPL	2
12 #define	I386_GET_IOPERM	3
13 #define	I386_SET_IOPERM	4
14 #define	I386_VM86	5
15 #define	I386_PMC_INFO	8
16 #define	I386_PMC_STARTSTOP 9
17 #define	I386_PMC_READ	10
18 #define I386_GET_MTRR	11
19 #define I386_SET_MTRR	12
20 
21 struct i386_get_ldt_args {
22 	int start;
23 	union descriptor *desc;
24 	int num;
25 };
26 
27 struct i386_set_ldt_args {
28 	int start;
29 	union descriptor *desc;
30 	int num;
31 };
32 
33 struct i386_get_mtrr_args {
34 	struct mtrr *mtrrp;
35 	int *n;
36 };
37 
38 struct i386_set_mtrr_args {
39 	struct mtrr *mtrrp;
40 	int *n;
41 };
42 
43 struct i386_iopl_args {
44 	int iopl;
45 };
46 
47 struct i386_get_ioperm_args {
48 	u_long *iomap;
49 };
50 
51 struct i386_set_ioperm_args {
52 	u_long *iomap;
53 };
54 
55 struct i386_pmc_info_args {
56 	int	type;
57 	int	flags;
58 };
59 
60 #define	PMC_TYPE_NONE		0
61 #define	PMC_TYPE_I586		1
62 #define	PMC_TYPE_I686		2
63 #define	PMC_TYPE_K7		3
64 
65 #define	PMC_INFO_HASTSC		0x01
66 
67 #define	PMC_NCOUNTERS		4
68 
69 struct i386_pmc_startstop_args {
70 	int counter;
71 	u_int64_t val;
72 	u_int8_t event;
73 	u_int8_t unit;
74 	u_int8_t compare;
75 	u_int8_t flags;
76 };
77 
78 #define	PMC_SETUP_KERNEL	0x01
79 #define	PMC_SETUP_USER		0x02
80 #define	PMC_SETUP_EDGE		0x04
81 #define	PMC_SETUP_INV		0x08
82 
83 struct i386_pmc_read_args {
84 	int counter;
85 	u_int64_t val;
86 	u_int64_t time;
87 };
88 
89 struct mtrr;
90 
91 #ifndef _KERNEL
92 int i386_get_ldt __P((int, union descriptor *, int));
93 int i386_set_ldt __P((int, union descriptor *, int));
94 int i386_iopl __P((int));
95 int i386_get_ioperm __P((u_long *));
96 int i386_set_ioperm __P((u_long *));
97 int i386_pmc_info __P((struct i386_pmc_info_args *));
98 int i386_pmc_startstop __P((struct i386_pmc_startstop_args *));
99 int i386_pmc_read __P((struct i386_pmc_read_args *));
100 int i386_set_mtrr __P((struct mtrr *, int *));
101 int i386_get_mtrr __P((struct mtrr *, int *));
102 int sysarch __P((int, void *));
103 #endif
104 
105 #endif /* !_I386_SYSARCH_H_ */
106