Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/usermode Braindead implementation of pmap_...



details:   https://anonhg.NetBSD.org/src/rev/0b6bc4da1e7f
branches:  trunk
changeset: 768637:0b6bc4da1e7f
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Tue Aug 23 13:35:57 2011 +0000

description:
Braindead implementation of pmap_zero_page()

diffstat:

 sys/arch/usermode/usermode/pmap.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 53993fbca954 -r 0b6bc4da1e7f sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Tue Aug 23 13:01:25 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Tue Aug 23 13:35:57 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.18 2011/08/23 12:46:58 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.19 2011/08/23 13:35:57 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <reinoud%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.18 2011/08/23 12:46:58 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.19 2011/08/23 13:35:57 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -664,10 +664,19 @@
 printf("pmap_deactivate\n");
 }
 
+/* XXX braindead zero_page implementation but it works for now */
 void
 pmap_zero_page(paddr_t pa)
 {
-printf("pmap_zero_page: pa %p\n", (void *) pa);
+       char blob[PAGE_SIZE];
+       int num;
+
+       aprintf_debug("pmap_zero_page: pa %p\n", (void *) pa);
+
+       memset(blob, 0, PAGE_SIZE);
+       num = thunk_pwrite(mem_fh, blob, PAGE_SIZE, pa*PAGE_SIZE);
+       if (num != PAGE_SIZE)
+               panic("pmap_zero_page couldn't write out\n");
 }
 
 void



Home | Main Index | Thread Index | Old Index