|
|
1.1 root 1: typedef struct Conf Conf;
2: typedef struct FFrame FFrame;
3: typedef struct FPsave FPsave;
4: typedef struct KMap KMap;
5: typedef struct Label Label;
6: typedef struct Lock Lock;
7: typedef struct MMU MMU;
8: typedef struct Mach Mach;
9: typedef struct PMMU PMMU;
10: typedef struct Portpage Portpage;
11: typedef struct Ureg Ureg;
12: typedef struct User User;
13:
14: #define MACHP(n) (n==0? &mach0 : *(Mach**)0)
15:
16: extern Mach mach0;
17: extern void (*kprofp)(ulong);
18:
19: /*
20: * parameters for sysproc.c
21: */
22: #define AOUT_MAGIC A_MAGIC
23:
24: /*
25: * machine dependent definitions used by ../port/dat.h
26: */
27:
28: struct Lock
29: {
30: char key;
31: ulong pc;
32: ulong sr;
33: };
34:
35: enum
36: {
37: FPinit,
38: FPactive,
39: FPdirty,
40: };
41:
42: struct FPsave
43: {
44: uchar type;
45: uchar size;
46: short reserved;
47: char junk[212]; /* 68881: sizes 24, 180; 68882: 56, 212 */
48: /* this offset known in db */
49: char reg[3*4+8*12];
50: };
51:
52: struct Label
53: {
54: ulong sp;
55: ulong pc;
56: ushort sr;
57: };
58:
59: /*
60: * MMU info included in the Proc structure
61: */
62: struct PMMU
63: {
64: int pmmu_dummy;
65: };
66:
67: struct Conf
68: {
69: int nmach; /* processors */
70: int nproc; /* processes */
71: int monitor; /* has display */
72: ulong npage0; /* total physical pages of memory, bank 0 */
73: ulong npage1; /* total physical pages of memory, bank 1 */
74: ulong npage;
75: ulong base0; /* base of bank 0 */
76: ulong base1; /* base of bank 1 */
77: ulong upages; /* user page pool */
78: ulong nimage; /* number of page cache image headers */
79: ulong nswap; /* number of swap blocks */
80: int nfsyschan; /* number of filsys open channels */
81: int nisdn; /* number of isdn interfaces */
82: int nlapd; /* number of dragnet protocol modules */
83: int copymode; /* 0 is copy on write, 1 is copy on reference */
84: int portispaged; /* 1 if extended I/O port addresses */
85: int nconc; /* number of datakit concentrators */
86: };
87:
88: #include "../port/portdat.h"
89:
90: /*
91: * machine dependent definitions not used by ../port/dat.h
92: */
93: struct KMap
94: {
95: KMap *next;
96: ulong pa;
97: ulong va;
98: };
99: #define VA(k) ((k)->va)
100:
101: struct Mach
102: {
103: /* OFFSETS OF THE FOLLOWING KNOWN BY l.s */
104: int machno; /* physical id of processor */
105: ulong splpc; /* pc of last caller to splhi */
106:
107: /* ordering from here on irrelevant */
108: ulong ticks; /* of the clock since boot time */
109: Proc *proc; /* current process on this processor */
110: Proc *lproc; /* last process on this processor */
111: Label sched; /* scheduler wakeup */
112: Lock alarmlock; /* access to alarm list */
113: void *alarm; /* alarms bound to this clock */
114: int fpstate; /* state of fp registers on machine */
115:
116: int tlbpurge;
117: int tlbfault;
118: int pfault;
119: int cs;
120: int syscall;
121: int load;
122: int intr;
123:
124: /* MUST BE LAST */
125: int stack[1];
126: };
127:
128: /*
129: * gnot bus ports
130: */
131: #define PORTSIZE 64
132: #define PORTSHIFT 6
133: #define PORTSELECT PORT[32]
134:
135: struct Portpage
136: {
137: union{
138: Lock;
139: QLock;
140: };
141: int select;
142: };
143:
144: #define NERR 25
145: #define NNOTE 5
146: struct User
147: {
148: Proc *p;
149: FPsave fpsave; /* address of this is known by vdb */
150: int scallnr; /* sys call number - known by db */
151: Sargs s; /* address of this is known by db */
152: uchar balusave[64]; /* #include botch */
153: int nerrlab;
154: Label errlab[NERR];
155: char error[ERRLEN];
156: char elem[NAMELEN]; /* last name element from namec */
157: Chan *slash;
158: Chan *dot;
159: /*
160: * Rest of structure controlled by devproc.c and friends.
161: * lock(&p->debug) to modify.
162: */
163: Note note[NNOTE];
164: short nnote;
165: short notified; /* sysnoted is due */
166: Note lastnote;
167: int (*notify)(void*, char*);
168: void *ureg;
169: void *dbgreg;
170: };
171:
172: struct
173: {
174: Lock;
175: short machs;
176: short exiting;
177: }active;
178:
179: extern Mach *m;
180: extern User *u;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.