sysarch.h revision 1.1 1 /* $NetBSD: sysarch.h,v 1.1 2003/04/26 18:39:48 fvdl 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 #if 0
26
27 struct x86_64_get_ldt_args {
28 int start;
29 union descriptor *desc;
30 int num;
31 };
32
33 struct x86_64_set_ldt_args {
34 int start;
35 union descriptor *desc;
36 int num;
37 };
38
39 #endif
40
41 struct x86_64_iopl_args {
42 int iopl;
43 };
44
45 #if 0
46
47 struct x86_64_get_ioperm_args {
48 u_long *iomap;
49 };
50
51 struct x86_64_set_ioperm_args {
52 u_long *iomap;
53 };
54
55 struct x86_64_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
64 #define PMC_INFO_HASTSC 0x01
65
66 #define PMC_NCOUNTERS 2
67
68 struct x86_64_pmc_startstop_args {
69 int counter;
70 u_int64_t val;
71 u_int8_t event;
72 u_int8_t unit;
73 u_int8_t compare;
74 u_int8_t flags;
75 };
76
77 #define PMC_SETUP_KERNEL 0x01
78 #define PMC_SETUP_USER 0x02
79 #define PMC_SETUP_EDGE 0x04
80 #define PMC_SETUP_INV 0x08
81
82 struct x86_64_pmc_read_args {
83 int counter;
84 u_int64_t val;
85 u_int64_t time;
86 };
87
88 #endif /* todo */
89
90 struct x86_64_get_mtrr_args {
91 struct mtrr *mtrrp;
92 int *n;
93 };
94
95 struct x86_64_set_mtrr_args {
96 struct mtrr *mtrrp;
97 int *n;
98 };
99
100
101 #ifdef _KERNEL
102 int x86_64_iopl __P((struct lwp *, void *, register_t *));
103 int x86_64_get_mtrr __P((struct lwp *, void *, register_t *));
104 int x86_64_set_mtrr __P((struct lwp *, void *, register_t *));
105 #else
106 int x86_64_get_ldt __P((int, union descriptor *, int));
107 int x86_64_set_ldt __P((int, union descriptor *, int));
108 int x86_64_iopl __P((int));
109 int x86_64_get_ioperm __P((u_long *));
110 int x86_64_set_ioperm __P((u_long *));
111 int x86_64_pmc_info __P((struct x86_64_pmc_info_args *));
112 int x86_64_pmc_startstop __P((struct x86_64_pmc_startstop_args *));
113 int x86_64_pmc_read __P((struct x86_64_pmc_read_args *));
114 int x86_64_set_mtrr __P((struct mtrr *, int *));
115 int x86_64_get_mtrr __P((struct mtrr *, int *));
116 int sysarch __P((int, void *));
117 #endif
118
119 #endif /* !_AMD64_SYSARCH_H_ */
120