Mach* isn't portable code. move to new file archdat.h; make the dat.h's reflect this. the full list is Lock, Label, Filter, Mach, MACHP(), Ticks also definition of m and u, since extern register isn't wired up for the pc port Reference: /n/atom/patch/applied2013/fsarchmach Date: Mon Aug 26 04:45:05 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/fs/port/portdat.h Mon Aug 26 04:41:41 2013 +++ /sys/src/fs/port/portdat.h Mon Aug 26 04:41:42 2013 @@ -107,7 +107,6 @@ typedef struct Rabuf Rabuf; typedef struct Rendez Rendez; typedef struct Filter Filter; -typedef ulong Float; typedef struct Tlock Tlock; typedef struct Cache Cache; typedef struct Centry Centry; @@ -116,30 +115,12 @@ #pragma incomplete Auth #pragma incomplete Ureg -struct Lock -{ - ulong* sbsem; /* addr of sync bus semaphore */ - uintptr pc; - ulong sr; - - Mach *m; - User *p; - char isilock; -}; - struct Rendez { Lock; User* p; }; -struct Filter -{ - ulong count; /* count and old count kept separate */ - ulong oldcount; /* so interrput can read them */ - Float filter[3]; /* filter */ -}; - struct QLock { Lock; /* to use object */ @@ -517,12 +498,6 @@ Super1; }; -struct Label -{ - uintptr pc; - uintptr sp; -}; - struct Talarm { Lock; @@ -617,36 +592,6 @@ MAXCAT, }; -struct Mach -{ - int machno; /* physical id of processor */ - Timet ticks; /* of the clock since boot time */ - int lights; /* light lights, this processor */ - Filter idle; - - User* proc; /* current process on this processor */ - Label sched; /* scheduler wakeup */ -// Lock alarmlock; /* access to alarm list */ -// void* alarm; /* alarms bound to this clock */ - - void (*intr)(Ureg*, uintptr); /* pending interrupt */ - User* intrp; /* process that was interrupted */ - ulong cause; /* arg to intr */ - Ureg* ureg; /* arg to intr */ - int loopconst; - -// Lock apictimerlock; - int cpumhz; - uvlong cpuhz; - ulong cpuidax; - ulong cpuiddx; - char cpuidid[16]; - int havetsc; -// int havepge; -// uvlong tscticks; -// uchar stack[1]; -}; - #define MAXSTACK 16000 #define NHAS 200 struct User @@ -689,6 +634,7 @@ Lock; int machs; int exiting; + int thunderbirdsarego; } active; struct Command @@ -976,14 +922,10 @@ Bres = 1<<4, /* reserved, never renamed */ }; -extern /*register*/ Mach* m; -extern /*register*/ User* u; extern Talarm talarm; Conf conf; Cons cons; -#define MACHP(n) ((Mach*)(MACHADDR+n*BY2PG)) -#define Ticks MACHP(0)->ticks #pragma varargck type "Z" Device* #pragma varargck type "T" Timet --- /sys/src/fs/pc/archdat.h Thu Jan 1 00:00:00 1970 +++ /sys/src/fs/pc/archdat.h Mon Aug 26 04:41:43 2013 @@ -0,0 +1,98 @@ +/* forward declarations */ +typedef struct User User; + +typedef struct Filter Filter; +typedef ulong Float; +typedef struct Label Label; +typedef struct Lock Lock; +typedef struct Mach Mach; +typedef struct Mbank Mbank; +typedef struct Mbank Mbank; +typedef struct Mconf Mconf; +typedef struct Mconf Mconf; +typedef u32int Mpl; +typedef struct Pcidev Pcidev; +typedef struct Segdesc Segdesc; +typedef ulong uintmem; + +#pragma incomplete Pcidev + +#pragma varargck type "P" uintmem +#pragma varargck type "τ" int + +struct Lock +{ + ulong* sbsem; /* addr of sync bus semaphore */ + uintptr pc; + ulong sr; + + Mach *m; + User *p; + char isilock; +}; + +struct Filter +{ + ulong count; /* count and old count kept separate */ + ulong oldcount; /* so interrput can read them */ + Float filter[3]; /* filter */ +}; + +struct Label +{ + uintptr pc; + uintptr sp; +}; + +struct Mach +{ + int machno; /* physical id of processor */ + long ticks; /* of the clock since boot time */ + int lights; /* light lights, this processor */ + Filter idle; + + User* proc; /* current process on this processor */ + Label sched; /* scheduler wakeup */ + + User* intrp; /* process that was interrupted */ + ulong cause; /* arg to intr */ +// Ureg* ureg; /* arg to intr */ + int loopconst; + + int cpumhz; + uvlong cpuhz; + ulong cpuidax; + ulong cpuiddx; + char cpuidid[16]; + int havetsc; +}; + +enum{ + MAXBANK = 4, /* discontiguous memory banks. */ +}; + +struct Segdesc { + ulong d0; + ulong d1; +}; + +struct Mbank { + ulong base; + ulong limit; +}; + +struct Mconf { + Lock; + Mbank bank[MAXBANK]; + int nbank; + ulong topofmem; +}; + +extern Mach mach0; +extern Mconf mconf; +extern char nvrfile[128]; +extern /*register*/ Mach* m; +extern /*register*/ User* u; + +#define MACHP(n) ((Mach*)(MACHADDR+n*BY2PG)) +#define Ticks MACHP(0)->ticks --- /sys/src/fs/aska/dat.h Mon Aug 26 04:41:43 2013 +++ /sys/src/fs/aska/dat.h Mon Aug 26 04:41:44 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/buda/dat.h Mon Aug 26 04:41:45 2013 +++ /sys/src/fs/buda/dat.h Mon Aug 26 04:41:45 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/dahlonega/dat.h Mon Aug 26 04:41:46 2013 +++ /sys/src/fs/dahlonega/dat.h Mon Aug 26 04:41:46 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/fairyland/dat.h Mon Aug 26 04:41:47 2013 +++ /sys/src/fs/fairyland/dat.h Mon Aug 26 04:41:47 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/fs/dat.h Mon Aug 26 04:41:48 2013 +++ /sys/src/fs/fs/dat.h Mon Aug 26 04:41:49 2013 @@ -6,31 +6,7 @@ */ enum{ RBUFSIZE = 4*1024, /* raw buffer size */ - MAXBANK = 8, }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct Segdesc Segdesc; -struct Segdesc{ - ulong d0; - ulong d1; -}; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/fs64/dat.h Mon Aug 26 04:41:49 2013 +++ /sys/src/fs/fs64/dat.h Mon Aug 26 04:41:50 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/ila/dat.h Mon Aug 26 04:41:51 2013 +++ /sys/src/fs/ila/dat.h Mon Aug 26 04:41:51 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/odum/dat.h Mon Aug 26 04:41:52 2013 +++ /sys/src/fs/odum/dat.h Mon Aug 26 04:41:52 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128]; --- /sys/src/fs/wrens/dat.h Mon Aug 26 04:41:53 2013 +++ /sys/src/fs/wrens/dat.h Mon Aug 26 04:41:54 2013 @@ -6,30 +6,7 @@ */ enum{ RBUFSIZE = 8*1024, /* raw buffer size */ - MAXBANK = 4, /* discontiguous memory banks. */ }; -typedef ulong uintmem; - +#include "../pc/archdat.h" #include "../port/portdat.h" - -typedef struct{ - ulong d0; - ulong d1; -}Segdesc; - -typedef struct Mbank { - ulong base; - ulong limit; -} Mbank; - -typedef struct Mconf { - Lock; - Mbank bank[MAXBANK]; - int nbank; - ulong topofmem; -} Mconf; - -extern Mach mach0; -extern Mconf mconf; -extern char nvrfile[128];