diff options
Diffstat (limited to 'sys/arch/mvme88k/include')
-rw-r--r-- | sys/arch/mvme88k/include/mmu.h | 55 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/pmap.h | 9 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/vmparam.h | 107 |
3 files changed, 17 insertions, 154 deletions
diff --git a/sys/arch/mvme88k/include/mmu.h b/sys/arch/mvme88k/include/mmu.h index 67eca239b82..3e68f895b3b 100644 --- a/sys/arch/mvme88k/include/mmu.h +++ b/sys/arch/mvme88k/include/mmu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mmu.h,v 1.7 2001/03/09 05:44:40 smurph Exp $ */ +/* $OpenBSD: mmu.h,v 1.8 2001/06/14 21:30:40 miod Exp $ */ /* * Ashura Project */ @@ -12,36 +12,12 @@ #ifndef __MACHINE_MMU_H__ #define __MACHINE_MMU_H__ -/* for m88k_pgbytes, m8kk_pgshift */ -#include <machine/vmparam.h> - - /* * Parameters which determine the 'geometry' of the M88K page tables in memory. */ #define SDT_BITS 10 /* M88K segment table size bits */ #define PDT_BITS 10 /* M88K page table size bits */ -#define PG_BITS M88K_PGSHIFT /* M88K hardware page size bits */ - -/* - * Shifts and masks for M88K (hardware) page - */ -/* M88K_PGBYTES, PG_SHIFT in vm_param.h */ -#define M88K_PGOFSET (M88K_PGBYTES-1) /* offset into M88K page */ -#define M88K_PGMASK (~M88K_PGOFSET) /* page mask */ - -/* - * Convert byte address to page frame number - */ -#define M88K_BTOP(x) (((unsigned) (x)) >> M88K_PGSHIFT) -#define M88K_PTOB(x) (((unsigned) (x)) << M88K_PGSHIFT) - -/* - * Round off or truncate to the nearest page. These will work for - * either addresses of counts. (i.e. 1 byte round to 1 page bytes). - */ -#define M88K_TRUNC_PAGE(x) (((unsigned) (x) & M88K_PGMASK)) -#define M88K_ROUND_PAGE(x) M88K_TRUNC_PAGE((x) + M88K_PGOFSET) +#define PG_BITS PAGE_SHIFT /* M88K hardware page size bits */ /* * M88K area descriptors @@ -216,7 +192,7 @@ typedef union batc_template { /* * Va spaces mapped by tables and PDT table group. */ -#define PDT_VA_SPACE (PDT_ENTRIES * M88K_PGBYTES) +#define PDT_VA_SPACE (PDT_ENTRIES * PAGE_SIZE) #define PDT_TABLE_GROUP_VA_SPACE (PDT_VA_SPACE * PDT_TABLE_GROUP_SIZE) /* @@ -234,33 +210,12 @@ typedef union batc_template { /* * Alignment checks for pages (must lie on page boundaries). */ -#define PAGE_ALIGNED(ad) (((vm_offset_t)(ad) & ~M88K_PGMASK) == 0) +#define PAGE_ALIGNED(ad) (((vm_offset_t)(ad) & PAGE_MASK) == 0) #define CHECK_PAGE_ALIGN(ad,who) \ if (!PAGE_ALIGNED(ad)) \ printf("%s: addr %x not page aligned.\n", who, ad) /* - * Validate PTE's for all hardware pages in a VM page. - * "ptes_per_vm_page" should be set in pmap_bootstrap. - * - * PARAMETERS: - * pt_entry_t *start; - * unsigned long template; - */ -#define DO_PTES(start, template) \ -{ \ - int i_; \ - pt_entry_t *p_ = start; \ - \ - for (i_ = ptes_per_vm_page; i_>0; i_--) { \ - *(int *)p_++ = (unsigned long)(template); \ - template += M88K_PGBYTES; \ - /* (unsigned long)(template) for m88k C compiler\ - '90.7.24 Fuzzy */ \ - } \ -} - -/* * Flags for cmmu_store() <cmmu.s> */ #define STORE_CMD 0 @@ -307,7 +262,7 @@ extern vm_offset_t kmapva; sdt = (sdt_entry_t *)kmapva + SDTIDX(va) + SDT_ENTRIES; \ (pte_template_t *)(sdt->table_addr << PDT_SHIFT) + PDTIDX(va); \ }) -u_int kvtop( ); +extern u_int kvtop __P((vm_offset_t)); #define DMA_CACHE_SYNC 0x1 #define DMA_CACHE_SYNC_INVAL 0x2 diff --git a/sys/arch/mvme88k/include/pmap.h b/sys/arch/mvme88k/include/pmap.h index 5d7676c26f0..35b6ca62894 100644 --- a/sys/arch/mvme88k/include/pmap.h +++ b/sys/arch/mvme88k/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.11 2001/01/13 05:18:59 smurph Exp $ */ +/* $OpenBSD: pmap.h,v 1.12 2001/06/14 21:30:40 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1991 Carnegie Mellon University @@ -74,9 +74,7 @@ extern struct pmap kernel_pmap_store; #define pmap_kernel() (&kernel_pmap_store) #define pmap_resident_count(pmap) ((pmap)->stats.resident_count) /* Used in builtin/device_pager.c */ -#define pmap_phys_address(frame) ((vm_offset_t) (M88K_PTOB(frame))) -/* Used in kern/mach_timedev.c */ -#define pmap_phys_to_frame(phys) ((int) (M88K_BTOP(phys))) +#define pmap_phys_address(frame) ((vm_offset_t) (ptoa(frame))) #define PMAP_ACTIVATE(proc) pmap_activate(proc) #define PMAP_DEACTIVATE(proc) pmap_deactivate(proc) @@ -97,7 +95,6 @@ extern struct pmap kernel_pmap_store; void pmap_activate(struct proc *p); void pmap_deactivate(struct proc *p); -int pmap_check_transaction(pmap_t pmap, vm_offset_t va, vm_prot_t type); vm_offset_t pmap_map( vm_offset_t virt, @@ -127,8 +124,6 @@ vm_offset_t pmap_extract_unlocked(pmap_t pmap, vm_offset_t va); void copy_to_phys(vm_offset_t srcva, vm_offset_t dstpa, int bytecount); void copy_from_phys(vm_offset_t srcpa, vm_offset_t dstva, int bytecount); void pmap_redzone(pmap_t pmap, vm_offset_t va); -boolean_t pmap_verify_free(vm_offset_t phys); -boolean_t pmap_valid_page(vm_offset_t p); void icache_flush(vm_offset_t pa); void pmap_dcache_flush(pmap_t pmap, vm_offset_t va); void pmap_cache_flush(pmap_t pmap, vm_offset_t virt, int bytes, int mode); diff --git a/sys/arch/mvme88k/include/vmparam.h b/sys/arch/mvme88k/include/vmparam.h index 9c1cb050964..0d85c23b848 100644 --- a/sys/arch/mvme88k/include/vmparam.h +++ b/sys/arch/mvme88k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.11 2001/05/06 00:45:53 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.12 2001/06/14 21:30:40 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -26,15 +26,7 @@ */ /* - * HISTORY - */ -/* - * File: vm_param.h - * * machine dependent virtual memory parameters. - * Most of the declarations are preceeded by M88K_ (or m88k_) - * which is OK because only M88K specific code will be using - * them. */ @@ -129,55 +121,24 @@ /* * Mach derived constants */ -#define BYTE_SIZE 8 /* byte size in bits */ - -#define M88K_PGBYTES (1<<12) /* bytes per m88k page */ -#define M88K_PGSHIFT 12 /* number of bits to shift for pages */ - -/* - * Convert bytes to pages and convert pages to bytes. - * No rounding is used. - */ - -#define m88k_btop(x) (((unsigned)(x)) >> M88K_PGSHIFT) -#define m88k_ptob(x) (((unsigned)(x)) << M88K_PGSHIFT) - -/* - * Round off or truncate to the nearest page. These will work - * for either addresses or counts. (i.e. 1 byte rounds to 1 page - * bytes. - */ - -#define m88k_round_page(x) ((((unsigned)(x)) + M88K_PGBYTES - 1) & \ - ~(M88K_PGBYTES-1)) -#define m88k_trunc_page(x) (((unsigned)(x)) & ~(M88K_PGBYTES-1)) - -#define VM_MIN_ADDRESS ((vm_offset_t) 0) -#define VM_MAX_ADDRESS ((vm_offset_t) 0xffc00000U) +#define VM_MIN_ADDRESS ((vm_offset_t) 0) +#define VM_MAX_ADDRESS ((vm_offset_t) 0xffc00000U) #define VM_MIN_USER_ADDRESS ((vm_offset_t) 0) -#define VM_MAX_USER_ADDRESS ((vm_offset_t) 0xffc00000U) +#define VM_MAX_USER_ADDRESS ((vm_offset_t) 0xffc00000U) /* on vme188, max = 0xf0000000 */ #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t) 0) #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t) 0x1fffffff) -#define KERNEL_STACK_SIZE (3*4096) /* kernel stack size */ -#define INTSTACK_SIZE (3*4096) /* interrupt stack size */ +#define KERNEL_STACK_SIZE (3 * PAGE_SIZE) /* kernel stack size */ +#define INTSTACK_SIZE (3 * PAGE_SIZE) /* interrupt stack size */ /* virtual sizes (bytes) for various kernel submaps */ -#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) -#define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE) -#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) - -/* - * Conversion between MACHINE pages and VM pages - */ - -#define trunc_m88k_to_vm(p) (atop(trunc_page(m88k_ptob(p)))) -#define round_m88k_to_vm(p) (atop(round_page(m88k_ptob(p)))) -#define vm_to_m88k(p) (m88k_btop(ptoa(p))) +#define VM_MBUF_SIZE (NMBCLUSTERS * MCLBYTES) +#define VM_KMEM_SIZE (NKMEMCLUSTERS * PAGE_SIZE) +#define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) /* Use new VM page bootstrap interface. */ #define MACHINE_NEW_NONCONTIG @@ -185,7 +146,7 @@ #if defined(MACHINE_NEW_NONCONTIG) /* * Constants which control the way the VM system deals with memory segments. - * The hp300 only has one physical memory segment. + * The mvme88k only has one physical memory segment. */ #define VM_PHYSSEG_MAX 1 #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH @@ -207,52 +168,4 @@ struct pmap_physseg { #endif /* MACHINE_NEW_NONCONTIG */ - -#if 1 /*Do we really need all this stuff*/ -#if 1 /*Do we really need all this stuff*/ -#if 1 /*Do we really need all this stuff*/ -#define M88K_SGPAGES (1<<10) /* pages per m88k segment */ -#define M88K_SGPGSHIFT 10 /* number of bits to shift for segment-page */ -#define M88K_ALSEGMS (1<<10) /* segments per m88k all space */ -#define M88K_ALSGSHIFT 10 /* number of bits to shift for all-segment */ - -#define M88K_SGBYTES (1<<22) /* bytes per m88k segments */ -#define M88K_SGSHIFT 22 /* number of bits to shift for segment */ -#define M88K_ALPAGES (1<<20) /* pages per m88k all space */ -#define M88K_ALPGSHIFT 20 /* number of bits to shift for all-page */ - -/* - * Convert bytes to pages and convert pages to bytes. - * No rounding is used. - */ - -#define m88k_btopr(x) (((unsigned)(x) + (M88K_PGBYTES - 1)) >> M88K_PGSHIFT) -#define m88k_btosr(x) (((unsigned)(x) + (M88K_SGBYTES - 1)) >> M88K_SGSHIFT) -#define m88k_btos(x) (((unsigned)(x)) >> M88K_SGSHIFT) -#define m88k_stob(x) (((unsigned)(x)) << M88K_SGSHIFT) -#define m88k_ptosr(x) (((unsigned)(x) + (M88K_SGPAGES - 1)) >> M88K_SGPGSHIFT) -#define m88k_ptos(x) (((unsigned)(x)) >> M88K_SGPGSHIFT) -#define m88k_stop(x) (((unsigned)(x)) << M88K_SGPGSHIFT) - -/* - * Round off or truncate to the nearest page. These will work - * for either addresses or counts. (i.e. 1 byte rounds to 1 page - * bytes. - */ - -#define m88k_round_segm(x) ((((unsigned)(x)) + M88K_SGBYTES - 1) & \ - ~(M88K_SGBYTES-1)) -#define m88k_next_segm(x) ((((unsigned)(x)) & ~(M88K_SGBYTES-1)) + \ - M88K_SGBYTES) -#define m88k_trunc_segm(x) (((unsigned)(x)) & ~(M88K_SGBYTES-1)) - -#define m88k_round_seg(x) ((((unsigned)(x)) + M88K_SGBYTES - 1) & \ - ~(M88K_SGBYTES-1)) -#define m88k_trunc_seg(x) (((unsigned)(x)) & ~(M88K_SGBYTES-1)) - -#define VEQR_ADDR 0x20000000 /* kernel virtual eq phy mapping */ -#endif /* Do we really need all this stuff */ -#endif /* Do we really need all this stuf */ -#endif /* Do we really need all this stuff */ - #endif _MACHINE_VM_PARAM_ |