Module Name: src
Committed By: reinoud
Date: Tue Aug 23 13:35:57 UTC 2011
Modified Files:
src/sys/arch/usermode/usermode: pmap.c
Log Message:
Braindead implementation of pmap_zero_page()
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/usermode/usermode/pmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.18 src/sys/arch/usermode/usermode/pmap.c:1.19
--- src/sys/arch/usermode/usermode/pmap.c:1.18 Tue Aug 23 12:46:58 2011
+++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 23 13:35:57 2011
@@ -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 <[email protected]>
@@ -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