summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init/ChangeLog7
-rw-r--r--init/init.c5
2 files changed, 9 insertions, 3 deletions
diff --git a/init/ChangeLog b/init/ChangeLog
index 6c20462c..941c6903 100644
--- a/init/ChangeLog
+++ b/init/ChangeLog
@@ -1,3 +1,10 @@
+1999-09-28 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * init.c (frob_kernel_process): Allocate the kernel's page in the
+ actual kernel task, not in our own. I wonder how this ever
+ worked. Also if we fail in that allocation, free the page we
+ allocated in our own space.
+
1999-08-24 Roland McGrath <roland@baalperazim.frob.com>
* init.c (notify_shutdown): Add const to argument type.
diff --git a/init/init.c b/init/init.c
index 1acf2b9c..3ec1270b 100644
--- a/init/init.c
+++ b/init/init.c
@@ -1010,15 +1010,14 @@ frob_kernel_process (void)
mine = (vm_address_t) mmap (0, windowsz, PROT_READ|PROT_WRITE,
MAP_ANON, 0, 0);
assert (mine != -1);
- his = (vm_address_t) mmap (0, windowsz, PROT_READ|PROT_WRITE,
- MAP_ANON, 0, 0);
- assert (his != -1);
+ err = vm_allocate (task, &his, windowsz, 1);
if (err)
{
error (0, err, "cannot allocate %Zu bytes in kernel task", windowsz);
free (argz);
mach_port_deallocate (mach_task_self (), proc);
mach_port_deallocate (mach_task_self (), task);
+ munmap ((caddr_t) mine, windowsz);
return;
}