1 typedef struct Conf Conf;
2 typedef struct Confmem Confmem;
3 typedef struct FPsave FPsave;
4 typedef struct PFPU PFPU;
5 typedef struct KMap KMap;
6 typedef struct Lance Lance;
7 typedef struct Lancemem Lancemem;
8 typedef struct Label Label;
9 typedef struct Lock Lock;
10 typedef struct Mach Mach;
11 typedef struct MMU MMU;
12 typedef struct PMMU PMMU;
13 typedef struct Softtlb Softtlb;
14 typedef struct Ureg Ureg;
15 typedef struct Proc Proc;
16 typedef struct ISAConf ISAConf;
19 #define MAXSYSARG 5 /* for mount(fd, afd, mpt, flag, arg) */
22 * parameters for sysproc.c and rebootcmd.c
24 #define AOUT_MAGIC V_MAGIC || magic==M_MAGIC
25 /* r3k or r4k boot images */
26 #define BOOT_MAGIC (0x160<<16) || magic == ((0x160<<16)|3)
29 * machine dependent definitions used by ../port/dat.h
34 ulong key; /* semaphore (non-zero = locked) */
58 ulong nmach; /* processors */
59 ulong nproc; /* processes */
61 ulong npage; /* total physical pages of memory */
62 ulong upages; /* user page pool */
63 ulong nimage; /* number of page cache image headers */
64 ulong nswap; /* number of swap pages */
65 int nswppo; /* max # of pageouts per segment pass */
66 ulong copymode; /* 0 is copy on write, 1 is copy on reference */
67 ulong ialloc; /* bytes available for interrupt-time allocation */
68 ulong pipeqsize; /* size in bytes of pipe queues */
69 int nuart; /* number of uart devices */
85 * floating point registers
88 Nfpregs = 32, /* floats; half as many doubles */
92 * emulated floating point (mips32r2 with ieee fp regs)
93 * fpstate is separate, kept in Proc
97 /* /dev/proc expects the registers to be first in FPsave */
98 ulong reg[Nfpregs]; /* the canonical bits */
100 ulong fpstatus; /* both are fcr31 */
104 int fpdelayexec; /* executing delay slot of branch */
105 uintptr fpdelaypc; /* pc to resume at after */
106 ulong fpdelaysts; /* save across user-mode delay-slot execution */
108 /* stuck-fault detection */
109 uintptr fppc; /* addr of last fault */
110 int fpcnt; /* how many consecutive at that addr */
121 /* floating point state */
127 /* bit meaning floating point illegal */
132 * mmu goo in the Proc structure
136 int pidonmach[MAXMACH];
139 #include "../port/portdat.h"
143 /* the following are all known by l.s and cannot be moved */
144 int machno; /* physical id of processor */
146 Proc* proc; /* process on this processor */
147 ulong splpc; /* pc that called splhi() */
150 /* the following is safe to move */
152 ulong ticks; /* of the clock since boot time */
153 Label sched; /* scheduler wakeup */
154 void* alarm; /* alarms bound to this clock */
155 int lastpid; /* last pid allocated on this machine */
156 Proc* pidproc[NTLBPID]; /* proc that owns tlbpid on this mach */
157 KMap* kactive; /* active on this machine */
159 uchar ktlbx[NTLB]; /* tlb index used for kmap */
161 int speed; /* cpu speed */
162 ulong delayloop; /* for the delay() routine */
163 ulong fairness; /* for runproc */
167 Perf perf; /* performance counters */
168 uvlong cyclefreq; /* Frequency of user readable cycle counter */
170 /* for per-processor timers */
177 Proc* readied; /* for runproc */
178 ulong schedticks; /* next forced context switch */
185 int hashcoll; /* soft-tlb hash collisions */
186 int paststartup; /* for putktlb */
198 KMap* konmach[MAXMACH];
200 ulong pc; /* of caller to kmap() */
203 #define VA(k) ((k)->virt)
204 #define PPN(x) ((ulong)(x)>>6)
215 char machs[MAXMACH]; /* active cpus */
219 extern register Mach *m;
220 extern register Proc *up;