]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/omap4/dat.h
31bf462f02d03a78fccae56aecb3764bc16beef8
[plan9front.git] / sys / src / 9 / omap4 / dat.h
1 typedef struct Lock Lock;
2 typedef struct Label Label;
3 typedef struct Ureg Ureg;
4 typedef struct Mach Mach;
5 typedef struct FPsave FPsave;
6 typedef struct Notsave Notsave;
7 typedef struct PMMU PMMU;
8 typedef struct Confmem Confmem;
9 typedef struct Conf Conf;
10 typedef struct Proc Proc;
11 typedef struct ISAConf ISAConf;
12 typedef uvlong Tval;
13 typedef void KMap;
14 #define VA(k)           ((uintptr)(k))
15 #define kmap(p)         (KMap*)((p)->pa|kseg0)
16 #define kunmap(k)
17
18 #pragma incomplete Ureg
19
20 struct Lock
21 {
22         ulong   key;
23         u32int  sr;
24         uintptr pc;
25         Proc*   p;
26         Mach*   m;
27         int     isilock;
28 };
29
30 struct Label
31 {
32         ulong sp;
33         ulong pc;
34 };
35
36 struct FPsave
37 {
38         ulong status;
39         ulong control;
40         ulong regs[8][3];
41         int fpstate;
42 };
43
44 enum
45 {
46         FPinit,
47         FPactive,
48         FPinactive,
49 };
50
51 struct Notsave
52 {
53         int emptiness;
54 };
55
56 struct PMMU
57 {
58         ulong l1[USTKTOP / MiB];
59 };
60
61 #include "../port/portdat.h"
62
63 struct Mach
64 {
65         int     machno;                 /* physical id of processor */
66         uintptr splpc;                  /* pc of last caller to splhi */
67
68         Proc*   proc;                   /* current process */
69         Proc*   externup;
70
71         int     flushmmu;               /* flush current proc mmu state */
72
73         ulong   ticks;                  /* of the clock since boot time */
74         Label   sched;                  /* scheduler wakeup */
75         Lock    alarmlock;              /* access to alarm list */
76         void*   alarm;                  /* alarms bound to this clock */
77         int     inclockintr;
78
79         Proc*   readied;                /* for runproc */
80         ulong   schedticks;             /* next forced context switch */
81
82         int     cputype;
83         ulong   delayloop;
84
85         /* stats */
86         int     tlbfault;
87         int     tlbpurge;
88         int     pfault;
89         int     cs;
90         int     syscall;
91         int     load;
92         int     intr;
93         uvlong  fastclock;              /* last sampled value */
94         uvlong  inidle;                 /* time spent in idlehands() */
95         ulong   spuriousintr;
96         int     lastintr;
97         int     ilockdepth;
98         Perf    perf;
99         uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
100
101 };
102
103 struct Confmem
104 {
105         uintptr base;
106         usize   npage;
107         uintptr limit;
108         uintptr kbase;
109         uintptr klimit;
110 };
111
112 struct Conf
113 {
114         ulong   nmach;          /* processors */
115         ulong   nproc;          /* processes */
116         Confmem mem[1];         /* physical memory */
117         ulong   npage;          /* total physical pages of memory */
118         usize   upages;         /* user page pool */
119         ulong   copymode;       /* 0 is copy on write, 1 is copy on reference */
120         ulong   ialloc;         /* max interrupt time allocation in bytes */
121         ulong   pipeqsize;      /* size in bytes of pipe queues */
122         ulong   nimage;         /* number of page cache image headers */
123         ulong   nswap;          /* number of swap pages */
124         int     nswppo;         /* max # of pageouts per segment pass */
125         ulong   hz;             /* processor cycle freq */
126         ulong   mhz;
127         int     monitor;        /* flag */
128 };
129
130 struct
131 {
132         Lock;
133         int     machs;                  /* bitmap of active CPUs */
134         int     exiting;                /* shutdown */
135         int     ispanic;                /* shutdown in response to a panic */
136 }active;
137
138 extern Mach *m;
139 #define up (((Mach*)MACHADDR)->externup)
140 extern Mach* machaddr[MAXMACH];
141 #define MACHP(n)        (machaddr[n])
142 extern uintptr kseg0;
143
144 #define AOUT_MAGIC (E_MAGIC)
145 #define NCOLOR 1
146
147 struct ISAConf
148 {
149         char *type;
150         ulong port, irq;
151 };