Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Allow the MD code to decide to panic if cpu_uarea_alloc ...
details: https://anonhg.NetBSD.org/src/rev/be363aed7d17
branches: trunk
changeset: 766789:be363aed7d17
user: matt <matt%NetBSD.org@localhost>
date: Sat Jul 02 01:26:29 2011 +0000
description:
Allow the MD code to decide to panic if cpu_uarea_alloc would return NULL.
If NULL is returned, just allocate the standard way.
diffstat:
sys/arch/powerpc/powerpc/vm_machdep.c | 8 ++++----
sys/uvm/uvm_glue.c | 13 +++++++++----
2 files changed, 13 insertions(+), 8 deletions(-)
diffs (70 lines):
diff -r 29d8c8867f3e -r be363aed7d17 sys/arch/powerpc/powerpc/vm_machdep.c
--- a/sys/arch/powerpc/powerpc/vm_machdep.c Sat Jul 02 01:05:38 2011 +0000
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c Sat Jul 02 01:26:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.91 2011/07/02 00:38:29 matt Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.92 2011/07/02 01:26:29 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.91 2011/07/02 00:38:29 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.92 2011/07/02 01:26:29 matt Exp $");
#include "opt_altivec.h"
#include "opt_multiprocessor.h"
@@ -298,7 +298,7 @@
error = uvm_pglistalloc(USPACE, 0, ptoa(physmem), 0, 0, &pglist, 1, 1);
if (error) {
if (!system)
- return (void *)uvm_uarea_alloc();
+ return NULL;
panic("%s: uvm_pglistalloc failed: %d", __func__, error);
}
@@ -315,7 +315,7 @@
return (void *)(uintptr_t)PMAP_MAP_POOLPAGE(pa);
#else
- return (void *)uvm_uarea_alloc();
+ return NULL;
#endif
}
diff -r 29d8c8867f3e -r be363aed7d17 sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c Sat Jul 02 01:05:38 2011 +0000
+++ b/sys/uvm/uvm_glue.c Sat Jul 02 01:26:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_glue.c,v 1.150 2011/06/12 03:36:03 rmind Exp $ */
+/* $NetBSD: uvm_glue.c,v 1.151 2011/07/02 01:26:29 matt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.150 2011/06/12 03:36:03 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.151 2011/07/02 01:26:29 matt Exp $");
#include "opt_kgdb.h"
#include "opt_kstack.h"
@@ -298,8 +298,13 @@
uarea_system_poolpage_alloc(struct pool *pp, int flags)
{
void * const va = cpu_uarea_alloc(true);
- KASSERT(va != NULL);
- return va;
+ if (va != NULL)
+ return va;
+
+ return (void *)uvm_km_alloc(kernel_map, pp->pr_alloc->pa_pagesz,
+ USPACE_ALIGN, UVM_KMF_WIRED |
+ ((flags & PR_WAITOK) ? UVM_KMF_WAITVA :
+ (UVM_KMF_NOWAIT | UVM_KMF_TRYLOCK)));
}
static void
Home |
Main Index |
Thread Index |
Old Index