[BACK]Return to sysarch.h CVS log [TXT][DIR] Up to [local] / sys / arch / amd64 / include

File: [local] / sys / arch / amd64 / include / sysarch.h (download)

Revision 1.1.1.1 (vendor branch), Tue Mar 4 16:05:07 2008 UTC (16 years, 3 months ago) by nbrk
Branch: OPENBSD_4_2_BASE, MAIN
CVS Tags: jornada-partial-support-wip, HEAD
Changes since 1.1: +0 -0 lines

Import of OpenBSD 4.2 release kernel tree with initial code to support 
Jornada 720/728, StrongARM 1110-based handheld PC.
At this point kernel roots on NFS and boots into vfs_mountroot() and traps.
What is supported:
- glass console, Jornada framebuffer (jfb) works in 16bpp direct color mode
(needs some palette tweaks for non black/white/blue colors, i think)
- saic, SA11x0 interrupt controller (needs cleanup)
- sacom, SA11x0 UART (supported only as boot console for now)
- SA11x0 GPIO controller fully supported (but can't handle multiple interrupt
handlers on one gpio pin)
- sassp, SSP port on SA11x0 that attaches spibus
- Jornada microcontroller (jmcu) to control kbd, battery, etc throught
the SPI bus (wskbd attaches on jmcu, but not tested)
- tod functions seem work
- initial code for SA-1111 (chip companion) : this is TODO

Next important steps, i think:
- gpio and intc on sa1111
- pcmcia support for sa11x0 (and sa1111 help logic)
- REAL root on nfs when we have PCMCIA support (we may use any of supported pccard NICs)
- root on wd0! (using already supported PCMCIA-ATA)

/*	$OpenBSD: sysarch.h,v 1.3 2004/02/27 23:45:55 deraadt Exp $	*/
/*	$NetBSD: sysarch.h,v 1.1 2003/04/26 18:39:48 fvdl Exp $	*/

#ifndef _AMD64_SYSARCH_H_
#define _AMD64_SYSARCH_H_

/*
 * Architecture specific syscalls (amd64)
 */
#define AMD64_GET_LDT	0
#define AMD64_SET_LDT	1
#define	AMD64_IOPL	2
#define	AMD64_GET_IOPERM	3
#define	AMD64_SET_IOPERM	4
#define	AMD64_VM86	5
#define	AMD64_PMC_INFO	8
#define	AMD64_PMC_STARTSTOP 9
#define	AMD64_PMC_READ	10
#define AMD64_GET_MTRR   11
#define AMD64_SET_MTRR   12

/*
 * XXX todo.
 */
struct amd64_get_ldt_args {
	int start;
	union descriptor *desc;
	int num;
};

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

struct amd64_iopl_args {
	int iopl;
};

struct amd64_get_ioperm_args {
	u_long *iomap;
};

struct amd64_set_ioperm_args {
	u_long *iomap;
};

struct amd64_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 amd64_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 amd64_pmc_read_args {
	int counter;
	u_int64_t val;
	u_int64_t time;
};

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

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


#ifdef _KERNEL
int amd64_iopl(struct proc *, void *, register_t *);
int amd64_get_mtrr(struct proc *, void *, register_t *);
int amd64_set_mtrr(struct proc *, void *, register_t *);
#else
int amd64_get_ldt(int, union descriptor *, int);
int amd64_set_ldt(int, union descriptor *, int);
int amd64_iopl(int);
int amd64_get_ioperm(u_long *);
int amd64_set_ioperm(u_long *);
int amd64_pmc_info(struct amd64_pmc_info_args *);
int amd64_pmc_startstop(struct amd64_pmc_startstop_args *);
int amd64_pmc_read(struct amd64_pmc_read_args *);
int amd64_set_mtrr(struct mtrr *, int *);
int amd64_get_mtrr(struct mtrr *, int *);
int sysarch(int, void *);
#endif

#endif /* !_AMD64_SYSARCH_H_ */