]> git.lizzy.rs Git - plan9front.git/commitdiff
kernel: clean up Mach structure
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 25 Apr 2021 15:41:34 +0000 (17:41 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 25 Apr 2021 15:41:34 +0000 (17:41 +0200)
Remove unused fields and factor common fields into a
new PMach struct in port/portdat.h.

The fields machno, splpc and proc are not moved to
PMach as they are part of the known offsets from
assembly (l.s).

13 files changed:
sys/src/9/bcm/dat.h
sys/src/9/bcm64/dat.h
sys/src/9/cycv/dat.h
sys/src/9/kw/dat.h
sys/src/9/mtx/dat.h
sys/src/9/omap/dat.h
sys/src/9/pc/dat.h
sys/src/9/pc64/dat.h
sys/src/9/port/portdat.h
sys/src/9/ppc/dat.h
sys/src/9/sgi/dat.h
sys/src/9/teg2/dat.h
sys/src/9/zynq/dat.h

index 0c4f7351f234daae7a727d8ac05be9dbab9adbb4..75db62a52847d95dba0323197ea3d3355cce8aee 100644 (file)
@@ -150,42 +150,17 @@ struct Mach
 {
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
-
-       Proc*   proc;                   /* current process */
+       Proc*   proc;                   /* current process on this processor */
 
        MMMU;
-       int     flushmmu;               /* flush current proc mmu state */
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
+       /* end of offsets known to asm */
 
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
+       PMach;
 
        int     cputype;
        ulong   delayloop;
-
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       uvlong  fastclock;              /* last sampled value */
-       uvlong  inidle;                 /* time spent in idlehands() */
-       ulong   spuriousintr;
-       int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-
-
        int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
 
        /* vfp2 or vfp3 fpu */
        int     havefp;
@@ -206,7 +181,7 @@ struct Mach
        u32int  smon[5];                /* probably not needed */
        u32int  ssys[5];
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 /*
index c5e19ab0ddbf3a92fc6261368117e1a272e37159..fc27e351f24824cdaf46f7e878042a5015fd22ca 100644 (file)
@@ -142,41 +142,17 @@ struct Mach
 {
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
-
-       Proc*   proc;                   /* current process */
+       Proc*   proc;                   /* current process on this processor */
+       /* end of offsets known to asm */
 
        MMMU;
-       int     flushmmu;               /* flush current proc mmu state */
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
 
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
+       PMach;
 
        int     cputype;
        ulong   delayloop;
-
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       uvlong  fastclock;              /* last sampled value */
-       uvlong  inidle;                 /* time spent in idlehands() */
-       ulong   spuriousintr;
-       int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-
        int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
 
        int     stack[1];
 };
index 81639681da250ffb349f0fe23c7196b78eecf136..1e08c3dab89b5363949348a022b368d0dccba3f0 100644 (file)
@@ -116,47 +116,23 @@ struct MMMU
 
 struct Mach
 {
-       /* known to assembly */
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
        Proc*   proc;                   /* current process */
        ulong   excregs[3];
        ulong   cycleshi;
-       /* end of known to assembly */
+       /* end of known offsets to assembly */
 
-       int     flushmmu;               /* flush current proc mmu state */
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
-       int     inclockintr;
-
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
+       MMMU;
 
-       ulong   delayloop;
+       PMach;
 
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
        int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-
 
        int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
-       
-       MMMU;
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 #define NISAOPT                8
index 6e149837b509cc09113f15dca2902b4d3307a5d6..bf1dcdaff78490742d95b40f869a436a39455514 100644 (file)
@@ -130,43 +130,19 @@ struct Mach
 {
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
-
        Proc*   proc;                   /* current process */
-
        MMMU;
-       int     flushmmu;               /* flush current proc mmu state */
+       /* end of offsets known to asm */
 
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
-       int     inclockintr;
+       PMach;
 
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
+       vlong   fastclock;              /* last sampled value */
+       int     inclockintr;
 
        int     cputype;
        int     socrev;                 /* system-on-chip revision */
        ulong   delayloop;
-
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       vlong   fastclock;              /* last sampled value */
-       uvlong  inidle;                 /* time spent in idlehands() */
-       ulong   spuriousintr;
-       int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-
-//     int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
 
        /* save areas for exceptions */
        u32int  sfiq[5];
@@ -178,7 +154,7 @@ struct Mach
 #define abtstack sabt
 #define undstack sund
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 /*
index 8b74eb439cf2e082a818bb230ccaf08bb8237354..80ea2565cd01abacca06365c52f51d5d797f1b30 100644 (file)
@@ -123,54 +123,28 @@ struct Mach
 {
        /* OFFSETS OF THE FOLLOWING KNOWN BY l.s */
        int     machno;                 /* physical id of processor */
-       ulong   splpc;                  /* pc that called splhi() */
+       uintptr splpc;                  /* pc that called splhi() */
        Proc    *proc;                  /* current process on this processor */
 
        /* ordering from here on irrelevant */
+       PMach;
+
+       uintptr ptabbase;               /* start of page table in kernel virtual space */
+       int     slotgen;                /* next pte (byte offset) when pteg is full */
+       int     mmupid;                 /* next mmu pid to use */
+       int     sweepcolor;
+       int     trigcolor;
+       Rendez  sweepr;
 
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void    *alarm;                 /* alarms bound to this clock */
-       int     inclockintr;
        int     cputype;
        ulong   loopconst;
-
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;     /* next forced context switch */
-
        vlong   cpuhz;
        ulong   bushz;
        ulong   dechz;
        ulong   tbhz;
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
-
-       ulong   pcclast;
-       uvlong  fastclock;
-       Perf    perf;                   /* performance counters */
-
-       int     tlbfault;               /* only used by devproc; no access to tlb */
-       int     tlbpurge;               /* ... */
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       int     flushmmu;               /* make current proc flush it's mmu state */
-       int     ilockdepth;
-
-       ulong   ptabbase;               /* start of page table in kernel virtual space */
-       int             slotgen;                /* next pte (byte offset) when pteg is full */
-       int             mmupid;         /* next mmu pid to use */
-       int             sweepcolor;
-       int             trigcolor;
-       Rendez  sweepr;
-
-       ulong   spuriousintr;
-       int     lastintr;
 
        /* MUST BE LAST */
-       int     stack[1];
+       uintptr stack[1];
 };
 
 struct
index 084b3aee91aa3aa5500afdf13bceb35d2338676e..3c3792524d56aeba80f6435ed2a92a54eae238aa 100644 (file)
@@ -154,43 +154,19 @@ struct Mach
 {
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
-
        Proc*   proc;                   /* current process */
-
        MMMU;
-       int     flushmmu;               /* flush current proc mmu state */
+       /* end of offsets known to asm */
 
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
-       int     inclockintr;
+       PMach;
 
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
+       uvlong  fastclock;              /* last sampled value */
+       int     inclockintr;
 
        int     cputype;
        ulong   delayloop;
-
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       uvlong  fastclock;              /* last sampled value */
-       uvlong  inidle;                 /* time spent in idlehands() */
-       ulong   spuriousintr;
-       int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-
-
        int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
 
        /* save areas for exceptions, hold R0-R4 */
        u32int  sfiq[5];
@@ -200,7 +176,7 @@ struct Mach
        u32int  smon[5];                /* probably not needed */
        u32int  ssys[5];
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 /*
index 1a63367acea0ff1626664d5e4534ce4f70e1e18f..8eb2f280fe29255014a883dcb816ae02e53e3099 100644 (file)
@@ -190,50 +190,25 @@ typedef struct {
        ulong   iomap;                  /* I/O map base address + T-bit */
 } Tss;
 
+
 struct Mach
 {
-       int     machno;                 /* physical id of processor (KNOWN TO ASSEMBLY) */
-       ulong   splpc;                  /* pc of last caller to splhi */
-
-       ulong*  pdb;                    /* page directory base for this processor (va) */
-       Tss*    tss;                    /* tss for this processor */
-       Segdesc *gdt;                   /* gdt for this processor */
-
+       int     machno;                 /* physical id of processor */
+       uintptr splpc;                  /* pc of last caller to splhi */
        Proc*   proc;                   /* current process on this processor */
        Proc*   externup;               /* extern register Proc *up */
 
-       Page*   pdbpool;
-       int     pdbcnt;
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
-       int     inclockintr;
-
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
-
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       int     flushmmu;               /* make current proc flush it's mmu state */
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
+       PMach;
 
+       uvlong  tscticks;
        ulong   spuriousintr;
        int     lastintr;
 
        int     loopconst;
        int     aalcycles;
-
        int     cpumhz;
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
        uvlong  cpuhz;
+
        int     cpuidax;
        int     cpuidcx;
        int     cpuiddx;
@@ -242,19 +217,26 @@ struct Mach
        uchar   cpuidfamily;
        uchar   cpuidmodel;
        uchar   cpuidstepping;
-       int     havetsc;
-       int     havepge;
-       int     havewatchpt8;
-       int     havenx;
-       uvlong  tscticks;
-       int     pdballoc;
-       int     pdbfree;
+
+       char    havetsc;
+       char    havepge;
+       char    havewatchpt8;
+       char    havenx;
+
+       ulong*  pdb;                    /* page directory base for this processor (va) */
+       Tss*    tss;                    /* tss for this processor */
+       Segdesc*gdt;                    /* gdt for this processor */
        
        u32int  dr7;                    /* shadow copy of dr7 */
        u32int  xcr0;
        void*   vmx;
 
-       int     stack[1];
+       Page*   pdbpool;
+       int     pdbcnt;
+       int     pdballoc;
+       int     pdbfree;
+
+       uintptr stack[1];
 };
 
 /*
index 1d581f371bf88122b1452e24e632c27adf450bf9..b8628db9d052a38c5e99301a4f4f9155d1cc4177 100644 (file)
@@ -184,48 +184,21 @@ typedef struct {
 
 struct Mach
 {
-       int     machno;                 /* physical id of processor (KNOWN TO ASSEMBLY) */
-       uintptr splpc;                  /* pc of last caller to splhi (KNOWN TO ASSEMBLY) */
+       int     machno;                 /* physical id of processor */
+       uintptr splpc;                  /* pc of last caller to splhi */
+       Proc*   proc;                   /* current process on this processor */
 
-       Proc*   proc;                   /* current process on this processor (KNOWN TO ASSEMBLY) */
-
-       u64int* pml4;                   /* pml4 base for this processor (va) */
-       Tss*    tss;                    /* tss for this processor */
-       Segdesc *gdt;                   /* gdt for this processor */
-
-       u64int  mmumap[4];              /* bitmap of pml4 entries for zapping */
-       MMU*    mmufree;                /* freelist for MMU structures */
-       ulong   mmucount;               /* number of MMU structures in freelist */
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
-       int     inclockintr;
-
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
-
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       int     flushmmu;               /* make current proc flush it's mmu state */
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
+       PMach;
 
+       uvlong  tscticks;
        ulong   spuriousintr;
        int     lastintr;
 
        int     loopconst;
        int     aalcycles;
-
        int     cpumhz;
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
        uvlong  cpuhz;
+
        int     cpuidax;
        int     cpuidcx;
        int     cpuiddx;
@@ -234,17 +207,24 @@ struct Mach
        uchar   cpuidfamily;
        uchar   cpuidmodel;
        uchar   cpuidstepping;
-       int     havetsc;
-       int     havepge;
-       int     havewatchpt8;
-       int     havenx;
-       uvlong  tscticks;
+
+       char    havetsc;
+       char    havepge;
+       char    havewatchpt8;
+       char    havenx;
+
+       u64int* pml4;                   /* pml4 base for this processor (va) */
+       Tss*    tss;                    /* tss for this processor */
+       Segdesc*gdt;                    /* gdt for this processor */
 
        u64int  dr7;                    /* shadow copy of dr7 */
        u64int  xcr0;
-
        void*   vmx;
 
+       MMU*    mmufree;                /* freelist for MMU structures */
+       ulong   mmucount;               /* number of MMU structures in freelist */
+       u64int  mmumap[4];              /* bitmap of pml4 entries for zapping */
+
        uintptr stack[1];
 };
 
index b3b86eaa700c66c3978ef215248274793941dd88..dc3c5bd66e5ddbc6609da6f4eda5f937e85cde9a 100644 (file)
@@ -31,6 +31,7 @@ typedef struct Pgrp   Pgrp;
 typedef struct Physseg Physseg;
 typedef struct Proc    Proc;
 typedef struct Pte     Pte;
+typedef struct PMach   PMach;
 typedef struct QLock   QLock;
 typedef struct Queue   Queue;
 typedef struct Ref     Ref;
@@ -967,6 +968,29 @@ struct Watchpt
        uintptr addr, len;
 };
 
+struct PMach
+{
+       Proc*   readied;                /* for runproc */
+       Label   sched;                  /* scheduler wakeup */
+       ulong   ticks;                  /* of the clock since boot time */
+       ulong   schedticks;             /* next forced context switch */
+
+       int     pfault;
+       int     cs;
+       int     syscall;
+       int     load;
+       int     intr;
+       int     ilockdepth;
+
+       int     flushmmu;               /* make current proc flush it's mmu state */
+
+       int     tlbfault;
+       int     tlbpurge;
+
+       Perf    perf;                   /* performance counters */
+
+       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
+};
 
 /* queue state bits,  Qmsg, Qcoalesce, and Qkick can be set in qopen */
 enum
index 954ca1f89614819aa6a9cdfe1672f2b59130b101..925d35af7057430e0268004c99c75f3449b32e96 100644 (file)
@@ -137,55 +137,31 @@ struct Mach
 /*0x14*/       ulong   dmiss;  /* number of data misses */
 
        /* ordering from here on irrelevant */
+       PMach;
 
        Imap*   imap;
 
-       ulong   ticks;          /* of the clock since boot time */
-       Label   sched;          /* scheduler wakeup */
-       Lock    alarmlock;      /* access to alarm list */
-       void    *alarm;         /* alarms bound to this clock */
-       int     inclockintr;
+       uintptr ptabbase;       /* start of page table in kernel virtual space */
+       int     slotgen;        /* next pte (byte offset) when pteg is full */
+       int     mmupid;         /* next mmu pid to use */
+       int     sweepcolor;
+       int     trigcolor;
+       Rendez  sweepr;
+
        int     cputype;
        ulong   loopconst;
-       Perf    perf;           /* performance counters */
-
-       Proc*   readied;        /* for runproc */
-       ulong   schedticks;     /* next forced context switch */
 
        ulong   clkin;          /* basic clock frequency */
        ulong   vco_out;
        vlong   cpuhz;
-       uvlong  cyclefreq;      /* Frequency of user readable cycle counter */
        ulong   bushz;
        ulong   dechz;
        ulong   tbhz;
        ulong   cpmhz;          /* communications processor module frequency */
        ulong   brghz;          /* baud rate generator frequency */
 
-       ulong   pcclast;
-       uvlong  fastclock;
-
-       int     tlbpurge;       /* # of tlb purges */
-       int     pfault;         /* # of page faults */
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
-       int     flushmmu;       /* make current proc flush it's mmu state */
-       int     ilockdepth;
-
-       ulong   ptabbase;       /* start of page table in kernel virtual space */
-       int     slotgen;        /* next pte (byte offset) when pteg is full */
-       int     mmupid;         /* next mmu pid to use */
-       int     sweepcolor;
-       int     trigcolor;
-       Rendez  sweepr;
-
-       ulong   spuriousintr;
-       int     lastintr;
-
        /* MUST BE LAST */
-       int     stack[1];
+       uintptr stack[1];
 };
 
 struct
index 126eb3793db989239152381636a120cf59cc7eef..cd84b7a8e299833fa260ef546202ea5acaf97104 100644 (file)
@@ -144,48 +144,34 @@ struct Mach
        int     machno;                 /* physical id of processor */
        Softtlb*stb;
        Proc*   proc;                   /* process on this processor */
-       ulong   splpc;                  /* pc that called splhi() */
+       uintptr splpc;                  /* pc that called splhi() */
        ulong   tlbfault;
 
        /* the following is safe to move */
-       ulong   tlbpurge;
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       void*   alarm;                  /* alarms bound to this clock */
+       PMach;
+
        int     lastpid;                /* last pid allocated on this machine */
        Proc*   pidproc[NTLBPID];       /* proc that owns tlbpid on this mach */
+
        KMap*   kactive;                /* active on this machine */
        int     knext;
        uchar   ktlbx[NTLB];            /* tlb index used for kmap */
        uchar   ktlbnext;
-       int     speed;                  /* cpu speed */
-       ulong   delayloop;              /* for the delay() routine */
-       ulong   fairness;               /* for runproc */
-       int     flushmmu;
-       int     inclockintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
 
        /* for per-processor timers */
-       ulong   lastcount;
        uvlong  fastticks;
+       ulong   lastcount;
+
        ulong   hz;
+       int     speed;                  /* cpu speed */
+       ulong   delayloop;              /* for the delay() routine */
        ulong   maxperiod;
        ulong   minperiod;
 
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
-
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
        int     hashcoll;               /* soft-tlb hash collisions */
        int     paststartup;            /* for putktlb */
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 struct KMap
index 30dd4b5ebb37bc77926e71944ffc0240f3b2c2a1..0f0ead822048427176f606993bc2bc74c40c3f79 100644 (file)
@@ -163,51 +163,27 @@ struct PMMU
 
 struct Mach
 {
-       /* offsets known to asm */
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
-
-       Proc*   proc;                   /* current process */
+       Proc*   proc;                   /* current process on this processor */
 
        MMMU;
        /* end of offsets known to asm */
-       int     flushmmu;               /* flush current proc mmu state */
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
-       int     inclockintr;
 
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
-
-       int     cputype;
-       ulong   delayloop;
+       PMach;
 
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
        uvlong  fastclock;              /* last sampled value */
-       uvlong  inidle;                 /* time spent in idlehands() */
-       ulong   spuriousintr;
-       int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
+       int     inclockintr;
+       int     inidlehands;
 
        int     probing;                /* probeaddr() state */
        int     trapped;
        Lock    probelock;
-       int     inidlehands;
 
+       int     cputype;
+       ulong   delayloop;
        int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
 
        /* vfp3 fpu */
        int     havefp;
@@ -228,7 +204,7 @@ struct Mach
        u32int  smon[5];                /* probably not needed */
        u32int  ssys[5];
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 /*
index 5c419cb7aee1ba266e9d444fd1abce1d7f575c0a..c3a6321775d9fd14a7fb98f2b8d5430ec9e7fb1f 100644 (file)
@@ -115,7 +115,6 @@ struct MMMU
 
 struct Mach
 {
-       /* known to assembly */
        int     machno;                 /* physical id of processor */
        uintptr splpc;                  /* pc of last caller to splhi */
        Proc*   proc;                   /* current process */
@@ -123,39 +122,16 @@ struct Mach
        ulong   cycleshi;
        /* end of known to assembly */
 
-       int     flushmmu;               /* flush current proc mmu state */
-
-       ulong   ticks;                  /* of the clock since boot time */
-       Label   sched;                  /* scheduler wakeup */
-       Lock    alarmlock;              /* access to alarm list */
-       void*   alarm;                  /* alarms bound to this clock */
-       int     inclockintr;
-
-       Proc*   readied;                /* for runproc */
-       ulong   schedticks;             /* next forced context switch */
+       MMMU;
 
-       ulong   delayloop;
+       PMach;
 
-       /* stats */
-       int     tlbfault;
-       int     tlbpurge;
-       int     pfault;
-       int     cs;
-       int     syscall;
-       int     load;
-       int     intr;
        int     lastintr;
-       int     ilockdepth;
-       Perf    perf;                   /* performance counters */
-
 
        int     cpumhz;
        uvlong  cpuhz;                  /* speed of cpu */
-       uvlong  cyclefreq;              /* Frequency of user readable cycle counter */
-       
-       MMMU;
 
-       int     stack[1];
+       uintptr stack[1];
 };
 
 #define NISAOPT                8