summaryrefslogtreecommitdiff
path: root/sys/arch/hp300
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-11-28 13:47:41 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-11-28 13:47:41 +0000
commit4c46afe9f467831fba921bfa77a12903c4c39c7d (patch)
treeb755c95bf93b8cb384f911d3f70b96063188d78a /sys/arch/hp300
parent8a3355695ffa23bba7a2cb69d229a81ba3485bf9 (diff)
Sync in more uvm changes from NetBSD.
This time we're getting rid of KERN_* and VM_PAGER_* error codes and use errnos instead.
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r--sys/arch/hp300/dev/grf.c8
-rw-r--r--sys/arch/hp300/hp300/machdep.c9
-rw-r--r--sys/arch/hp300/hp300/pmap.c18
-rw-r--r--sys/arch/hp300/hp300/trap.c14
4 files changed, 22 insertions, 27 deletions
diff --git a/sys/arch/hp300/dev/grf.c b/sys/arch/hp300/dev/grf.c
index feb437cb0a7..3b1801f6a28 100644
--- a/sys/arch/hp300/dev/grf.c
+++ b/sys/arch/hp300/dev/grf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grf.c,v 1.16 2001/11/06 19:53:14 miod Exp $ */
+/* $OpenBSD: grf.c,v 1.17 2001/11/28 13:47:38 art Exp $ */
/* $NetBSD: grf.c,v 1.30 1998/08/20 08:33:41 kleink Exp $ */
/*
@@ -654,7 +654,6 @@ grfunmap(dev, addr, p)
struct grf_softc *sc = grf_cd.cd_devs[GRFUNIT(dev)];
struct grf_data *gp = sc->sc_data;
vsize_t size;
- int rv;
#ifdef DEBUG
if (grfdebug & GDB_MMAP)
@@ -664,9 +663,8 @@ grfunmap(dev, addr, p)
return(EINVAL); /* XXX: how do we deal with this? */
(void) (*gp->g_sw->gd_mode)(gp, GM_UNMAP, 0);
size = round_page(gp->g_display.gd_regsize + gp->g_display.gd_fbsize);
- rv = uvm_unmap(&p->p_vmspace->vm_map, (vaddr_t)addr,
- (vaddr_t)addr + size);
- return(rv == KERN_SUCCESS ? 0 : EINVAL);
+ uvm_unmap(&p->p_vmspace->vm_map, (vaddr_t)addr, (vaddr_t)addr + size);
+ return (0);
}
#ifdef COMPAT_HPUX
diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c
index ff538e8162b..b3d519e6285 100644
--- a/sys/arch/hp300/hp300/machdep.c
+++ b/sys/arch/hp300/hp300/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.68 2001/11/09 15:25:55 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.69 2001/11/28 13:47:38 art Exp $ */
/* $NetBSD: machdep.c,v 1.121 1999/03/26 23:41:29 mycroft Exp $ */
/*
@@ -293,7 +293,7 @@ cpu_startup()
if (uvm_map(kernel_map, (vaddr_t *) &buffers, round_page(size),
NULL, UVM_UNKNOWN_OFFSET, 0,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
- UVM_ADV_NORMAL, 0)) != KERN_SUCCESS)
+ UVM_ADV_NORMAL, 0)))
panic("startup: cannot allocate VM for buffers");
minaddr = (vaddr_t)buffers;
base = bufpages / nbuf;
@@ -353,8 +353,7 @@ cpu_startup()
* XXX This is bogus; should just fix KERNBASE and
* XXX VM_MIN_KERNEL_ADDRESS, but not right now.
*/
- if (uvm_map_protect(kernel_map, 0, NBPG, UVM_PROT_NONE, TRUE)
- != KERN_SUCCESS)
+ if (uvm_map_protect(kernel_map, 0, NBPG, UVM_PROT_NONE, TRUE))
panic("can't mark page 0 off-limits");
/*
@@ -365,7 +364,7 @@ cpu_startup()
* XXX of NBPG.
*/
if (uvm_map_protect(kernel_map, NBPG, round_page((vaddr_t)&etext),
- UVM_PROT_READ|UVM_PROT_EXEC, TRUE) != KERN_SUCCESS)
+ UVM_PROT_READ|UVM_PROT_EXEC, TRUE))
panic("can't protect kernel text");
/*
diff --git a/sys/arch/hp300/hp300/pmap.c b/sys/arch/hp300/hp300/pmap.c
index 7677a088434..77f75eecac4 100644
--- a/sys/arch/hp300/hp300/pmap.c
+++ b/sys/arch/hp300/hp300/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.32 2001/11/27 22:05:29 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.33 2001/11/28 13:47:38 art Exp $ */
/* $NetBSD: pmap.c,v 1.80 1999/09/16 14:52:06 chs Exp $ */
/*-
@@ -383,14 +383,14 @@ pmap_init()
NULL, UVM_UNKNOWN_OFFSET, 0,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE,
UVM_INH_NONE, UVM_ADV_RANDOM,
- UVM_FLAG_FIXED)) != KERN_SUCCESS)
+ UVM_FLAG_FIXED)))
goto bogons;
addr = (vaddr_t) Sysmap;
if (uvm_map(kernel_map, &addr, HP_MAX_PTSIZE,
NULL, UVM_UNKNOWN_OFFSET, 0,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE,
UVM_INH_NONE, UVM_ADV_RANDOM,
- UVM_FLAG_FIXED)) != KERN_SUCCESS) {
+ UVM_FLAG_FIXED))) {
/*
* If this fails, it is probably because the static
* portion of the kernel page table isn't big enough
@@ -464,11 +464,9 @@ pmap_init()
rv = uvm_map(kernel_map, &addr, s, NULL, UVM_UNKNOWN_OFFSET, 0,
UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
UVM_ADV_RANDOM, UVM_FLAG_NOMERGE));
- if (rv != KERN_SUCCESS || (addr + s) >= (vaddr_t)Sysmap)
+ if (rv || (addr + s) >= (vaddr_t)Sysmap)
panic("pmap_init: kernel PT too small");
- rv = uvm_unmap(kernel_map, addr, addr + s);
- if (rv != KERN_SUCCESS)
- panic("pmap_init: uvm_unmap failed");
+ uvm_unmap(kernel_map, addr, addr + s);
/*
* Now allocate the space and link the pages together to
@@ -1399,7 +1397,7 @@ validate:
pmap_check_wiring("enter", trunc_page((vaddr_t)pte));
#endif
- return (KERN_SUCCESS);
+ return (0);
}
void
@@ -2124,9 +2122,9 @@ pmap_mapmulti(pmap, va)
if (*ste == SG_NV && (*bste & SG_V)) {
*ste = *bste;
TBIAU();
- return (KERN_SUCCESS);
+ return (0);
}
- return (KERN_INVALID_ADDRESS);
+ return (EFAULT);
}
#endif /* COMPAT_HPUX */
diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c
index 591973cd303..6744ada3853 100644
--- a/sys/arch/hp300/hp300/trap.c
+++ b/sys/arch/hp300/hp300/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.32 2001/11/25 17:15:19 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.33 2001/11/28 13:47:38 art Exp $ */
/* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */
/*
@@ -646,10 +646,10 @@ dopanic:
vaddr_t bva;
rv = pmap_mapmulti(map->pmap, va);
- if (rv != KERN_SUCCESS) {
+ if (rv) {
bva = HPMMBASEADDR(va);
rv = uvm_fault(map, bva, 0, ftype);
- if (rv == KERN_SUCCESS)
+ if (rv == 0)
(void) pmap_mapmulti(map->pmap, va);
}
} else
@@ -669,16 +669,16 @@ dopanic:
*/
if ((vm != NULL && (caddr_t)va >= vm->vm_maxsaddr)
&& map != kernel_map) {
- if (rv == KERN_SUCCESS) {
+ if (rv == 0) {
unsigned nss;
nss = btoc(USRSTACK-(unsigned)va);
if (nss > vm->vm_ssize)
vm->vm_ssize = nss;
- } else if (rv == KERN_PROTECTION_FAILURE)
- rv = KERN_INVALID_ADDRESS;
+ } else if (rv == EACCES)
+ rv = EFAULT;
}
- if (rv == KERN_SUCCESS) {
+ if (rv == 0) {
if (type == T_MMUFLT) {
#ifdef M68040
if (cputype == CPU_68040)