1 typedef struct Conf Conf;
2 typedef struct Confmem Confmem;
3 typedef struct FPsave FPsave;
4 typedef struct PFPU PFPU;
5 typedef struct ISAConf ISAConf;
6 typedef struct Label Label;
7 typedef struct Lock Lock;
8 typedef struct Memcache Memcache;
9 typedef struct MMMU MMMU;
10 typedef struct Mach Mach;
11 typedef struct Page Page;
12 typedef struct Pcidev Pcidev;
13 typedef struct PhysUart PhysUart;
14 typedef struct PMMU PMMU;
15 typedef struct Proc Proc;
17 typedef struct Soc Soc;
18 typedef struct Uart Uart;
19 typedef struct Ureg Ureg;
22 #pragma incomplete Pcidev
23 #pragma incomplete Ureg
25 #define MAXSYSARG 5 /* for mount(fd, mpt, flag, arg, srv) */
28 * parameters for sysproc.c
30 #define AOUT_MAGIC (E_MAGIC)
49 * emulated floating point
59 ulong regs[Nfpctlregs][3];
88 ulong nmach; /* processors */
89 ulong nproc; /* processes */
90 ulong monitor; /* has monitor? */
91 Confmem mem[1]; /* physical memory */
92 ulong npage; /* total physical pages of memory */
93 usize upages; /* user page pool */
94 ulong copymode; /* 0 is copy on write, 1 is copy on reference */
95 ulong ialloc; /* max interrupt time allocation in bytes */
96 ulong pipeqsize; /* size in bytes of pipe queues */
97 ulong nimage; /* number of page cache image headers */
98 ulong nswap; /* number of swap pages */
99 int nswppo; /* max # of pageouts per segment pass */
100 // ulong hz; /* processor cycle freq */
109 PTE* mmul1; /* l1 for this processor */
118 #define NCOLOR 1 /* 1 level cache, don't worry about VCE's */
122 Page* mmul2cache; /* free mmu pages */
125 #include "../port/portdat.h"
129 int machno; /* physical id of processor */
130 uintptr splpc; /* pc of last caller to splhi */
132 Proc* proc; /* current process */
135 int flushmmu; /* flush current proc mmu state */
137 ulong ticks; /* of the clock since boot time */
138 Label sched; /* scheduler wakeup */
139 Lock alarmlock; /* access to alarm list */
140 void* alarm; /* alarms bound to this clock */
143 Proc* readied; /* for runproc */
144 ulong schedticks; /* next forced context switch */
147 int socrev; /* system-on-chip revision */
158 vlong fastclock; /* last sampled value */
159 uvlong inidle; /* time spent in idlehands() */
163 Perf perf; /* performance counters */
166 uvlong cpuhz; /* speed of cpu */
167 uvlong cyclefreq; /* Frequency of user readable cycle counter */
169 /* save areas for exceptions */
174 #define fiqstack sfiq
175 #define irqstack sirq
176 #define abtstack sabt
177 #define undstack sund
186 #define VA(k) ((uintptr)(k))
187 #define kmap(p) (KMap*)((p)->pa|kseg0)
192 char machs[MAXMACH]; /* active CPUs */
193 int exiting; /* shutdown */
197 Frequency = 1200*1000*1000, /* the processor clock */
200 extern register Mach* m; /* R10 */
201 extern register Proc* up; /* R9 */
203 extern uintptr kseg0;
204 extern Mach* machaddr[MAXMACH];
207 Nvec = 8, /* # of vectors at start of lexception.s */
211 * Layout of physical 0.
213 typedef struct Vectorpage {
214 void (*vectors[Nvec])(void);
219 * a parsed plan9.ini line
236 #define MACHP(n) (machaddr[n])
239 * Horrid. But the alternative is 'defined'.
242 #define DBGFLG (dbgflg[_DBGC_])
248 extern char dbgflg[256];
250 #define dbgprint print /* for now */
253 * hardware info about a device
262 ulong intnum; /* interrupt number */
263 char *type; /* card type, malloced */
264 int nports; /* Number of ports */
265 Devport *ports; /* The ports themselves */
274 /* characteristics of a given cache level */
276 uint level; /* 1 is nearest processor, 2 further away */
277 uint kind; /* I, D or unified */
280 uint nways; /* associativity */
282 uint linelen; /* bytes per cache line */
286 uint waysh; /* shifts for set/way register */
290 struct Soc { /* addr's of SoC controllers */
295 // uintptr sdramd; /* unused */
301 uintptr cesa; /* crypto accel. */
310 uintptr rtc; /* real-time clock */