Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha Add glue for page zero'ing in the idle loop.



details:   https://anonhg.NetBSD.org/src/rev/7b1d735ef06b
branches:  trunk
changeset: 509194:7b1d735ef06b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Apr 29 06:54:03 2001 +0000

description:
Add glue for page zero'ing in the idle loop.

diffstat:

 sys/arch/alpha/alpha/genassym.cf |   4 +++-
 sys/arch/alpha/alpha/locore.s    |  14 ++++++++++----
 sys/arch/alpha/alpha/pmap.c      |  31 +++++++++++++++++++++++++++++--
 sys/arch/alpha/include/pmap.h    |   5 ++++-
 4 files changed, 46 insertions(+), 8 deletions(-)

diffs (132 lines):

diff -r 98657880bf88 -r 7b1d735ef06b sys/arch/alpha/alpha/genassym.cf
--- a/sys/arch/alpha/alpha/genassym.cf  Sun Apr 29 05:56:47 2001 +0000
+++ b/sys/arch/alpha/alpha/genassym.cf  Sun Apr 29 06:54:03 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.3 2001/01/19 18:51:17 thorpej Exp $
+# $NetBSD: genassym.cf,v 1.4 2001/04/29 06:54:03 thorpej Exp $
 
 #
 # Copyright (c) 1994, 1995 Gordon W. Ross
@@ -53,6 +53,7 @@
 include <machine/rpb.h>
 include <machine/vmparam.h>
 
+include <uvm/uvm.h>
 include <uvm/uvm_extern.h>
 
 # general constants 
@@ -132,6 +133,7 @@
 
 # offsets needed by cpu_switch() to switch mappings.
 define VM_MAP_PMAP             offsetof(struct vmspace, vm_map.pmap)
+define UVM_PAGE_IDLE_ZERO      offsetof(struct uvm, page_idle_zero)
 
 # Important offsets into the user struct & associated constants
 define UPAGES                  UPAGES
diff -r 98657880bf88 -r 7b1d735ef06b sys/arch/alpha/alpha/locore.s
--- a/sys/arch/alpha/alpha/locore.s     Sun Apr 29 05:56:47 2001 +0000
+++ b/sys/arch/alpha/alpha/locore.s     Sun Apr 29 06:54:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.94 2001/04/26 03:10:44 ross Exp $ */
+/* $NetBSD: locore.s,v 1.95 2001/04/29 06:54:04 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
 
 #include <machine/asm.h>
 
-__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.94 2001/04/26 03:10:44 ross Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.95 2001/04/29 06:54:04 thorpej Exp $");
 
 #include "assym.h"
 
@@ -743,9 +743,15 @@
 #endif
        mov     zero, a0                        /* enable all interrupts */
        call_pal PAL_OSF1_swpipl
-2:     ldl     t0, sched_whichqs               /* look for non-empty queue */
+       ldl     t0, sched_whichqs               /* look for non-empty queue */
+       bne     t0, 4f
+2:     lda     t0, uvm
+       ldl     t0, UVM_PAGE_IDLE_ZERO(t0)      /* should we zero some pages? */
+       beq     t0, 3f                          /* nope. */
+       CALL(uvm_pageidlezero)
+3:     ldl     t0, sched_whichqs               /* look for non-empty queue */
        beq     t0, 2b
-       ldiq    a0, ALPHA_PSL_IPL_HIGH          /* disable all interrupts */
+4:     ldiq    a0, ALPHA_PSL_IPL_HIGH          /* disable all interrupts */
        call_pal PAL_OSF1_swpipl
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
        CALL(sched_lock_idle)                   /* acquire sched_lock */
diff -r 98657880bf88 -r 7b1d735ef06b sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Sun Apr 29 05:56:47 2001 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Sun Apr 29 06:54:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.171 2001/04/24 20:53:43 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.172 2001/04/29 06:54:04 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -154,7 +154,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.171 2001/04/24 20:53:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.172 2001/04/29 06:54:04 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2430,6 +2430,33 @@
 }
 
 /*
+ * pmap_pageidlezero:          [ INTERFACE ]
+ *
+ *     Page zero'er for the idle loop.  Returns TRUE if the
+ *     page was zero'd, FLASE if we aborted for some reason.
+ */
+boolean_t
+pmap_pageidlezero(paddr_t pa)
+{
+       u_long *ptr;
+       int i, cnt = PAGE_SIZE / sizeof(u_long);
+
+       for (i = 0, ptr = (u_long *) ALPHA_PHYS_TO_K0SEG(pa); i < cnt; i++) {
+               if (sched_whichqs != 0) {
+                       /*
+                        * A process has become ready.  Abort now,
+                        * so we don't keep it waiting while we
+                        * finish zeroing the page.
+                        */
+                       return (FALSE);
+               }
+               *ptr++ = 0;
+       }
+
+       return (TRUE);
+}
+
+/*
  * pmap_clear_modify:          [ INTERFACE ]
  *
  *     Clear the modify bits on the specified physical page.
diff -r 98657880bf88 -r 7b1d735ef06b sys/arch/alpha/include/pmap.h
--- a/sys/arch/alpha/include/pmap.h     Sun Apr 29 05:56:47 2001 +0000
+++ b/sys/arch/alpha/include/pmap.h     Sun Apr 29 06:54:03 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.44 2001/04/24 20:14:45 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.45 2001/04/29 06:54:06 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -230,6 +230,9 @@
 #define        PMAP_MAP_POOLPAGE(pa)           ALPHA_PHYS_TO_K0SEG((pa))
 #define        PMAP_UNMAP_POOLPAGE(va)         ALPHA_K0SEG_TO_PHYS((va))
 
+boolean_t                      pmap_pageidlezero(paddr_t);
+#define        PMAP_PAGEIDLEZERO(pa)   pmap_pageidlezero((pa))
+
 paddr_t vtophys(vaddr_t);
 
 /* Machine-specific functions. */



Home | Main Index | Thread Index | Old Index