Home | History | Annotate | Line # | Download | only in include
sysarch.h revision 1.16
      1  1.16     perry /*	$NetBSD: sysarch.h,v 1.16 2005/12/26 19:23:59 perry Exp $	*/
      2   1.3       cgd 
      3   1.2   mycroft #ifndef _I386_SYSARCH_H_
      4   1.2   mycroft #define _I386_SYSARCH_H_
      5   1.2   mycroft 
      6   1.1    brezak /*
      7   1.1    brezak  * Architecture specific syscalls (i386)
      8   1.1    brezak  */
      9   1.1    brezak #define I386_GET_LDT	0
     10   1.1    brezak #define I386_SET_LDT	1
     11   1.7   mycroft #define	I386_IOPL	2
     12   1.7   mycroft #define	I386_GET_IOPERM	3
     13   1.7   mycroft #define	I386_SET_IOPERM	4
     14  1.14  christos #define	I386_OLD_VM86	5
     15  1.10   thorpej #define	I386_PMC_INFO	8
     16  1.10   thorpej #define	I386_PMC_STARTSTOP 9
     17  1.10   thorpej #define	I386_PMC_READ	10
     18  1.11      fvdl #define I386_GET_MTRR	11
     19  1.11      fvdl #define I386_SET_MTRR	12
     20  1.14  christos #define	I386_VM86	13
     21   1.5   mycroft 
     22   1.5   mycroft struct i386_get_ldt_args {
     23   1.5   mycroft 	int start;
     24   1.5   mycroft 	union descriptor *desc;
     25   1.5   mycroft 	int num;
     26   1.5   mycroft };
     27   1.5   mycroft 
     28   1.5   mycroft struct i386_set_ldt_args {
     29   1.5   mycroft 	int start;
     30   1.5   mycroft 	union descriptor *desc;
     31   1.5   mycroft 	int num;
     32   1.5   mycroft };
     33   1.1    brezak 
     34  1.11      fvdl struct i386_get_mtrr_args {
     35  1.11      fvdl 	struct mtrr *mtrrp;
     36  1.11      fvdl 	int *n;
     37  1.11      fvdl };
     38  1.11      fvdl 
     39  1.11      fvdl struct i386_set_mtrr_args {
     40  1.11      fvdl 	struct mtrr *mtrrp;
     41  1.11      fvdl 	int *n;
     42  1.11      fvdl };
     43  1.11      fvdl 
     44   1.7   mycroft struct i386_iopl_args {
     45   1.7   mycroft 	int iopl;
     46   1.7   mycroft };
     47   1.7   mycroft 
     48   1.7   mycroft struct i386_get_ioperm_args {
     49   1.7   mycroft 	u_long *iomap;
     50   1.7   mycroft };
     51   1.7   mycroft 
     52   1.7   mycroft struct i386_set_ioperm_args {
     53   1.7   mycroft 	u_long *iomap;
     54   1.7   mycroft };
     55   1.7   mycroft 
     56  1.10   thorpej struct i386_pmc_info_args {
     57  1.10   thorpej 	int	type;
     58  1.10   thorpej 	int	flags;
     59  1.10   thorpej };
     60  1.10   thorpej 
     61  1.10   thorpej #define	PMC_TYPE_NONE		0
     62  1.10   thorpej #define	PMC_TYPE_I586		1
     63  1.10   thorpej #define	PMC_TYPE_I686		2
     64  1.12  gmcgarry #define	PMC_TYPE_K7		3
     65  1.10   thorpej 
     66  1.10   thorpej #define	PMC_INFO_HASTSC		0x01
     67  1.10   thorpej 
     68  1.12  gmcgarry #define	PMC_NCOUNTERS		4
     69  1.10   thorpej 
     70  1.10   thorpej struct i386_pmc_startstop_args {
     71  1.10   thorpej 	int counter;
     72  1.16     perry 	uint64_t val;
     73  1.16     perry 	uint8_t event;
     74  1.16     perry 	uint8_t unit;
     75  1.16     perry 	uint8_t compare;
     76  1.16     perry 	uint8_t flags;
     77  1.10   thorpej };
     78  1.10   thorpej 
     79  1.10   thorpej #define	PMC_SETUP_KERNEL	0x01
     80  1.10   thorpej #define	PMC_SETUP_USER		0x02
     81  1.10   thorpej #define	PMC_SETUP_EDGE		0x04
     82  1.10   thorpej #define	PMC_SETUP_INV		0x08
     83  1.10   thorpej 
     84  1.10   thorpej struct i386_pmc_read_args {
     85  1.10   thorpej 	int counter;
     86  1.16     perry 	uint64_t val;
     87  1.16     perry 	uint64_t time;
     88  1.10   thorpej };
     89  1.10   thorpej 
     90  1.11      fvdl struct mtrr;
     91  1.11      fvdl 
     92   1.4       jtc #ifndef _KERNEL
     93  1.13    kleink #include <sys/cdefs.h>
     94  1.13    kleink 
     95  1.13    kleink __BEGIN_DECLS
     96  1.15  junyoung int i386_get_ldt(int, union descriptor *, int);
     97  1.15  junyoung int i386_set_ldt(int, union descriptor *, int);
     98  1.15  junyoung int i386_iopl(int);
     99  1.15  junyoung int i386_get_ioperm(u_long *);
    100  1.15  junyoung int i386_set_ioperm(u_long *);
    101  1.15  junyoung int i386_pmc_info(struct i386_pmc_info_args *);
    102  1.15  junyoung int i386_pmc_startstop(struct i386_pmc_startstop_args *);
    103  1.15  junyoung int i386_pmc_read(struct i386_pmc_read_args *);
    104  1.15  junyoung int i386_set_mtrr(struct mtrr *, int *);
    105  1.15  junyoung int i386_get_mtrr(struct mtrr *, int *);
    106  1.15  junyoung int sysarch(int, void *);
    107  1.13    kleink __END_DECLS
    108   1.1    brezak #endif
    109   1.2   mycroft 
    110   1.2   mycroft #endif /* !_I386_SYSARCH_H_ */
    111