diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-05-11 23:24:58 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-05-11 23:24:58 +0000 |
commit | 3ef0cc3811fba6ea1295b6b2a77b31f94b879b3c (patch) | |
tree | 66b7c6d4bb190d1d06814f19b12daea053b6b409 /sys | |
parent | 24d9e2da4965b90f15a56939be8998591025fec1 (diff) |
Kill remaining vm_offset_t and vm_size_t; NetBSD used as a guide
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hp300/dev/dma.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/db_memrw.c | 20 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/kgdb_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/leds.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/pmap_bootstrap.c | 43 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/sys_machdep.c | 15 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/trap.c | 28 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/vm_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/include/cpu.h | 20 | ||||
-rw-r--r-- | sys/arch/hp300/include/pmap.h | 4 |
10 files changed, 74 insertions, 72 deletions
diff --git a/sys/arch/hp300/dev/dma.c b/sys/arch/hp300/dev/dma.c index 70ae2e7956a..8794010c755 100644 --- a/sys/arch/hp300/dev/dma.c +++ b/sys/arch/hp300/dev/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.9 2001/05/01 16:51:08 millert Exp $ */ +/* $OpenBSD: dma.c,v 1.10 2001/05/11 23:24:56 millert Exp $ */ /* $NetBSD: dma.c,v 1.19 1997/05/05 21:02:39 thorpej Exp $ */ /* @@ -371,7 +371,7 @@ dmago(unit, addr, count, flags) * Push back dirty cache lines */ if (mmutype == MMU_68040) - DCFP((vm_offset_t)dc->dm_chain[seg].dc_addr); + DCFP((paddr_t)dc->dm_chain[seg].dc_addr); #endif if (count < (tcount = NBPG - ((int)addr & PGOFSET))) tcount = count; diff --git a/sys/arch/hp300/hp300/db_memrw.c b/sys/arch/hp300/hp300/db_memrw.c index 047c47cedc2..47633d3b154 100644 --- a/sys/arch/hp300/hp300/db_memrw.c +++ b/sys/arch/hp300/hp300/db_memrw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_memrw.c,v 1.3 1997/07/06 08:01:58 downsj Exp $ */ +/* $OpenBSD: db_memrw.c,v 1.4 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: db_memrw.c,v 1.5 1997/06/10 18:48:47 veego Exp $ */ /*- @@ -69,7 +69,7 @@ #include <ddb/db_access.h> -static void db_write_text __P((vm_offset_t, size_t, char *)); +static void db_write_text __P((db_addr_t, size_t, char *)); /* * Read bytes from kernel address space for debugger. @@ -78,9 +78,9 @@ static void db_write_text __P((vm_offset_t, size_t, char *)); */ void db_read_bytes(addr, size, data) - vm_offset_t addr; - size_t size; - char *data; + db_addr_t addr; + size_t size; + char *data; { char *src = (char*)addr; @@ -107,13 +107,13 @@ db_read_bytes(addr, size, data) */ static void db_write_text(addr, size, data) - vm_offset_t addr; + db_addr_t addr; size_t size; char *data; { char *dst, *odst; pt_entry_t *pte, oldpte, tmppte; - vm_offset_t pgva; + vaddr_t pgva; int limit; if (size == 0) @@ -168,7 +168,7 @@ db_write_text(addr, size, data) tmppte = (oldpte & ~PG_RO) | PG_RW | PG_CI; *pte = tmppte; - TBIS((vm_offset_t)odst); + TBIS((vaddr_t)odst); /* * Page is now writable. Do as much access as we @@ -181,7 +181,7 @@ db_write_text(addr, size, data) * Restore the old PTE. */ *pte = oldpte; - TBIS((vm_offset_t)odst); + TBIS((vaddr_t)odst); } while (size != 0); /* @@ -197,7 +197,7 @@ db_write_text(addr, size, data) extern char kernel_text[], etext[]; void db_write_bytes(addr, size, data) - vm_offset_t addr; + db_addr_t addr; size_t size; char *data; { diff --git a/sys/arch/hp300/hp300/kgdb_machdep.c b/sys/arch/hp300/hp300/kgdb_machdep.c index 1dd59c0af13..fd5ad87b54b 100644 --- a/sys/arch/hp300/hp300/kgdb_machdep.c +++ b/sys/arch/hp300/hp300/kgdb_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kgdb_machdep.c,v 1.1 1997/07/06 08:02:01 downsj Exp $ */ +/* $OpenBSD: kgdb_machdep.c,v 1.2 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: kgdb_machdep.c,v 1.1 1997/05/05 20:51:05 thorpej Exp $ */ /* @@ -63,7 +63,7 @@ */ int kgdb_acc(va, ulen) - vm_offset_t va; + vaddr_t va; size_t ulen; { int len, pgoff; diff --git a/sys/arch/hp300/hp300/leds.c b/sys/arch/hp300/hp300/leds.c index ee354aee1be..561d01788b9 100644 --- a/sys/arch/hp300/hp300/leds.c +++ b/sys/arch/hp300/hp300/leds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: leds.c,v 1.2 1999/09/03 18:00:41 art Exp $ */ +/* $OpenBSD: leds.c,v 1.3 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: leds.c,v 1.1 1997/05/05 20:54:35 thorpej Exp $ */ /* @@ -60,7 +60,7 @@ void ledinit() { - pmap_enter(pmap_kernel(), (vm_offset_t)ledbase, (vm_offset_t)LED_ADDR, + pmap_enter(pmap_kernel(), (vaddr_t)ledbase, (paddr_t)LED_ADDR, VM_PROT_READ|VM_PROT_WRITE, TRUE, VM_PROT_READ|VM_PROT_WRITE); ledaddr = (u_int8_t *) ((long)ledbase | (LED_ADDR & PGOFSET)); } diff --git a/sys/arch/hp300/hp300/pmap_bootstrap.c b/sys/arch/hp300/hp300/pmap_bootstrap.c index 5d06ae30f1b..08e168718c8 100644 --- a/sys/arch/hp300/hp300/pmap_bootstrap.c +++ b/sys/arch/hp300/hp300/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_bootstrap.c,v 1.7 2000/02/22 19:27:46 deraadt Exp $ */ +/* $OpenBSD: pmap_bootstrap.c,v 1.8 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: pmap_bootstrap.c,v 1.13 1997/06/10 18:56:50 veego Exp $ */ /* @@ -62,18 +62,19 @@ extern int Sysptsize; extern char *extiobase, *proc0paddr; extern st_entry_t *Sysseg; extern pt_entry_t *Sysptmap, *Sysmap; -extern vm_offset_t CLKbase, MMUbase; -extern vm_offset_t pagezero; +extern vaddr_t CLKbase, MMUbase; +extern paddr_t pagezero; extern int maxmem, physmem; -extern vm_offset_t avail_start, avail_end, virtual_avail, virtual_end; -extern vm_size_t mem_size; +extern paddr_t avail_start, avail_end; +extern vaddr_t virtual_avail, virtual_end; +extern vsize_t mem_size; extern int protection_codes[]; #ifdef M68K_MMU_HP extern int pmap_aliasmask; #endif -void pmap_bootstrap __P((vm_offset_t, vm_offset_t)); +void pmap_bootstrap __P((paddr_t, paddr_t)); /* * Special purpose kernel virtual addresses, used for mapping @@ -99,10 +100,10 @@ caddr_t CADDR1, CADDR2, vmmap, ledbase; */ void pmap_bootstrap(nextpa, firstpa) - vm_offset_t nextpa; - vm_offset_t firstpa; + paddr_t nextpa; + paddr_t firstpa; { - vm_offset_t kstpa, kptpa, iiopa, eiopa, kptmpa, lkptpa, p0upa; + paddr_t kstpa, kptpa, iiopa, eiopa, kptmpa, lkptpa, p0upa; u_int nptpages, kstsize; st_entry_t protoste, *ste; pt_entry_t protopte, *pte, *epte; @@ -318,7 +319,7 @@ pmap_bootstrap(nextpa, firstpa) * not mapped at VA 0. But, we might want to use it * for something later. */ - RELOC(pagezero, vm_offset_t) = firstpa; + RELOC(pagezero, paddr_t) = firstpa; /* * Validate PTEs for kernel text (RO). The first page @@ -400,10 +401,10 @@ pmap_bootstrap(nextpa, firstpa) * CLKbase, MMUbase: important registers in internal IO space * accessed from assembly language. */ - RELOC(CLKbase, vm_offset_t) = - (vm_offset_t)RELOC(intiobase, char *) + CLKBASE; - RELOC(MMUbase, vm_offset_t) = - (vm_offset_t)RELOC(intiobase, char *) + MMUBASE; + RELOC(CLKbase, vaddr_t) = + (vaddr_t)RELOC(intiobase, char *) + CLKBASE; + RELOC(MMUbase, vaddr_t) = + (vaddr_t)RELOC(intiobase, char *) + MMUBASE; /* * Setup u-area for process 0. @@ -435,13 +436,13 @@ pmap_bootstrap(nextpa, firstpa) * To work around this, we move avail_end back one more * page so the msgbuf can be preserved. */ - RELOC(avail_start, vm_offset_t) = nextpa; - RELOC(avail_end, vm_offset_t) = m68k_ptob(RELOC(maxmem, int)) - + RELOC(avail_start, paddr_t) = nextpa; + RELOC(avail_end, paddr_t) = m68k_ptob(RELOC(maxmem, int)) - (m68k_round_page(MSGBUFSIZE) + m68k_ptob(1)); - RELOC(mem_size, vm_size_t) = m68k_ptob(RELOC(physmem, int)); - RELOC(virtual_avail, vm_offset_t) = + RELOC(mem_size, vsize_t) = m68k_ptob(RELOC(physmem, int)); + RELOC(virtual_avail, vaddr_t) = VM_MIN_KERNEL_ADDRESS + (nextpa - firstpa); - RELOC(virtual_end, vm_offset_t) = VM_MAX_KERNEL_ADDRESS; + RELOC(virtual_end, vaddr_t) = VM_MAX_KERNEL_ADDRESS; #ifdef M68K_MMU_HP /* @@ -513,7 +514,7 @@ pmap_bootstrap(nextpa, firstpa) * Allocate some fixed, special purpose kernel virtual addresses */ { - vm_offset_t va = RELOC(virtual_avail, vm_offset_t); + vaddr_t va = RELOC(virtual_avail, vaddr_t); RELOC(CADDR1, caddr_t) = (caddr_t)va; va += NBPG; @@ -525,6 +526,6 @@ pmap_bootstrap(nextpa, firstpa) va += NBPG; RELOC(msgbufp, struct msgbuf *) = (struct msgbuf *)va; va += MSGBUFSIZE; - RELOC(virtual_avail, vm_offset_t) = va; + RELOC(virtual_avail, vaddr_t) = va; } } diff --git a/sys/arch/hp300/hp300/sys_machdep.c b/sys/arch/hp300/hp300/sys_machdep.c index d212e32791d..6259bbacdf4 100644 --- a/sys/arch/hp300/hp300/sys_machdep.c +++ b/sys/arch/hp300/hp300/sys_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_machdep.c,v 1.7 2000/06/23 02:14:36 mickey Exp $ */ +/* $OpenBSD: sys_machdep.c,v 1.8 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: sys_machdep.c,v 1.17 1997/05/19 10:15:00 veego Exp $ */ /* @@ -78,7 +78,7 @@ int cachectl(req, addr, len) int req; - caddr_t addr; + vaddr_t addr; int len; { int error = 0; @@ -86,8 +86,9 @@ cachectl(req, addr, len) #if defined(M68040) if (mmutype == MMU_68040) { int inc = 0; - int pa = 0, doall = 0; - caddr_t end = 0; + int doall = 0; + paddr_t pa = 0; + vaddr_t end = 0; #ifdef COMPAT_HPUX extern struct emul emul_hpux; @@ -103,10 +104,10 @@ cachectl(req, addr, len) if (!doall) { end = addr + len; if (len <= 1024) { - addr = (caddr_t)((int)addr & ~0xF); + addr = addr & ~0xF; inc = 16; } else { - addr = (caddr_t)((int)addr & ~PGOFSET); + addr = addr & ~PGOFSET; inc = NBPG; } } @@ -119,7 +120,7 @@ cachectl(req, addr, len) if (!doall && (pa == 0 || ((int)addr & PGOFSET) == 0)) { pa = pmap_extract(curproc->p_vmspace->vm_map.pmap, - (vm_offset_t)addr); + addr); if (pa == 0) doall = 1; } diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c index f7f5a9254dd..f7614c30d04 100644 --- a/sys/arch/hp300/hp300/trap.c +++ b/sys/arch/hp300/hp300/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.20 2001/05/05 21:26:35 art Exp $ */ +/* $OpenBSD: trap.c,v 1.21 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */ /* @@ -633,7 +633,7 @@ trap(type, code, v, frame) case T_MMUFLT|T_USER: /* page fault */ { - vm_offset_t va; + vaddr_t va; struct vmspace *vm = p->p_vmspace; vm_map_t map; int rv; @@ -665,7 +665,7 @@ trap(type, code, v, frame) } else vftype = ftype = VM_PROT_READ; - va = trunc_page((vm_offset_t)v); + va = trunc_page((vaddr_t)v); if (map == kernel_map && va == 0) { printf("trap: bad kernel %s access at 0x%x\n", @@ -676,8 +676,8 @@ trap(type, code, v, frame) #ifdef COMPAT_HPUX if (ISHPMMADDR(va)) { - int pmap_mapmulti __P((pmap_t, vm_offset_t)); - vm_offset_t bva; + int pmap_mapmulti __P((pmap_t, vaddr_t)); + vaddr_t bva; rv = pmap_mapmulti(map->pmap, va); if (rv != KERN_SUCCESS) { @@ -739,7 +739,7 @@ trap(type, code, v, frame) if (p->p_addr->u_pcb.pcb_onfault) goto copyfault; #if defined(UVM) - printf("uvm_fault(%p, 0x%lx, 0, 0x%x\n) -> 0x%x\n", + printf("uvm_fault(%p, 0x%lx, 0, 0x%x) -> 0x%x\n", map, va, ftype, rv); #else printf("vm_fault(%p, %lx, %x, 0) -> %x\n", @@ -828,14 +828,14 @@ writeback(fp, docachepush) * cache push after a signal handler has been called. */ if (docachepush) { - pmap_enter(pmap_kernel(), (vm_offset_t)vmmap, - trunc_page((vaddr_t)f->f_fa), VM_PROT_WRITE, TRUE, - VM_PROT_WRITE); + pmap_enter(pmap_kernel(), (vaddr_t)vmmap, + trunc_page((vaddr_t)f->f_fa), VM_PROT_WRITE, + TRUE, VM_PROT_WRITE); fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0xF]; bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16); - DCFL(pmap_extract(pmap_kernel(), (vm_offset_t)fa)); - pmap_remove(pmap_kernel(), (vm_offset_t)vmmap, - (vm_offset_t)&vmmap[NBPG]); + DCFL(pmap_extract(pmap_kernel(), (vaddr_t)fa)); + pmap_remove(pmap_kernel(), (vaddr_t)vmmap, + (vaddr_t)&vmmap[NBPG]); } else printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n", p->p_pid, p->p_comm, p->p_ucred->cr_uid); @@ -1052,13 +1052,13 @@ dumpwb(num, s, a, d) u_int a, d; { struct proc *p = curproc; - vm_offset_t pa; + paddr_t pa; printf(" writeback #%d: VA %x, data %x, SZ=%s, TT=%s, TM=%s\n", num, a, d, f7sz[(s & SSW4_SZMASK) >> 5], f7tt[(s & SSW4_TTMASK) >> 3], f7tm[s & SSW4_TMMASK]); printf(" PA "); - pa = pmap_extract(p->p_vmspace->vm_map.pmap, (vm_offset_t)a); + pa = pmap_extract(p->p_vmspace->vm_map.pmap, (vaddr_t)a); if (pa == 0) printf("<invalid address>"); else diff --git a/sys/arch/hp300/hp300/vm_machdep.c b/sys/arch/hp300/hp300/vm_machdep.c index 6d72e5ceac9..0a47eb4c502 100644 --- a/sys/arch/hp300/hp300/vm_machdep.c +++ b/sys/arch/hp300/hp300/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.20 2001/05/06 21:39:00 millert Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.21 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: vm_machdep.c,v 1.47 1999/03/26 23:41:29 mycroft Exp $ */ /* @@ -323,7 +323,7 @@ vmapbuf(bp, len) vaddr_t uva; /* User VA (map from) */ vaddr_t kva; /* Kernel VA (new to) */ paddr_t pa; /* physical address */ - vm_size_t off; + vsize_t off; if ((bp->b_flags & B_PHYS) == 0) panic("vmapbuf"); diff --git a/sys/arch/hp300/include/cpu.h b/sys/arch/hp300/include/cpu.h index 192ea7d9145..b3193f5bc80 100644 --- a/sys/arch/hp300/include/cpu.h +++ b/sys/arch/hp300/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.10 2001/05/04 22:49:00 aaron Exp $ */ +/* $OpenBSD: cpu.h,v 1.11 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: cpu.h,v 1.28 1998/02/13 07:41:51 scottr Exp $ */ /* @@ -150,17 +150,17 @@ void ICIA __P((void)); void ICPA __P((void)); void PCIA __P((void)); void TBIA __P((void)); -void TBIS __P((vm_offset_t)); +void TBIS __P((vaddr_t)); void TBIAS __P((void)); void TBIAU __P((void)); #if defined(M68040) void DCFA __P((void)); -void DCFP __P((vm_offset_t)); -void DCFL __P((vm_offset_t)); -void DCPL __P((vm_offset_t)); -void DCPP __P((vm_offset_t)); -void ICPL __P((vm_offset_t)); -void ICPP __P((vm_offset_t)); +void DCFP __P((paddr_t)); +void DCFL __P((paddr_t)); +void DCPL __P((paddr_t)); +void DCPP __P((paddr_t)); +void ICPL __P((paddr_t)); +void ICPP __P((paddr_t)); #endif int suline __P((caddr_t, caddr_t)); void savectx __P((struct pcb *)); @@ -183,10 +183,10 @@ void regdump __P((struct frame *, int)); void dumpconf __P((void)); /* pmap.c functions */ -vm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int)); +vaddr_t pmap_map __P((vaddr_t, paddr_t, paddr_t, int)); /* sys_machdep.c functions */ -int cachectl __P((int, caddr_t, int)); +int cachectl __P((int, vaddr_t, int)); /* vm_machdep.c functions */ void physaccess __P((caddr_t, caddr_t, int, int)); diff --git a/sys/arch/hp300/include/pmap.h b/sys/arch/hp300/include/pmap.h index d3583e6ec37..5624603979d 100644 --- a/sys/arch/hp300/include/pmap.h +++ b/sys/arch/hp300/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.6 2001/05/04 22:49:00 aaron Exp $ */ +/* $OpenBSD: pmap.h,v 1.7 2001/05/11 23:24:57 millert Exp $ */ /* $NetBSD: pmap.h,v 1.13 1997/06/10 18:58:19 veego Exp $ */ /* @@ -107,7 +107,7 @@ typedef struct pmap *pmap_t; struct pv_entry { struct pv_entry *pv_next; /* next pv_entry */ struct pmap *pv_pmap; /* pmap where mapping lies */ - vm_offset_t pv_va; /* virtual address for mapping */ + vaddr_t pv_va; /* virtual address for mapping */ st_entry_t *pv_ptste; /* non-zero if VA maps a PT page */ struct pmap *pv_ptpmap; /* if pv_ptste, pmap for PT page */ int pv_flags; /* flags */ |