xref: /netbsd-src/sys/arch/i386/include/sysarch.h (revision 3b01aba77a7a698587faaae455bbfe740923c1f5)
1 /*	$NetBSD: sysarch.h,v 1.10 2000/09/13 04:47:01 thorpej 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 
19 struct i386_get_ldt_args {
20 	int start;
21 	union descriptor *desc;
22 	int num;
23 };
24 
25 struct i386_set_ldt_args {
26 	int start;
27 	union descriptor *desc;
28 	int num;
29 };
30 
31 struct i386_iopl_args {
32 	int iopl;
33 };
34 
35 struct i386_get_ioperm_args {
36 	u_long *iomap;
37 };
38 
39 struct i386_set_ioperm_args {
40 	u_long *iomap;
41 };
42 
43 struct i386_pmc_info_args {
44 	int	type;
45 	int	flags;
46 };
47 
48 #define	PMC_TYPE_NONE		0
49 #define	PMC_TYPE_I586		1
50 #define	PMC_TYPE_I686		2
51 
52 #define	PMC_INFO_HASTSC		0x01
53 
54 #define	PMC_NCOUNTERS		2
55 
56 struct i386_pmc_startstop_args {
57 	int counter;
58 	u_int64_t val;
59 	u_int8_t event;
60 	u_int8_t unit;
61 	u_int8_t compare;
62 	u_int8_t flags;
63 };
64 
65 #define	PMC_SETUP_KERNEL	0x01
66 #define	PMC_SETUP_USER		0x02
67 #define	PMC_SETUP_EDGE		0x04
68 #define	PMC_SETUP_INV		0x08
69 
70 struct i386_pmc_read_args {
71 	int counter;
72 	u_int64_t val;
73 	u_int64_t time;
74 };
75 
76 #ifndef _KERNEL
77 int i386_get_ldt __P((int, union descriptor *, int));
78 int i386_set_ldt __P((int, union descriptor *, int));
79 int i386_iopl __P((int));
80 int i386_get_ioperm __P((u_long *));
81 int i386_set_ioperm __P((u_long *));
82 int i386_pmc_info __P((struct i386_pmc_info_args *));
83 int i386_pmc_startstop __P((struct i386_pmc_startstop_args *));
84 int i386_pmc_read __P((struct i386_pmc_read_args *));
85 int sysarch __P((int, void *));
86 #endif
87 
88 #endif /* !_I386_SYSARCH_H_ */
89