xref: /inferno-os/os/ipaq1110/dat.h (revision 74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a)
1 typedef struct Conf	Conf;
2 typedef struct Dma	Dma;
3 typedef struct FPU	FPU;
4 typedef struct FPenv	FPenv;
5 typedef struct Label	Label;
6 typedef struct Lock	Lock;
7 typedef struct Mach	Mach;
8 typedef struct Ureg	Ureg;
9 typedef struct ISAConf	ISAConf;
10 typedef struct PCMmap	PCMmap;
11 typedef struct PCMslot	PCMslot;
12 
13 typedef ulong Instr;
14 
15 struct Conf
16 {
17 	ulong	nmach;			/* processors */
18 	ulong	nproc;			/* processes */
19 	ulong	npage0;			/* total physical pages of memory */
20 	ulong	npage1;			/* total physical pages of memory */
21 	ulong	topofmem;		/* highest physical address + 1 */
22 	ulong	npage;			/* total physical pages of memory */
23 	ulong	base0;			/* base of bank 0 */
24 	ulong	base1;			/* base of bank 1 */
25 	ulong	ialloc;			/* max interrupt time allocation in bytes */
26 
27 	int		useminicache;		/* use mini cache: screen.c/lcd.c */
28 	int		textwrite;			/* writeable text segment, for debug */
29 	int		portrait;	/* display orientation */
30 };
31 
32 #define NISAOPT 8
33 struct ISAConf {
34 	char	type[KNAMELEN];
35 	ulong	port;
36 	ulong	irq;
37 	int	itype;
38 	ulong	dma;
39 	ulong	mem;
40 	ulong	size;
41 	ulong	freq;
42 
43 	int	nopt;
44 	char	*opt[NISAOPT];
45 };
46 
47 /*
48  * FPenv.status
49  */
50 enum
51 {
52 	FPINIT,
53 	FPACTIVE,
54 	FPINACTIVE,
55 };
56 
57 struct	FPenv
58 {
59 	ulong	status;
60 	ulong	control;
61 	ushort	fpistate;	/* emulated fp */
62 	ulong	regs[8][3];	/* emulated fp */
63 };
64 
65 /*
66  * This structure must agree with fpsave and fprestore asm routines
67  */
68 struct	FPU
69 {
70 	FPenv	env;
71 };
72 
73 struct Label
74 {
75 	ulong	sp;
76 	ulong	pc;
77 };
78 
79 struct Lock
80 {
81 	ulong	key;
82 	ulong	sr;
83 	ulong	pc;
84 	int	pri;
85 };
86 
87 #include "../port/portdat.h"
88 
89 /*
90  *  machine dependent definitions not used by ../port/portdat.h
91  */
92 struct Mach
93 {
94 	/* OFFSETS OF THE FOLLOWING KNOWN BY l.s */
95 	ulong	splpc;		/* pc of last caller to splhi */
96 
97 	/* ordering from here on irrelevant */
98 
99 	int	machno;		/* physical id of processor */
100 	ulong	ticks;			/* of the clock since boot time */
101 	Proc	*proc;			/* current process on this processor */
102 	Label	sched;			/* scheduler wakeup */
103 	Lock	alarmlock;		/* access to alarm list */
104 	void	*alarm;			/* alarms bound to this clock */
105 	ulong	cpuhz;
106 
107 	/* stacks for exceptions */
108 	ulong	fiqstack[4];
109 	ulong	irqstack[4];
110 	ulong	abtstack[4];
111 	ulong	undstack[4];
112 
113 	int	stack[1];
114 };
115 
116 #define	MACHP(n)	(n == 0 ? (Mach*)(MACHADDR) : (Mach*)0)
117 
118 extern Mach *m;
119 extern Proc *up;
120 
121 typedef struct MemBank {
122 	uint	pbase;
123 	uint	plimit;
124 	uint	vbase;
125 	uint	vlimit;
126 } MemBank;
127 
128 /*
129  * Layout at virtual address 0.
130  */
131 typedef struct Vectorpage {
132 	void	(*vectors[8])(void);
133 	uint	vtable[8];
134 } Vectorpage;
135 extern Vectorpage *page0;
136