diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-11-20 20:33:25 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-11-20 20:33:25 +0000 |
commit | b7e31873a5c9480c386ed30cda01527bec2c0527 (patch) | |
tree | e8f6580efeecf338242520c76bc4469a5748e650 /sys/arch/vax | |
parent | 0ec4827cfd483b9a1e6a836c4dbc9266b7bf44f6 (diff) |
This is a first step towards getting rid of avail_start and avail_end in the
kernel, currently limited to low-hanging fruit: these variables were used
by bus_dma to specify the range in which to allocate memory, back when
uvm_pglistalloc() was stupid and would not walk the vm_physseg[].
Nowadays, except on some platforms for early initialization, these variables
are not used, or do not need to be global variables. Therefore:
- remove `extern' declarations of avail_start and avail_end (or close cousins,
such as arm physical_start and physical_end) from files which no longer need
to use them.
- make them local variables whenever possible.
- remove them when they are assigned to but no longer used.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/vax/bus_dma.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/vax/mem.c | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sys/arch/vax/vax/bus_dma.c b/sys/arch/vax/vax/bus_dma.c index ff904c3e2a8..b5984fe383d 100644 --- a/sys/arch/vax/vax/bus_dma.c +++ b/sys/arch/vax/vax/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.24 2010/03/29 19:21:58 oga Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.25 2010/11/20 20:33:24 miod Exp $ */ /* $NetBSD: bus_dma.c,v 1.5 1999/11/13 00:32:20 thorpej Exp $ */ /*- @@ -56,7 +56,7 @@ #include <machine/ka43.h> #include <machine/sid.h> -extern vaddr_t avail_start, avail_end, virtual_avail; +extern vaddr_t virtual_avail; int _bus_dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int, paddr_t *, int *, int); diff --git a/sys/arch/vax/vax/mem.c b/sys/arch/vax/vax/mem.c index 036fae831d6..858182c57ea 100644 --- a/sys/arch/vax/vax/mem.c +++ b/sys/arch/vax/vax/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.15 2007/09/22 16:21:32 krw Exp $ */ +/* $OpenBSD: mem.c,v 1.16 2010/11/20 20:33:24 miod Exp $ */ /* $NetBSD: mem.c,v 1.15 1999/03/24 05:51:17 mrg Exp $ */ /* @@ -54,7 +54,6 @@ #include <uvm/uvm_extern.h> -extern unsigned int avail_end; caddr_t zeropage; #define mmread mmrw @@ -117,7 +116,7 @@ mmrw(dev, uio, flags) /* minor device 0 is physical memory */ case 0: v = uio->uio_offset; - if (v < 0 || v >= avail_end) { + if (v < 0 || v >= ptoa(physmem)) { return (EFAULT); } |