summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/include/vmparam.h10
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c10
-rw-r--r--sys/arch/sparc64/sparc64/vm_machdep.c14
3 files changed, 23 insertions, 11 deletions
diff --git a/sys/arch/sparc64/include/vmparam.h b/sys/arch/sparc64/include/vmparam.h
index 67f40a85682..28e3eeea104 100644
--- a/sys/arch/sparc64/include/vmparam.h
+++ b/sys/arch/sparc64/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.27 2014/10/09 04:01:27 tedu Exp $ */
+/* $OpenBSD: vmparam.h,v 1.28 2014/10/24 20:26:58 kettenis Exp $ */
/* $NetBSD: vmparam.h,v 1.18 2001/05/01 02:19:19 thorpej Exp $ */
/*
@@ -94,6 +94,11 @@
#endif
/*
+ * Size of User Raw I/O map
+ */
+#define USRIOSIZE 300
+
+/*
* Mach derived constants
*/
@@ -111,6 +116,9 @@
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0x000007ffffffffffL)
+/* virtual sizes (bytes) for various kernel submaps */
+#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
+
#define VM_PHYSSEG_MAX 32 /* up to 32 segments */
#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
#define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 403de782611..1641a47d593 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.168 2014/09/18 18:55:23 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.169 2014/10/24 20:26:58 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -160,6 +160,7 @@ int _bus_dmamem_alloc_range(bus_dma_tag_t tag, bus_dma_tag_t,
int bus_space_debug = 0;
struct vm_map *exec_map = NULL;
+struct vm_map *phys_map = NULL;
struct uvm_constraint_range dma_constraint = { 0x0, (paddr_t)-1 };
struct uvm_constraint_range *uvm_md_constraints[] = { NULL };
@@ -233,6 +234,13 @@ cpu_startup()
exec_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
16*NCARGS, VM_MAP_PAGEABLE, FALSE, NULL);
+ /*
+ * Allocate a submap for physio
+ */
+ minaddr = vm_map_min(kernel_map);
+ phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
+ VM_PHYS_SIZE, 0, FALSE, NULL);
+
#ifdef DEBUG
pmapdebug = opmapdebug;
#endif
diff --git a/sys/arch/sparc64/sparc64/vm_machdep.c b/sys/arch/sparc64/sparc64/vm_machdep.c
index a1af56aa942..fde01c2ebb1 100644
--- a/sys/arch/sparc64/sparc64/vm_machdep.c
+++ b/sys/arch/sparc64/sparc64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.30 2014/07/12 18:44:43 tedu Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.31 2014/10/24 20:26:58 kettenis Exp $ */
/* $NetBSD: vm_machdep.c,v 1.38 2001/06/30 00:02:20 eeh Exp $ */
/*
@@ -75,9 +75,7 @@
* do not need to pass an access_type to pmap_enter().
*/
void
-vmapbuf(bp, len)
- struct buf *bp;
- vsize_t len;
+vmapbuf(struct buf *bp, vsize_t len)
{
struct pmap *upmap, *kpmap;
vaddr_t uva; /* User VA (map from) */
@@ -96,7 +94,7 @@ vmapbuf(bp, len)
uva = trunc_page((vaddr_t)bp->b_data);
off = (vaddr_t)bp->b_data - uva;
len = round_page(off + len);
- kva = uvm_km_valloc_prefer_wait(kernel_map, len, uva);
+ kva = uvm_km_valloc_prefer_wait(phys_map, len, uva);
bp->b_data = (caddr_t)(kva + off);
upmap = vm_map_pmap(&bp->b_proc->p_vmspace->vm_map);
@@ -121,9 +119,7 @@ vmapbuf(bp, len)
* Unmap a previously-mapped user I/O request.
*/
void
-vunmapbuf(bp, len)
- struct buf *bp;
- vsize_t len;
+vunmapbuf(struct buf *bp, vsize_t len)
{
vaddr_t kva;
vsize_t off;
@@ -137,7 +133,7 @@ vunmapbuf(bp, len)
pmap_remove(pmap_kernel(), kva, kva + len);
pmap_update(pmap_kernel());
- uvm_km_free_wakeup(kernel_map, kva, len);
+ uvm_km_free_wakeup(phys_map, kva, len);
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = NULL;
}