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;
18 #define MAXSYSARG 5 /* for mount(fd, afd, mpt, flag, arg) */
21 * parameters for sysproc.c and rebootcmd.c
23 #define AOUT_MAGIC V_MAGIC || magic==M_MAGIC
24 /* r3k or r4k boot images */
25 #define BOOT_MAGIC (0x160<<16) || magic == ((0x160<<16)|3)
28 * machine dependent definitions used by ../port/dat.h
33 ulong key; /* semaphore (non-zero = locked) */
57 ulong nmach; /* processors */
58 ulong nproc; /* processes */
60 ulong npage; /* total physical pages of memory */
61 ulong upages; /* user page pool */
62 ulong nimage; /* number of page cache image headers */
63 ulong nswap; /* number of swap pages */
64 int nswppo; /* max # of pageouts per segment pass */
65 ulong copymode; /* 0 is copy on write, 1 is copy on reference */
66 ulong ialloc; /* bytes available for interrupt-time allocation */
67 ulong pipeqsize; /* size in bytes of pipe queues */
68 int nuart; /* number of uart devices */
74 * floating point registers
77 Nfpregs = 32, /* floats; half as many doubles */
81 * emulated floating point (mips32r2 with ieee fp regs)
82 * fpstate is separate, kept in Proc
86 /* /dev/proc expects the registers to be first in FPsave */
87 ulong reg[Nfpregs]; /* the canonical bits */
89 ulong fpstatus; /* both are fcr31 */
93 int fpdelayexec; /* executing delay slot of branch */
94 uintptr fpdelaypc; /* pc to resume at after */
95 ulong fpdelaysts; /* save across user-mode delay-slot execution */
97 /* stuck-fault detection */
98 uintptr fppc; /* addr of last fault */
99 int fpcnt; /* how many consecutive at that addr */
110 /* floating point state */
116 /* bit meaning floating point illegal */
121 * mmu goo in the Proc structure
125 int pidonmach[MAXMACH];
128 #include "../port/portdat.h"
132 /* the following are all known by l.s and cannot be moved */
133 int machno; /* physical id of processor */
135 Proc* proc; /* process on this processor */
136 ulong splpc; /* pc that called splhi() */
139 /* the following is safe to move */
141 ulong ticks; /* of the clock since boot time */
142 Label sched; /* scheduler wakeup */
143 void* alarm; /* alarms bound to this clock */
144 int lastpid; /* last pid allocated on this machine */
145 Proc* pidproc[NTLBPID]; /* proc that owns tlbpid on this mach */
146 KMap* kactive; /* active on this machine */
148 uchar ktlbx[NTLB]; /* tlb index used for kmap */
150 int speed; /* cpu speed */
151 ulong delayloop; /* for the delay() routine */
152 ulong fairness; /* for runproc */
156 Perf perf; /* performance counters */
157 uvlong cyclefreq; /* Frequency of user readable cycle counter */
159 /* for per-processor timers */
166 Proc* readied; /* for runproc */
167 ulong schedticks; /* next forced context switch */
174 int hashcoll; /* soft-tlb hash collisions */
175 int paststartup; /* for putktlb */
187 KMap* konmach[MAXMACH];
189 ulong pc; /* of caller to kmap() */
192 #define VA(k) ((k)->virt)
193 #define PPN(x) ((ulong)(x)>>6)
204 char machs[MAXMACH]; /* active cpus */
208 extern register Mach *m;
209 extern register Proc *up;