update from Mike Hibler for new VM and other machine support
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 6 Dec 1990 11:30:31 +0000 (03:30 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 6 Dec 1990 11:30:31 +0000 (03:30 -0800)
SCCS-vsn: sys/hp300/include/cpu.h 7.3
SCCS-vsn: sys/hp300/include/pcb.h 7.2
SCCS-vsn: sys/hp300/hp300/pte.h 7.2
SCCS-vsn: sys/hp300/include/param.h 7.2
SCCS-vsn: sys/hp300/include/types.h 7.5
SCCS-vsn: sys/hp300/include/vmparam.h 7.2

usr/src/sys/hp300/hp300/pte.h
usr/src/sys/hp300/include/cpu.h
usr/src/sys/hp300/include/param.h
usr/src/sys/hp300/include/pcb.h
usr/src/sys/hp300/include/types.h
usr/src/sys/hp300/include/vmparam.h

index ef9d8a1..925f3df 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: pte.h 1.11 89/09/03$
  *
  *
  * from: Utah $Hdr: pte.h 1.11 89/09/03$
  *
- *     @(#)pte.h       7.1 (Berkeley) %G%
+ *     @(#)pte.h       7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -116,18 +116,6 @@ unsigned int       pg_blkno:22,            /* file system block number */
 #define        kvtophys(x) ((kvtopte(x)->pg_pfnum << PGSHIFT) | ((int)(x) & PGOFSET))
 
 #if defined(KERNEL) && !defined(LOCORE)
 #define        kvtophys(x) ((kvtopte(x)->pg_pfnum << PGSHIFT) | ((int)(x) & PGOFSET))
 
 #if defined(KERNEL) && !defined(LOCORE)
-/* utilities defined in locore.s */
-extern struct pte Sysmap[];
-extern struct pte Usrptmap[];
-extern struct pte usrpt[];
-extern struct pte Swapmap[];
-extern struct pte Forkmap[];
-extern struct pte Xswapmap[];
-extern struct pte Xswap2map[];
-extern struct pte Pushmap[];
-extern struct pte Vfmap[];
-extern struct pte mmap[];
-extern struct pte msgbufmap[];
-extern struct pte kmempt[], ekmempt[];
-extern struct ste Sysseg[];
+/* utilities defined in pmap.c */
+extern struct pte *Sysmap;
 #endif /* defined(KERNEL) && !defined(LOCORE) */
 #endif /* defined(KERNEL) && !defined(LOCORE) */
index c4c43c7..5c8bac1 100644 (file)
  *
  * from: Utah $Hdr: cpu.h 1.13 89/06/23$
  *
  *
  * from: Utah $Hdr: cpu.h 1.13 89/06/23$
  *
- *     @(#)cpu.h       7.2 (Berkeley) %G%
+ *     @(#)cpu.h       7.3 (Berkeley) %G%
  */
 
 /* values for machineid */
  */
 
 /* values for machineid */
-#define HP_320         0       /* 16Mhz 68020+HP MMU+16K external cache */
-#define HP_330         1       /* 16Mhz 68020+68851 MMU */
-#define HP_350         2       /* 25Mhz 68020+HP MMU+32K external cache */
-#define HP_360         3       /* 25Mhz 68030 */
-#define HP_370         4       /* 33Mhz 68030+64K external cache */
-#define HP_340         5       /* 16Mhz 68030 */
-#define HP_375         6       /* 50Mhz 68030+32K external cache */
+#define        HP_320          0       /* 16Mhz 68020+HP MMU+16K external cache */
+#define        HP_330          1       /* 16Mhz 68020+68851 MMU */
+#define        HP_350          2       /* 25Mhz 68020+HP MMU+32K external cache */
+#define        HP_360          3       /* 25Mhz 68030 */
+#define        HP_370          4       /* 33Mhz 68030+64K external cache */
+#define        HP_340          5       /* 16Mhz 68030 */
+#define        HP_375          6       /* 50Mhz 68030+32K external cache */
 
 /* values for mmutype (assigned for quick testing) */
 
 /* values for mmutype (assigned for quick testing) */
-#define MMU_68030      -1      /* 68030 on-chip subset of 68851 */
-#define MMU_HP         0       /* HP proprietary */
-#define MMU_68851      1       /* Motorola 68851 */
+#define        MMU_68030       -1      /* 68030 on-chip subset of 68851 */
+#define        MMU_HP          0       /* HP proprietary */
+#define        MMU_68851       1       /* Motorola 68851 */
 
 /* values for ectype */
 
 /* values for ectype */
-#define EC_PHYS                -1      /* external physical address cache */
-#define EC_NONE                0       /* no external cache */
-#define EC_VIRT                1       /* external virtual address cache */
+#define        EC_PHYS         -1      /* external physical address cache */
+#define        EC_NONE         0       /* no external cache */
+#define        EC_VIRT         1       /* external virtual address cache */
 
 /* values for cpuspeed (not really related to clock speed due to caches) */
 
 /* values for cpuspeed (not really related to clock speed due to caches) */
-#define MHZ_8          1
-#define MHZ_16         2
-#define MHZ_25         3
-#define MHZ_33         4
-#define MHZ_50         6
+#define        MHZ_8           1
+#define        MHZ_16          2
+#define        MHZ_25          3
+#define        MHZ_33          4
+#define        MHZ_50          6
 
 #ifdef KERNEL
 extern int machineid, mmutype, ectype;
 
 #ifdef KERNEL
 extern int machineid, mmutype, ectype;
-extern int IObase;
+extern unsigned long DIObase;
 
 /* what is this supposed to do? i.e. how is it different than startrtclock? */
 #define        enablertclock()
 
 /* what is this supposed to do? i.e. how is it different than startrtclock? */
 #define        enablertclock()
@@ -50,76 +50,81 @@ extern      int IObase;
 #endif
 
 /* physical memory sections */
 #endif
 
 /* physical memory sections */
-#define ROMBASE                (0x00000000)
-#define IOBASE         (0x00200000)
-#define IOTOP          (0x01000000)
-#define MAXADDR                (0xFFFFF000)
-
-/* IO space stuff */
-#define EXTIOBASE      (0x00600000)
+#define        ROMBASE         (0x00000000)
+#define        IOBASE          (0x00200000)
+#define        IOTOP           (0x01000000)
+#define        MAXADDR         (0xFFFFF000)
+
+/* DIO space stuff */
+#define        INTERNALHPIB    (0x00478000)
+#define        EXTIOBASE       (0x00600000)
 #define        IOCARDSIZE      (0x10000)
 #define        IOMAPSIZE       (btoc(IOTOP-IOBASE))
 #define        IOP(x)          ((x) - IOBASE)
 #define        IOCARDSIZE      (0x10000)
 #define        IOMAPSIZE       (btoc(IOTOP-IOBASE))
 #define        IOP(x)          ((x) - IOBASE)
-#define        IOV(x)          (((x) - IOBASE) + (int)&IObase)
-#define UNIOV(x)       ((x) - (int)&IObase + IOBASE)
+#define        IOV(x)          (((x) - IOBASE) + DIObase)
+#define        UNIOV(x)        ((x) - DIObase + IOBASE)
 
 /* DIO II uncached address space */
 
 /* DIO II uncached address space */
-#define DIOIIBASE      (0x01000000)
-#define DIOIITOP       (0x20000000)
-#define DIOIICSIZE     (0x00400000)
-
-/* offsets for longword read/write */
-#define        MMUSSTP         IOP(0x5F4000)
-#define        MMUUSTP         IOP(0x5F4004)
-#define        MMUTBINVAL      IOP(0x5F4008)
-#define        MMUSTAT         IOP(0x5F400C)
+#define        DIOIIBASE       (0x01000000)
+#define        DIOIITOP        (0x20000000)
+#define        DIOIICSIZE      (0x00400000)
+
+/* base/offsets for longword read/write (for locore.s) */
+#define        MMUBASE         IOP(0x5F4000)
+#define        MMUSSTP         0x0
+#define        MMUUSTP         0x4
+#define        MMUTBINVAL      0x8
+#define        MMUSTAT         0xC
 #define        MMUCMD          MMUSTAT
 
 #define        MMUCMD          MMUSTAT
 
-#define MMU_UMEN       0x0001  /* enable user mapping */
-#define MMU_SMEN       0x0002  /* enable supervisor mapping */
-#define MMU_CEN                0x0004  /* enable data cache */
-#define MMU_BERR       0x0008  /* bus error */
-#define MMU_IEN                0x0020  /* enable instruction cache */
-#define MMU_FPE                0x0040  /* enable 68881 FP coprocessor */
-#define MMU_WPF                0x2000  /* write protect fault */
-#define MMU_PF         0x4000  /* page fault */
-#define MMU_PTF                0x8000  /* page table fault */
-
-#define MMU_FAULT      (MMU_PTF|MMU_PF|MMU_WPF|MMU_BERR)
-#define MMU_ENAB       (MMU_UMEN|MMU_SMEN|MMU_IEN|MMU_FPE)
-
-#define PMMU_LVLMASK   0x0007
-#define PMMU_INV       0x0400
-#define PMMU_WP                0x0800
-#define PMMU_ALV       0x1000
-#define PMMU_SO                0x2000
-#define PMMU_LV                0x4000
-#define PMMU_BE                0x8000
-
-#define PMMU_FAULT     (PMMU_WP|PMMU_INV)
-
-/* function code for user data space */
-#define        FC_USERD        1
-/* methinks the following is used to selectively clear TLB entries */
-#define FC_PURGE       3
+#define        MMU_UMEN        0x0001  /* enable user mapping */
+#define        MMU_SMEN        0x0002  /* enable supervisor mapping */
+#define        MMU_CEN         0x0004  /* enable data cache */
+#define        MMU_BERR        0x0008  /* bus error */
+#define        MMU_IEN         0x0020  /* enable instruction cache */
+#define        MMU_FPE         0x0040  /* enable 68881 FP coprocessor */
+#define        MMU_WPF         0x2000  /* write protect fault */
+#define        MMU_PF          0x4000  /* page fault */
+#define        MMU_PTF         0x8000  /* page table fault */
+
+#define        MMU_FAULT       (MMU_PTF|MMU_PF|MMU_WPF|MMU_BERR)
+#define        MMU_ENAB        (MMU_UMEN|MMU_SMEN|MMU_IEN|MMU_FPE)
+
+#define        PMMU_LVLMASK    0x0007
+#define        PMMU_INV        0x0400
+#define        PMMU_WP         0x0800
+#define        PMMU_ALV        0x1000
+#define        PMMU_SO         0x2000
+#define        PMMU_LV         0x4000
+#define        PMMU_BE         0x8000
+
+#define        PMMU_FAULT      (PMMU_WP|PMMU_INV)
+
+/* 680X0 function codes */
+#define        FC_USERD        1       /* user data space */
+#define        FC_USERP        2       /* user program space */
+#define        FC_PURGE        3       /* HPMMU: clear TLB entries */
+#define        FC_SUPERD       5       /* supervisor data space */
+#define        FC_SUPERP       6       /* supervisor program space */
+#define        FC_CPU          7       /* CPU space */
 
 /* fields in the 68020 cache control register */
 
 /* fields in the 68020 cache control register */
-#define IC_ENABLE      0x0001  /* enable instruction cache */
-#define IC_FREEZE      0x0002  /* freeze instruction cache */
-#define IC_CE          0x0004  /* clear instruction cache entry */
-#define IC_CLR         0x0008  /* clear entire instruction cache */
+#define        IC_ENABLE       0x0001  /* enable instruction cache */
+#define        IC_FREEZE       0x0002  /* freeze instruction cache */
+#define        IC_CE           0x0004  /* clear instruction cache entry */
+#define        IC_CLR          0x0008  /* clear entire instruction cache */
 
 /* additional fields in the 68030 cache control register */
 
 /* additional fields in the 68030 cache control register */
-#define IC_BE          0x0010  /* instruction burst enable */
-#define DC_ENABLE      0x0100  /* data cache enable */
-#define DC_FREEZE      0x0200  /* data cache freeze */
-#define DC_CE          0x0400  /* clear data cache entry */
-#define DC_CLR         0x0800  /* clear entire data cache */
-#define DC_BE          0x1000  /* data burst enable */
-#define DC_WA          0x2000  /* write allocate */
-
-#define CACHE_ON       (DC_WA|DC_BE|DC_CLR|DC_ENABLE|IC_BE|IC_CLR|IC_ENABLE)
-#define CACHE_OFF      (DC_CLR|IC_CLR)
-#define CACHE_CLR      (CACHE_ON)
-#define IC_CLEAR       (DC_WA|DC_BE|DC_ENABLE|IC_BE|IC_CLR|IC_ENABLE)
-#define DC_CLEAR       (DC_WA|DC_BE|DC_CLR|DC_ENABLE|IC_BE|IC_ENABLE)
+#define        IC_BE           0x0010  /* instruction burst enable */
+#define        DC_ENABLE       0x0100  /* data cache enable */
+#define        DC_FREEZE       0x0200  /* data cache freeze */
+#define        DC_CE           0x0400  /* clear data cache entry */
+#define        DC_CLR          0x0800  /* clear entire data cache */
+#define        DC_BE           0x1000  /* data burst enable */
+#define        DC_WA           0x2000  /* write allocate */
+
+#define        CACHE_ON        (DC_WA|DC_BE|DC_CLR|DC_ENABLE|IC_BE|IC_CLR|IC_ENABLE)
+#define        CACHE_OFF       (DC_CLR|IC_CLR)
+#define        CACHE_CLR       (CACHE_ON)
+#define        IC_CLEAR        (DC_WA|DC_BE|DC_ENABLE|IC_BE|IC_CLR|IC_ENABLE)
+#define        DC_CLEAR        (DC_WA|DC_BE|DC_CLR|DC_ENABLE|IC_BE|IC_ENABLE)
index 78d1159..b09307e 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: machparam.h 1.11 89/08/14$
  *
  *
  * from: Utah $Hdr: machparam.h 1.11 89/08/14$
  *
- *     @(#)param.h     7.1 (Berkeley) %G%
+ *     @(#)param.h     7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
  */
 #define        bdbtofsb(bn)    ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
 
  */
 #define        bdbtofsb(bn)    ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
 
+/*
+ * Mach derived conversion macros
+ */
+#define hp300_round_seg(x)     ((((unsigned)(x)) + NBSEG - 1) & ~(NBSEG-1))
+#define hp300_trunc_seg(x)     ((unsigned)(x) & ~(NBSEG-1))
+#define hp300_round_page(x)    ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
+#define hp300_trunc_page(x)    ((unsigned)(x) & ~(NBPG-1))
+#define hp300_btos(x)          ((unsigned)(x) >> SEGSHIFT)
+#define hp300_stob(x)          ((unsigned)(x) << SEGSHIFT)
+#define hp300_btop(x)          ((unsigned)(x) >> PGSHIFT)
+#define hp300_ptob(x)          ((unsigned)(x) << PGSHIFT)
+
 /*
  * Macros to decode processor status word.
  */
 /*
  * Macros to decode processor status word.
  */
index cced152..075ed78 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: pcb.h 1.13 89/04/23$
  *
  *
  * from: Utah $Hdr: pcb.h 1.13 89/04/23$
  *
- *     @(#)pcb.h       7.1 (Berkeley) %G%
+ *     @(#)pcb.h       7.2 (Berkeley) %G%
  */
 
 #ifdef KERNEL
  */
 
 #ifdef KERNEL
@@ -30,11 +30,7 @@ struct pcb
        int     pcb_ustp;       /* user segment table pointer (+4) */
        int     pcb_usp;        /* user stack pointer (+8) */
        int     pcb_regs[12];   /* D0-D7, A0-A7 (+C) */
        int     pcb_ustp;       /* user segment table pointer (+4) */
        int     pcb_usp;        /* user stack pointer (+8) */
        int     pcb_regs[12];   /* D0-D7, A0-A7 (+C) */
-       struct pte *pcb_p0br;   /* P0 base register (+3C) */
-       int     pcb_p0lr;       /* P0 length register (+40) */
-       struct pte *pcb_p1br;   /* P1 base register (+44) */
-       int     pcb_p1lr;       /* P1 length register (+48) */
-       int     pcb_szpt;       /* number of pages of user page table (+4C) */
+       int     pcb_pad[5];
        int     pcb_cmap2;      /* temporary copy PTE (+50) */
        int     *pcb_sswap;     /* saved context for swap return (+54) */
        short   pcb_sigc[12];   /* signal trampoline code (+58) */
        int     pcb_cmap2;      /* temporary copy PTE (+50) */
        int     *pcb_sswap;     /* saved context for swap return (+54) */
        short   pcb_sigc[12];   /* signal trampoline code (+58) */
index 1431fab..29c591b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)types.h     7.4 (Berkeley) %G%
+ *     @(#)types.h     7.5 (Berkeley) %G%
  */
 
 #ifndef        _MACHTYPES_H_
  */
 
 #ifndef        _MACHTYPES_H_
@@ -35,5 +35,7 @@ typedef struct _physadr {
 typedef struct label_t {               /* consistent with HP-UX */
        int val[15];
 } label_t;
 typedef struct label_t {               /* consistent with HP-UX */
        int val[15];
 } label_t;
+typedef        u_long  vm_offset_t;
+typedef        u_long  vm_size_t;
 #endif
 #endif /* _MACHTYPES_H_ */
 #endif
 #endif /* _MACHTYPES_H_ */
index 3a8852d..4e1704d 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: vmparam.h 1.14 89/08/14$
  *
  *
  * from: Utah $Hdr: vmparam.h 1.14 89/08/14$
  *
- *     @(#)vmparam.h   7.1 (Berkeley) %G%
+ *     @(#)vmparam.h   7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 
 #define        mapin(pte, v, pfnum, prot) \
        (*(u_int *)(pte) = ((pfnum) << PGSHIFT) | (prot), TBIS((caddr_t)(v)))
 
 #define        mapin(pte, v, pfnum, prot) \
        (*(u_int *)(pte) = ((pfnum) << PGSHIFT) | (prot), TBIS((caddr_t)(v)))
+
+/*
+ * Mach derived constants
+ */
+
+/* user/kernel map constants */
+#define VM_MIN_ADDRESS         ((vm_offset_t)0)
+#define VM_MAX_ADDRESS         ((vm_offset_t)0xFFF00000)
+#define VM_MIN_KERNEL_ADDRESS  ((vm_offset_t)0)
+#define VM_MAX_KERNEL_ADDRESS  ((vm_offset_t)0xFFFFF000)
+
+/* virtual sizes (bytes) for various kernel submaps */
+#define VM_MBUF_SIZE           (NMBCLUSTERS*MCLBYTES)
+#define VM_KMEM_SIZE           (NKMEMCLUSTERS*CLBYTES)
+#define VM_PHYS_SIZE           (USRIOSIZE*CLBYTES)
+
+/* # of kernel PT pages (initial only, can grow dynamically) */
+#define VM_KERNEL_PT_PAGES     ((vm_size_t)2)          /* XXX: SYSPTSIZE */
+
+/* pcb base */
+#define        pcbb(p)         ((u_int)(p)->p_addr)