vm_offset_t --> [pv]addr_t.

This commit is contained in:
sakamoto 1998-08-24 01:40:26 +00:00
parent 13091fe5b7
commit 62ed825858
10 changed files with 53 additions and 65 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus_dma.c,v 1.16 1998/08/17 22:30:08 thorpej Exp $ */
/* $NetBSD: bus_dma.c,v 1.17 1998/08/24 01:40:26 sakamoto Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -60,15 +60,6 @@
#include <sys/device.h>
#include <sys/extent.h>
#include <sys/syscallargs.h>
#ifdef SYSVMSG
#include <sys/msg.h>
#endif
#ifdef SYSVSEM
#include <sys/sem.h>
#endif
#ifdef SYSVSHM
#include <sys/shm.h>
#endif
#include <vm/vm.h>
#include <vm/vm_kern.h>
@ -95,7 +86,7 @@
#include <bebox/isa/isa_machdep.h>
int _bus_dmamap_load_buffer __P((bus_dma_tag_t, bus_dmamap_t, void *,
bus_size_t, struct proc *, int, vm_offset_t *, int *, int));
bus_size_t, struct proc *, int, paddr_t *, int *, int));
/*
* Common function for DMA map creation. May be called by bus-specific
@ -173,7 +164,7 @@ _bus_dmamap_load(t, map, buf, buflen, p, flags)
struct proc *p;
int flags;
{
vm_offset_t lastaddr;
paddr_t lastaddr;
int seg, error;
/*
@ -205,7 +196,7 @@ _bus_dmamap_load_mbuf(t, map, m0, flags)
struct mbuf *m0;
int flags;
{
vm_offset_t lastaddr;
paddr_t lastaddr;
int seg, error, first;
struct mbuf *m;
@ -248,7 +239,7 @@ _bus_dmamap_load_uio(t, map, uio, flags)
struct uio *uio;
int flags;
{
vm_offset_t lastaddr;
paddr_t lastaddr;
int seg, i, error, first;
bus_size_t minlen, resid;
struct proc *p = NULL;
@ -371,7 +362,7 @@ _bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
int *rsegs;
int flags;
{
extern vm_offset_t avail_end; /* XXX temporary */
extern paddr_t avail_end; /* XXX temporary */
return (_bus_dmamem_alloc_range(t, size, alignment, boundary,
segs, nsegs, rsegs, flags, 0, trunc_page(avail_end)));
@ -426,7 +417,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags)
caddr_t *kvap;
int flags;
{
vm_offset_t va;
vaddr_t va;
bus_addr_t addr;
int curseg, s;
@ -485,9 +476,9 @@ _bus_dmamem_unmap(t, kva, size)
size = round_page(size);
s = splimp();
#if defined(UVM)
uvm_km_free(kmem_map, (vm_offset_t)kva, size);
uvm_km_free(kmem_map, (vaddr_t)kva, size);
#else
kmem_free(kmem_map, (vm_offset_t)kva, size);
kmem_free(kmem_map, (vaddr_t)kva, size);
#endif
splx(s);
}
@ -544,13 +535,13 @@ _bus_dmamap_load_buffer(t, map, buf, buflen, p, flags, lastaddrp, segp, first)
bus_size_t buflen;
struct proc *p;
int flags;
vm_offset_t *lastaddrp;
paddr_t *lastaddrp;
int *segp;
int first;
{
bus_size_t sgsize;
bus_addr_t curaddr, lastaddr, baddr, bmask;
vm_offset_t vaddr = (vm_offset_t)buf;
vaddr_t vaddr = (vaddr_t)buf;
int seg;
pmap_t pmap;
@ -645,10 +636,10 @@ _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
int nsegs;
int *rsegs;
int flags;
vm_offset_t low;
vm_offset_t high;
paddr_t low;
paddr_t high;
{
vm_offset_t curaddr, lastaddr;
paddr_t curaddr, lastaddr;
vm_page_t m;
struct pglist mlist;
int curseg, error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: extintr.c,v 1.8 1998/08/15 03:02:35 mycroft Exp $ */
/* $NetBSD: extintr.c,v 1.9 1998/08/24 01:40:27 sakamoto Exp $ */
/* $OpenBSD: isabus.c,v 1.1 1997/10/11 11:53:00 pefo Exp $ */
/*-
@ -64,7 +64,7 @@ int fakeintr(arg)
return 0;
}
extern vm_offset_t bebox_mb_reg;
extern paddr_t bebox_mb_reg;
#define BEBOX_ISA_INTR 16

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.21 1998/07/05 06:49:05 jonathan Exp $ */
/* $NetBSD: machdep.c,v 1.22 1998/08/24 01:40:27 sakamoto Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -129,7 +129,7 @@ extern struct user *proc0paddr;
struct bat battable[16];
vm_offset_t bebox_mb_reg; /* BeBox MotherBoard register */
paddr_t bebox_mb_reg; /* BeBox MotherBoard register */
#define OFMEMREGIONS 32
struct mem_region physmemr[OFMEMREGIONS], availmemr[OFMEMREGIONS];
@ -138,8 +138,10 @@ int astpending;
char *bootpath;
vm_offset_t msgbuf_vaddr, msgbuf_paddr;
vm_offset_t avail_end; /* XXX temporary */
paddr_t msgbuf_paddr;
vaddr_t msgbuf_vaddr;
paddr_t avail_end; /* XXX temporary */
caddr_t allocsys __P((caddr_t));
@ -449,7 +451,7 @@ cpu_startup()
{
int sz, i;
caddr_t v;
vm_offset_t minaddr, maxaddr;
vaddr_t minaddr, maxaddr;
int base, residual;
proc0.p_addr = proc0paddr;
@ -510,7 +512,7 @@ cpu_startup()
*/
sz = MAXBSIZE * nbuf;
#if defined(UVM)
if (uvm_map(kernel_map, (vm_offset_t *)&buffers, round_page(sz),
if (uvm_map(kernel_map, (vaddr_t *)&buffers, round_page(sz),
NULL, UVM_UNKNOWN_OFFSET,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
UVM_ADV_NORMAL, 0)) != KERN_SUCCESS)
@ -518,7 +520,7 @@ cpu_startup()
#else
buffer_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, sz, TRUE);
buffers = (char *)minaddr;
if (vm_map_find(buffer_map, vm_object_allocate(sz), (vm_offset_t)0,
if (vm_map_find(buffer_map, vm_object_allocate(sz), (vaddr_t)0,
&minaddr, sz, FALSE) != KERN_SUCCESS)
panic("startup: cannot allocate buffers");
#endif
@ -531,8 +533,8 @@ cpu_startup()
}
for (i = 0; i < nbuf; i++) {
#if defined(UVM)
vm_size_t curbufsize;
vm_offset_t curbuf;
vsize_t curbufsize;
vaddr_t curbuf;
struct vm_page *pg;
/*
@ -541,7 +543,7 @@ cpu_startup()
* for the first "residual" buffers, and then we allocate
* "base" pages for the rest.
*/
curbuf = (vm_offset_t) buffers + (i * MAXBSIZE);
curbuf = (vaddr_t) buffers + (i * MAXBSIZE);
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
while (curbufsize) {
@ -555,10 +557,10 @@ cpu_startup()
curbufsize -= PAGE_SIZE;
}
#else
vm_size_t curbufsize;
vm_offset_t curbuf;
vsize_t curbufsize;
vaddr_t curbuf;
curbuf = (vm_offset_t)buffers + i * MAXBSIZE;
curbuf = (vaddr_t)buffers + i * MAXBSIZE;
curbufsize = CLBYTES * (i < residual ? base + 1 : base);
vm_map_pageable(buffer_map, curbuf, curbuf + curbufsize, FALSE);
vm_map_simplify(buffer_map, curbuf);
@ -592,10 +594,10 @@ cpu_startup()
* Finally, allocate mbuf cluster submap.
*/
#if defined(UVM)
mb_map = uvm_km_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
mb_map = uvm_km_suballoc(kernel_map, (vaddr_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE, FALSE, NULL);
#else
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
mb_map = kmem_suballoc(kernel_map, (vaddr_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus.h,v 1.14 1998/06/09 05:53:30 sakamoto Exp $ */
/* $NetBSD: bus.h,v 1.15 1998/08/24 01:40:28 sakamoto Exp $ */
/* $OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $ */
/*-
@ -1101,6 +1101,6 @@ int _bus_dmamem_mmap __P((bus_dma_tag_t tag, bus_dma_segment_t *segs,
int _bus_dmamem_alloc_range __P((bus_dma_tag_t tag, bus_size_t size,
bus_size_t alignment, bus_size_t boundary,
bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags,
vm_offset_t low, vm_offset_t high));
paddr_t low, paddr_t high));
#endif /* _BEBOX_BUS_DMA_PRIVATE */
#endif /* _BEBOX_BUS_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.5 1998/01/03 01:13:03 thorpej Exp $ */
/* $NetBSD: pmap.h,v 1.6 1998/08/24 01:40:28 sakamoto Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -72,7 +72,7 @@ extern struct pmap kernel_pmap_;
void pmap_bootstrap __P((u_int kernelstart, u_int kernelend));
#define vtophys(va) ((int)(pmap_extract(pmap_kernel(), (vm_offset_t)va)))
#define vtophys(va) ((int)(pmap_extract(pmap_kernel(), (vaddr_t)va)))
#endif /* _KERNEL */
#endif /* _LOCORE */

View File

@ -1,4 +1,4 @@
/* $NetBSD: powerpc.h,v 1.2 1997/12/18 09:08:03 sakamoto Exp $ */
/* $NetBSD: powerpc.h,v 1.3 1998/08/24 01:40:29 sakamoto Exp $ */
/*
* Copyright (C) 1996 Wolfgang Solfrank.
@ -34,8 +34,8 @@
#define _MACHINE_POWERPC_H_
struct mem_region {
vm_offset_t start;
vm_size_t size;
paddr_t start;
psize_t size;
};
void mem_regions __P((struct mem_region **, struct mem_region **));

View File

@ -1,4 +1,4 @@
/* $NetBSD: vmparam.h,v 1.4 1998/06/09 05:41:19 sakamoto Exp $ */
/* $NetBSD: vmparam.h,v 1.5 1998/08/24 01:40:29 sakamoto Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -83,10 +83,10 @@
/*
* Would like to have MAX addresses = 0, but this doesn't (currently) work
*/
#define VM_MIN_ADDRESS ((vm_offset_t)0)
#define VM_MAXUSER_ADDRESS ((vm_offset_t)0xfffff000)
#define VM_MIN_ADDRESS ((vaddr_t)0)
#define VM_MAXUSER_ADDRESS ((vaddr_t)0xfffff000)
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)(KERNEL_SR << ADDR_SR_SHFT))
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)(KERNEL_SR << ADDR_SR_SHFT))
#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + SEGMENT_LENGTH - 1)
#define VM_KMEM_SIZE (NKMEMCLUSTERS * CLBYTES)
@ -104,4 +104,7 @@ struct pmap_physseg {
#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
#define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
#define VM_NFREELIST 1
#define VM_FREELIST_DEFAULT 0
#endif /* _MACHINE_VMPARAM_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: isa_machdep.h,v 1.6 1998/06/09 01:06:33 thorpej Exp $ */
/* $NetBSD: isa_machdep.h,v 1.7 1998/08/24 01:40:29 sakamoto Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -232,7 +232,7 @@ struct bebox_isa_dma_cookie {
#define DMA_BOUNCE 8 /* one buffer per channel */
#endif
extern vm_offset_t isaphysmem;
extern paddr_t isaphysmem;
/*
* Miscellanous functions.

View File

@ -1,4 +1,4 @@
/* $NetBSD: isadma_machdep.c,v 1.11 1998/06/09 05:53:30 sakamoto Exp $ */
/* $NetBSD: isadma_machdep.c,v 1.12 1998/08/24 01:40:30 sakamoto Exp $ */
#define ISA_DMA_STATS
@ -59,7 +59,7 @@
#include <vm/vm.h>
extern vm_offset_t avail_end; /* XXX temporary */
extern paddr_t avail_end; /* XXX temporary */
/*
* ISA can DMA to 0-16M.
@ -592,7 +592,7 @@ _isa_bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
int *rsegs;
int flags;
{
vm_offset_t high;
paddr_t high;
if (avail_end > ISA_DMA_BOUNCE_THRESHOLD)
high = trunc_page(ISA_DMA_BOUNCE_THRESHOLD);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.h,v 1.2 1998/08/15 03:02:37 mycroft Exp $ */
/* $NetBSD: pci_machdep.h,v 1.3 1998/08/24 01:40:30 sakamoto Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -69,11 +69,3 @@ const char *pci_intr_string __P((pci_chipset_tag_t, pci_intr_handle_t));
void *pci_intr_establish __P((pci_chipset_tag_t, pci_intr_handle_t,
int, int (*)(void *), void *));
void pci_intr_disestablish __P((pci_chipset_tag_t, void *));
/*
* Compatibility functions, to map the old be PCI functions to the new ones.
* NOT TO BE USED BY NEW CODE.
*/
void *pci_map_int __P((pcitag_t, int, int (*)(void *), void *));
int pci_map_io __P((pcitag_t, int, int *));
int pci_map_mem __P((pcitag_t, int, vm_offset_t *, vm_offset_t *));