From 51038fcecccdb2ef38a03bd8672d9f4024d22d23 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sat, 2 Oct 1999 14:54:27 +0000 Subject: 1999-09-28 Thomas Bushnell, BSG * 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. --- init/ChangeLog | 7 +++++++ init/init.c | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'init') 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 + + * 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 * 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; } -- cgit v1.2.3