summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include/sysarch.h
blob: 6152204011f28c2c508a2158e80afa2927e66d7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*	$NetBSD: sysarch.h,v 1.2 2003/09/11 09:40:11 kleink Exp $	*/

#ifndef _AMD64_SYSARCH_H_
#define _AMD64_SYSARCH_H_

/*
 * Architecture specific syscalls (amd64)
 */
#define X86_64_GET_LDT	0
#define X86_64_SET_LDT	1
#define	X86_64_IOPL	2
#define	X86_64_GET_IOPERM	3
#define	X86_64_SET_IOPERM	4
#define	X86_64_VM86	5
#define	X86_64_PMC_INFO	8
#define	X86_64_PMC_STARTSTOP 9
#define	X86_64_PMC_READ	10
#define X86_64_GET_MTRR   11
#define X86_64_SET_MTRR   12

/*
 * XXXfvdl todo.
 */

#if 0

struct x86_64_get_ldt_args {
	int start;
	union descriptor *desc;
	int num;
};

struct x86_64_set_ldt_args {
	int start;
	union descriptor *desc;
	int num;
};

#endif

struct x86_64_iopl_args {
	int iopl;
};

#if 0

struct x86_64_get_ioperm_args {
	u_long *iomap;
};

struct x86_64_set_ioperm_args {
	u_long *iomap;
};

struct x86_64_pmc_info_args {
	int	type;
	int	flags;
};

#define	PMC_TYPE_NONE		0
#define	PMC_TYPE_I586		1
#define	PMC_TYPE_I686		2

#define	PMC_INFO_HASTSC		0x01

#define	PMC_NCOUNTERS		2

struct x86_64_pmc_startstop_args {
	int counter;
	u_int64_t val;
	u_int8_t event;
	u_int8_t unit;
	u_int8_t compare;
	u_int8_t flags;
};

#define	PMC_SETUP_KERNEL	0x01
#define	PMC_SETUP_USER		0x02
#define	PMC_SETUP_EDGE		0x04
#define	PMC_SETUP_INV		0x08

struct x86_64_pmc_read_args {
	int counter;
	u_int64_t val;
	u_int64_t time;
};

#endif /* todo */

struct x86_64_get_mtrr_args {
	struct mtrr *mtrrp;
	int *n;
};

struct x86_64_set_mtrr_args {
	struct mtrr *mtrrp;
	int *n;
};


#ifdef _KERNEL
int x86_64_iopl __P((struct lwp *, void *, register_t *));
int x86_64_get_mtrr __P((struct lwp *, void *, register_t *));
int x86_64_set_mtrr __P((struct lwp *, void *, register_t *));
#else
#include <sys/cdefs.h>

__BEGIN_DECLS
int x86_64_get_ldt __P((int, union descriptor *, int));
int x86_64_set_ldt __P((int, union descriptor *, int));
int x86_64_iopl __P((int));
int x86_64_get_ioperm __P((u_long *));
int x86_64_set_ioperm __P((u_long *));
int x86_64_pmc_info __P((struct x86_64_pmc_info_args *));
int x86_64_pmc_startstop __P((struct x86_64_pmc_startstop_args *));
int x86_64_pmc_read __P((struct x86_64_pmc_read_args *));
int x86_64_set_mtrr __P((struct mtrr *, int *));
int x86_64_get_mtrr __P((struct mtrr *, int *));
int sysarch __P((int, void *));
__END_DECLS
#endif

#endif /* !_AMD64_SYSARCH_H_ */