Split hwrpb_restart_setup(), putting the code that initializes the vtpb

and primary hwpcb into hwrpb_primary_init().  Call the latter before
performing autoconfiguration().
This commit is contained in:
thorpej 1998-10-06 21:10:46 +00:00
parent 5a687aeb55
commit 2038eb830c
3 changed files with 27 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.150 1998/09/29 23:45:25 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.151 1998/10/06 21:10:46 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -81,7 +81,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.150 1998/09/29 23:45:25 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.151 1998/10/06 21:10:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1179,6 +1179,12 @@ cpu_startup()
*/
bufinit();
/*
* Set up the HWPCB so that it's safe to configure secondary
* CPUs.
*/
hwrpb_primary_init();
/*
* Configure the system.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: prom.c,v 1.28 1998/09/24 21:18:13 thorpej Exp $ */
/* $NetBSD: prom.c,v 1.29 1998/10/06 21:10:46 thorpej Exp $ */
/*
* Copyright (c) 1992, 1994, 1995, 1996 Carnegie Mellon University
@ -27,7 +27,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.28 1998/09/24 21:18:13 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.29 1998/10/06 21:10:46 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -293,6 +293,21 @@ hwrpb_checksum()
return (sum);
}
void
hwrpb_primary_init()
{
struct pcs *p;
p = LOCATE_PCS(hwrpb, hwrpb->rpb_primary_cpu_id);
/* Initialize the primary's HWPCB and the Virtual Page Table Base. */
bcopy(&proc0.p_addr->u_pcb.pcb_hw, p->pcs_hwpcb,
sizeof proc0.p_addr->u_pcb.pcb_hw);
hwrpb->rpb_vptb = VPTBASE;
hwrpb->rpb_checksum = hwrpb_checksum();
}
void
hwrpb_restart_setup()
{
@ -302,10 +317,6 @@ hwrpb_restart_setup()
p = LOCATE_PCS(hwrpb, hwrpb->rpb_primary_cpu_id);
p->pcs_flags &= ~PCS_BIP;
bcopy(&proc0.p_addr->u_pcb.pcb_hw, p->pcs_hwpcb,
sizeof proc0.p_addr->u_pcb.pcb_hw);
hwrpb->rpb_vptb = VPTBASE;
/* when 'c'ontinuing from console halt, do a dump */
hwrpb->rpb_rest_term = (u_int64_t)&XentRestart;
hwrpb->rpb_rest_term_val = 0x1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: prom.h,v 1.9 1998/09/24 21:18:13 thorpej Exp $ */
/* $NetBSD: prom.h,v 1.10 1998/10/06 21:10:46 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -55,6 +55,7 @@ void putchar __P((int));
void prom_halt __P((int)) __attribute__((__noreturn__));
int prom_getenv __P((int, char *, int));
void hwrpb_primary_init __P((void));
void hwrpb_restart_setup __P((void));
#endif