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