summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/wire.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-11 19:23:41 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-11 19:23:41 +0000
commit23fc870c76951551c0d88b82eb04ff03e1f101a1 (patch)
tree20f17e56a00967ea56159b770b0b4dc0cf76e9f3 /libshouldbeinlibc/wire.c
parent5fd890b2c27971d15f7fbd5bcf050316e50801f7 (diff)
(wire_segment_internal):
Diffstat (limited to 'libshouldbeinlibc/wire.c')
-rw-r--r--libshouldbeinlibc/wire.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libshouldbeinlibc/wire.c b/libshouldbeinlibc/wire.c
index a9435244..16b8319c 100644
--- a/libshouldbeinlibc/wire.c
+++ b/libshouldbeinlibc/wire.c
@@ -65,6 +65,7 @@ wire_segment_internal (vm_address_t start,
mach_port_t object_name;
vm_offset_t offset;
error_t err;
+ volatile char *poke;
do
{
@@ -83,12 +84,19 @@ wire_segment_internal (vm_address_t start,
/* Set protection to allow all access possible */
vm_protect (mach_task_self (), addr, size, 0, max_protection);
+ /* Generate write faults */
+ for (poke = (char *) addr;
+ (vm_address_t) poke < addr + size;
+ poke += vm_page_size)
+ *poke = *poke;
+
/* Wire pages */
vm_wire (host_priv, mach_task_self (), addr, size, max_protection);
/* Set protection back to what it was */
vm_protect (mach_task_self (), addr, size, 0, protection);
-
+
+
mach_port_deallocate (mach_task_self (), object_name);
len -= (addr - start) + size;