sysarch.h revision 1.1.2.4 1 /* $NetBSD: sysarch.h,v 1.1.2.4 2005/11/10 13:51:35 skrll Exp $ */
2
3 #ifndef _AMD64_SYSARCH_H_
4 #define _AMD64_SYSARCH_H_
5
6 /*
7 * Architecture specific syscalls (amd64)
8 */
9 #define X86_64_GET_LDT 0
10 #define X86_64_SET_LDT 1
11 #define X86_64_IOPL 2
12 #define X86_64_GET_IOPERM 3
13 #define X86_64_SET_IOPERM 4
14 #define X86_64_VM86 5
15 #define X86_64_PMC_INFO 8
16 #define X86_64_PMC_STARTSTOP 9
17 #define X86_64_PMC_READ 10
18 #define X86_64_GET_MTRR 11
19 #define X86_64_SET_MTRR 12
20
21 /*
22 * XXXfvdl todo.
23 */
24
25 struct x86_64_get_ldt_args {
26 void *desc;
27 unsigned len;
28 };
29
30 struct x86_64_set_ldt_args {
31 void *desc;
32 unsigned len;
33 };
34
35 struct x86_64_iopl_args {
36 int iopl;
37 };
38
39 #if 0
40
41 struct x86_64_get_ioperm_args {
42 u_long *iomap;
43 };
44
45 struct x86_64_set_ioperm_args {
46 u_long *iomap;
47 };
48
49 struct x86_64_pmc_info_args {
50 int type;
51 int flags;
52 };
53
54 #define PMC_TYPE_NONE 0
55 #define PMC_TYPE_I586 1
56 #define PMC_TYPE_I686 2
57
58 #define PMC_INFO_HASTSC 0x01
59
60 #define PMC_NCOUNTERS 2
61
62 struct x86_64_pmc_startstop_args {
63 int counter;
64 u_int64_t val;
65 u_int8_t event;
66 u_int8_t unit;
67 u_int8_t compare;
68 u_int8_t flags;
69 };
70
71 #define PMC_SETUP_KERNEL 0x01
72 #define PMC_SETUP_USER 0x02
73 #define PMC_SETUP_EDGE 0x04
74 #define PMC_SETUP_INV 0x08
75
76 struct x86_64_pmc_read_args {
77 int counter;
78 u_int64_t val;
79 u_int64_t time;
80 };
81
82 #endif /* todo */
83
84 struct x86_64_get_mtrr_args {
85 struct mtrr *mtrrp;
86 int *n;
87 };
88
89 struct x86_64_set_mtrr_args {
90 struct mtrr *mtrrp;
91 int *n;
92 };
93
94
95 #ifdef _KERNEL
96 int x86_64_iopl __P((struct lwp *, void *, register_t *));
97 int x86_64_get_mtrr __P((struct lwp *, void *, register_t *));
98 int x86_64_set_mtrr __P((struct lwp *, void *, register_t *));
99 #else
100 #include <sys/cdefs.h>
101
102 __BEGIN_DECLS
103 int x86_64_get_ldt __P((void *, int));
104 int x86_64_set_ldt __P((void *, int));
105 int x86_64_iopl __P((int));
106 int x86_64_get_ioperm __P((u_long *));
107 int x86_64_set_ioperm __P((u_long *));
108 int x86_64_pmc_info __P((struct x86_64_pmc_info_args *));
109 int x86_64_pmc_startstop __P((struct x86_64_pmc_startstop_args *));
110 int x86_64_pmc_read __P((struct x86_64_pmc_read_args *));
111 int x86_64_set_mtrr __P((struct mtrr *, int *));
112 int x86_64_get_mtrr __P((struct mtrr *, int *));
113 int sysarch __P((int, void *));
114 __END_DECLS
115 #endif
116
117 #endif /* !_AMD64_SYSARCH_H_ */
118