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