Move the user structure for process 0 into the same page as its stack segment,

the same as for every other process.  It probably doesn't matter, but it makes
me feel more comfortable.
This commit is contained in:
bjh21 2000-09-18 18:01:39 +00:00
parent e9705f4d86
commit 35dc9595d6
2 changed files with 17 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: start.c,v 1.2 2000/06/29 08:32:35 mrg Exp $ */
/* $NetBSD: start.c,v 1.3 2000/09/18 18:01:39 bjh21 Exp $ */
/*-
* Copyright (c) 1998, 2000 Ben Harris
* All rights reserved.
@ -32,9 +32,10 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "SId$");
__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.3 2000/09/18 18:01:39 bjh21 Exp $");
#include <sys/msgbuf.h>
#include <sys/user.h>
#include <sys/syslog.h>
#include <sys/systm.h>
@ -58,8 +59,12 @@ extern void main __P((void)); /* XXX Should be in a header file */
struct bootconfig bootconfig;
struct user *proc0paddr;
#ifdef DIAGNOSTIC
#define BOOT_SANITY 0x89345846
static int boot_sanity = BOOT_SANITY;
#endif
#ifndef __ELF__
/* Odd symbols declared by the linker */
@ -81,6 +86,7 @@ start(initbootconfig)
size_t size;
caddr_t v;
char pbuf[9];
int onstack;
/*
* State of the world as of BBBB 0.02:
@ -216,6 +222,13 @@ start(initbootconfig)
#endif
int_on();
/*
* Locate process 0's user structure, in the bottom of its kernel
* stack page. That's our current stack page too.
*/
proc0paddr = (struct user *)(round_page((vaddr_t)&onstack) - USPACE);
bzero(proc0paddr, sizeof(*proc0paddr));
/* TODO: anything else? */
main();

View File

@ -1,11 +1,11 @@
/* $NetBSD: stubs.c,v 1.5 2000/08/25 16:43:46 bjh21 Exp $ */
/* $NetBSD: stubs.c,v 1.6 2000/09/18 18:01:39 bjh21 Exp $ */
/*
* stubs.c -- functions I haven't written yet
*/
#include <sys/param.h>
__RCSID("$NetBSD: stubs.c,v 1.5 2000/08/25 16:43:46 bjh21 Exp $");
__RCSID("$NetBSD: stubs.c,v 1.6 2000/09/18 18:01:39 bjh21 Exp $");
#include <sys/kernel.h>
#include <sys/systm.h>
@ -130,6 +130,3 @@ int sys_sysarch(p, v, retval)
{
panic("sys_sysarch not implemented");
}
static struct user user0;
struct user *proc0paddr = &user0;