Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add a __HAVE_CPU_UAREA_IDLELWP hook so that the MD code ...
details: https://anonhg.NetBSD.org/src/rev/497f6cbe649b
branches: trunk
changeset: 781325:497f6cbe649b
user: matt <matt%NetBSD.org@localhost>
date: Sat Sep 01 00:26:37 2012 +0000
description:
Add a __HAVE_CPU_UAREA_IDLELWP hook so that the MD code can allocate
special UAREAs for idle lwp's.
diffstat:
sys/kern/kern_kthread.c | 7 ++++---
sys/uvm/uvm_extern.h | 4 ++--
sys/uvm/uvm_glue.c | 10 +++++++---
3 files changed, 13 insertions(+), 8 deletions(-)
diffs (78 lines):
diff -r b740240a6a4a -r 497f6cbe649b sys/kern/kern_kthread.c
--- a/sys/kern/kern_kthread.c Sat Sep 01 00:24:43 2012 +0000
+++ b/sys/kern/kern_kthread.c Sat Sep 01 00:26:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_kthread.c,v 1.38 2011/11/01 15:39:37 jym Exp $ */
+/* $NetBSD: kern_kthread.c,v 1.39 2012/09/01 00:26:37 matt Exp $ */
/*-
* Copyright (c) 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.38 2011/11/01 15:39:37 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.39 2012/09/01 00:26:37 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -70,7 +70,8 @@
KASSERT((flag & KTHREAD_INTR) == 0 || (flag & KTHREAD_MPSAFE) != 0);
- uaddr = uvm_uarea_system_alloc();
+ uaddr = uvm_uarea_system_alloc(
+ (flag & (KTHREAD_INTR|KTHREAD_IDLE)) == KTHREAD_IDLE ? ci : NULL);
if (uaddr == 0) {
return ENOMEM;
}
diff -r b740240a6a4a -r 497f6cbe649b sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h Sat Sep 01 00:24:43 2012 +0000
+++ b/sys/uvm/uvm_extern.h Sat Sep 01 00:26:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_extern.h,v 1.183 2012/04/08 11:27:45 martin Exp $ */
+/* $NetBSD: uvm_extern.h,v 1.184 2012/09/01 00:26:37 matt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -601,7 +601,7 @@
__dead void uvm_scheduler(void);
vaddr_t uvm_uarea_alloc(void);
void uvm_uarea_free(vaddr_t);
-vaddr_t uvm_uarea_system_alloc(void);
+vaddr_t uvm_uarea_system_alloc(struct cpu_info *);
void uvm_uarea_system_free(vaddr_t);
vaddr_t uvm_lwp_getuarea(lwp_t *);
void uvm_lwp_setuarea(lwp_t *, vaddr_t);
diff -r b740240a6a4a -r 497f6cbe649b sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c Sat Sep 01 00:24:43 2012 +0000
+++ b/sys/uvm/uvm_glue.c Sat Sep 01 00:26:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_glue.c,v 1.159 2012/04/08 11:27:45 martin Exp $ */
+/* $NetBSD: uvm_glue.c,v 1.160 2012/09/01 00:26:37 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.159 2012/04/08 11:27:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.160 2012/09/01 00:26:37 matt Exp $");
#include "opt_kgdb.h"
#include "opt_kstack.h"
@@ -366,8 +366,12 @@
}
vaddr_t
-uvm_uarea_system_alloc(void)
+uvm_uarea_system_alloc(struct cpu_info *ci)
{
+#ifdef __HAVE_CPU_UAREA_ALLOC_IDLELWP
+ if (__predict_false(ci != NULL))
+ return cpu_uarea_alloc_idlelwp(ci);
+#endif
return (vaddr_t)pool_cache_get(uvm_uarea_system_cache, PR_WAITOK);
}
Home |
Main Index |
Thread Index |
Old Index