| plan 9 kernel history: overview | file list | diff list |
1997/0327/pc/dat.h (diff list | history)
| 1996/0523/sys/src/9/pc/dat.h:1,5 – 1997/0327/sys/src/9/pc/dat.h:1,7 (short | long | prev | next) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PC architecture cleanup + initial SMP support.
Structures: add Irq, Irqctl], Tss; rename PCIcfg to Pcidev; remove PCMmap. Change MACHP to use array of Mach structures; use VM trick for m. Remove unused entries from conf. Add CPU-specific entries to Mach. Add interrupt routines to PCArch. In PMMU, rename mmutop to mmupdb. In active: change machs and exiting from short to int. rsc Fri Mar 4 12:44:25 2005
1991/0612
| | typedef struct Conf Conf;
1991/0702
| | typedef struct FPsave FPsave;
1997/0327
| | typedef struct Irq Irq; typedef struct Irqctl Irqctl;
1993/0915
| | typedef struct ISAConf ISAConf;
1991/0612
| | typedef struct Label Label; typedef struct Lock Lock;
1996/0523/sys/src/9/pc/dat.h:7,13 –
1997/0327/sys/src/9/pc/dat.h:9,15
|
1991/0612
| | typedef struct Mach Mach;
1993/1013
| | typedef struct Notsave Notsave;
1992/0923
| | typedef struct PCArch PCArch;
1995/0517
| |
1997/0327
| | typedef struct Pcidev Pcidev;
1995/0225
| | typedef struct PCMmap PCMmap;
1991/0717
| | typedef struct Page Page;
1991/0612
| | typedef struct PMMU PMMU;
1996/0523/sys/src/9/pc/dat.h:14,24 –
1997/0327/sys/src/9/pc/dat.h:16,21
|
1991/0703
| | typedef struct Segdesc Segdesc;
1991/0612
| | typedef struct Ureg Ureg;
1996/0523/sys/src/9/pc/dat.h:73,79 –
1997/0327/sys/src/9/pc/dat.h:70,75
|
1992/0807
| | ulong monitor; /* has monitor? */
1992/0625
| | ulong npage0; /* total physical pages of memory */ ulong npage1; /* total physical pages of memory */
1991/0612
| | ulong npage; /* total physical pages of memory */
1992/0625
| | ulong upages; /* user page pool */
1991/0711
| | ulong nimage; /* number of page cache image headers */
1996/0523/sys/src/9/pc/dat.h:81,91 –
1997/0327/sys/src/9/pc/dat.h:77,82
|
1991/0711
| | ulong base0; /* base of bank 0 */ ulong base1; /* base of bank 1 */
1991/0702
| | ulong copymode; /* 0 is copy on write, 1 is copy on reference */
1991/0809
| |
1992/1105
| |
1994/0322
| | ulong ialloc; /* max interrupt time allocation in bytes */
1994/0503
| | ulong pipeqsize; /* size in bytes of pipe queues */
1991/0612
| | };
1996/0523/sys/src/9/pc/dat.h:93,106 –
1997/0327/sys/src/9/pc/dat.h:84,95
|
1991/0612
| | /* * MMU stuff in proc */
1991/0717
| |
1991/0718
| |
1993/0915
| | #define NCOLOR 1
1991/0612
| | struct PMMU {
1991/1004
| |
1997/0327
| | Page* mmupdb; /* page directory base */ Page* mmufree; /* unused page table pages */ Page* mmuused; /* used page table pages */
1991/0612
| | };
1993/1013
| | /*
1996/0523/sys/src/9/pc/dat.h:115,135 –
1997/0327/sys/src/9/pc/dat.h:104,163
|
1993/1013
| |
1991/0612
| | #include "../port/portdat.h"
1997/0327
| | typedef struct { ulong link; /* link (old TSS selector) */ ulong esp0; /* privilege level 0 stack pointer */ ulong ss0; /* privilege level 0 stack selector */ ulong esp1; /* privilege level 1 stack pointer */ ulong ss1; /* privilege level 1 stack selector */ ulong esp2; /* privilege level 2 stack pointer */ ulong ss2; /* privilege level 2 stack selector */ ulong cr3; /* page directory base register */ ulong eip; /* instruction pointer */ ulong eflags; /* flags register */ ulong eax; /* general registers */ ulong ecx; ulong edx; ulong ebx; ulong esp; ulong ebp; ulong esi; ulong edi; ulong es; /* segment selectors */ ulong cs; ulong ss; ulong ds; ulong fs; ulong gs; ulong ldt; /* selector for task's LDT */ ulong iomap; /* I/O map base address + T-bit */ } Tss;
1991/0612
| |
1997/0327
| | struct Segdesc { ulong d0; ulong d1; };
1991/0612
| | struct Mach { int machno; /* physical id of processor */ ulong splpc; /* pc of last caller to splhi */
1997/0327
| | void* pdb; /* page directory base for this processor (va) */ Tss* tss; /* tss for this processor */ Segdesc gdt[6]; /* gdt for this processor */ Proc* proc; /* current process on this processor */ Proc* externup; /* extern register Proc *up */ Page* pdbpool; int pdbcnt;
1991/0612
| | ulong ticks; /* of the clock since boot time */
1994/0728
| |
1997/0327
| | void* alarm; /* alarms bound to this clock */
1994/0311
| |
1991/0612
| | int tlbfault; int tlbpurge;
1996/0523/sys/src/9/pc/dat.h:139,144 –
1997/0327/sys/src/9/pc/dat.h:167,180
|
1991/1112
| | int load;
1991/0612
| | int intr;
1997/0327
| | int loopconst; int cpumhz; int cpuidax; int cpuiddx; char cpuidid[16]; char* cpuidtype;
1991/0612
| | int stack[1]; };
1996/0523/sys/src/9/pc/dat.h:150,169 –
1997/0327/sys/src/9/pc/dat.h:186,197
|
1991/0718
| | #define kmap(p) (KMap*)((p)->pa|KZERO)
1991/0612
| | #define kunmap(k)
1991/0703
| |
1991/0612
| | struct { Lock;
1997/0327
| | int machs; /* bitmap of active CPUs */ int exiting; /* shutdown */ int ispanic; /* shutdown in response to a panic */
1991/0612
| | }active;
1992/0923
| | /*
1996/0523/sys/src/9/pc/dat.h:171,184 –
1997/0327/sys/src/9/pc/dat.h:199,214
|
1992/0923
| | */ struct PCArch {
1997/0327
| | char* id; int (*ident)(void); /* this should be in the model */
1992/0923
| | void (*reset)(void); /* this should be in the model */
1997/0327
| | void (*intrinit)(void); int (*intrenable)(int, int, Irqctl*); void (*clockenable)(void);
1992/0923
| | };
1995/0223
| | /*
1996/0523/sys/src/9/pc/dat.h:191,219 –
1997/0327/sys/src/9/pc/dat.h:221,249
|
1993/0915
| | char type[NAMELEN]; ulong port; ulong irq;
1995/0803
| |
1997/0327
| | ulong dma;
1993/0915
| | ulong mem; ulong size;
1994/0823
| | ulong freq;
1993/0915
| |
1995/0920
| | int nopt; char opt[NISAOPT][ISAOPTLEN];
1993/0915
| | };
1995/0225
| |
1997/0327
| | extern PCArch *arch; /* PC architecture */
1995/0225
| | /*
1997/0327
| | * Each processor sees its own Mach structure at address MACHADDR. * However, the Mach structures must also be available via the per-processor * MMU information array machp, mainly for disambiguation and access to * the clock which is only maintained by the bootstrap processor (0).
1995/0225
| | */
1997/0327
| | Mach* machp[MAXMACH]; #define MACHP(n) (machp[n])
1995/0225
| |
1997/0327
| | extern Mach *m; #define up (((Mach*)MACHADDR)->externup)
1991/0801
| |
1995/0223
| | /* * SCSI bus
1996/0523/sys/src/9/pc/dat.h:234,245 –
1997/0327/sys/src/9/pc/dat.h:264,280
|
1994/0908
| | }; typedef int (*Scsiio)(Target*, int, uchar*, int, void*, int*);
1993/0915
| |
1997/0327
| | typedef struct Irq { void (*f)(Ureg*, void*); /* handler to call */ void* a; /* argument to call it with */
1991/1210
| |
1993/0915
| |
1993/1013
| |
1997/0327
| | Irq* next; /* link to next handler */ } Irq;
1992/0918
| |
1993/0915
| |
1994/0607
| |
1997/0327
| | typedef struct Irqctl { int (*isr)(int); /* get isr bit for this irq */ int (*eoi)(int); /* eoi */ int isintr; Irq* irq; /* handlers on this IRQ */ } Irqctl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||