]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/zynq/dat.h
zynq: remove unused statistics fields from Mach structure
[plan9front.git] / sys / src / 9 / zynq / dat.h
1 typedef struct Conf     Conf;
2 typedef struct Confmem  Confmem;
3 typedef struct FPsave   FPsave;
4 typedef struct L1       L1;
5 typedef struct Label    Label;
6 typedef struct Lock     Lock;
7 typedef struct KMap     KMap;
8 typedef struct MMMU     MMMU;
9 typedef struct Mach     Mach;
10 typedef struct Notsave  Notsave;
11 typedef struct Page     Page;
12 typedef struct Proc     Proc;
13 typedef struct PMMU     PMMU;
14 typedef u32int          PTE;
15 typedef struct Ureg     Ureg;
16 typedef struct ISAConf  ISAConf;
17 typedef uvlong          Tval;
18
19 #pragma incomplete Ureg
20
21 #define MAXSYSARG       5       /* for mount(fd, mpt, flag, arg, srv) */
22
23 #define AOUT_MAGIC      (E_MAGIC)
24
25 struct Lock
26 {
27         ulong   key;
28         u32int  sr;
29         uintptr pc;
30         Proc*   p;
31         Mach*   m;
32         int     isilock;
33 };
34
35 struct Label
36 {
37         uintptr sp;
38         uintptr pc;
39 };
40
41 struct FPsave
42 {
43         ulong   exc, scr;
44         uchar   regs[256];
45 };
46
47 /*
48  * FPsave.status
49  */
50 enum
51 {
52         FPinit,
53         FPactive,
54         FPinactive,
55         FPillegal = 0x100
56 };
57
58 struct Confmem
59 {
60         uintptr base;
61         uintptr limit;
62         usize   npage;
63         uintptr kbase;
64         uintptr klimit;
65 };
66
67 struct Conf
68 {
69         ulong   nmach;          /* processors */
70         ulong   nproc;          /* processes */
71         Confmem mem[1];         /* physical memory */
72         ulong   npage;          /* total physical pages of memory */
73         usize   upages;         /* user page pool */
74         ulong   copymode;       /* 0 is copy on write, 1 is copy on reference */
75         ulong   ialloc;         /* max interrupt time allocation in bytes */
76         ulong   pipeqsize;      /* size in bytes of pipe queues */
77         ulong   nimage;         /* number of page cache image headers */
78         ulong   nswap;          /* number of swap pages */
79         int     nswppo;         /* max # of pageouts per segment pass */
80         int     monitor;
81 };
82
83 /*
84  *  things saved in the Proc structure during a notify
85  */
86 struct Notsave {
87         int     emptiness;
88 };
89
90 /*
91  *  MMU stuff in proc
92  */
93 #define NCOLOR  1
94
95 struct PMMU
96 {
97         L1 *l1;
98         Page *mmuused, *mmufree;
99         
100         int nkmap;
101         Page *kmaptable;
102 };
103
104 #include "../port/portdat.h"
105
106 struct L1
107 {
108         Ref;
109         uintptr pa;
110         ulong *va;
111         L1 *next;
112 };
113
114 struct MMMU
115 {
116         L1 l1;
117         L1 *l1free;
118         int nfree;
119         uchar asid;
120 };
121
122 struct Mach
123 {
124         /* known to assembly */
125         int     machno;                 /* physical id of processor */
126         uintptr splpc;                  /* pc of last caller to splhi */
127         Proc*   proc;                   /* current process */
128         ulong   excregs[3];
129         ulong   cycleshi;
130         /* end of known to assembly */
131
132         int     flushmmu;               /* flush current proc mmu state */
133
134         ulong   ticks;                  /* of the clock since boot time */
135         Label   sched;                  /* scheduler wakeup */
136         Lock    alarmlock;              /* access to alarm list */
137         void*   alarm;                  /* alarms bound to this clock */
138         int     inclockintr;
139
140         Proc*   readied;                /* for runproc */
141         ulong   schedticks;             /* next forced context switch */
142
143         ulong   delayloop;
144
145         /* stats */
146         int     tlbfault;
147         int     tlbpurge;
148         int     pfault;
149         int     cs;
150         int     syscall;
151         int     load;
152         int     intr;
153         int     lastintr;
154         int     ilockdepth;
155         Perf    perf;                   /* performance counters */
156
157
158         int     cpumhz;
159         uvlong  cpuhz;                  /* speed of cpu */
160         uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
161         
162         MMMU;
163
164         int     stack[1];
165 };
166
167 struct ISAConf
168 {
169         int dummy;
170         char *type;
171         ulong port;
172         int irq;
173 };
174 #define BUSUNKNOWN -1
175
176 struct
177 {
178         Lock;
179         int     machs;                  /* bitmap of active CPUs */
180         int     exiting;                /* shutdown */
181         int     ispanic;                /* shutdown in response to a panic */
182 }active;
183
184 extern register Mach* m;                        /* R10 */
185 extern register Proc* up;                       /* R9 */
186
187 extern int normalprint;
188
189 extern ulong *mpcore, *slcr;
190
191 void nope(void);
192 #define NOPE nope();
193
194 /*
195  *  hardware info about a device
196  */
197 typedef struct {
198         ulong   port;
199         int     size;
200 } Devport;
201
202 struct DevConf
203 {
204         ulong   intnum;                 /* interrupt number */
205         char    *type;                  /* card type, malloced */
206         int     nports;                 /* Number of ports */
207         Devport *ports;                 /* The ports themselves */
208 };