diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index e77456472d73..4e4ca01c892d 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -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 /* 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 #include @@ -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. */ diff --git a/sys/arch/alpha/alpha/prom.c b/sys/arch/alpha/alpha/prom.c index 9ad7888daea3..59d65af8ff85 100644 --- a/sys/arch/alpha/alpha/prom.c +++ b/sys/arch/alpha/alpha/prom.c @@ -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 /* 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 #include @@ -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; diff --git a/sys/arch/alpha/include/prom.h b/sys/arch/alpha/include/prom.h index 6182a69d2bfc..45014be3daaf 100644 --- a/sys/arch/alpha/include/prom.h +++ b/sys/arch/alpha/include/prom.h @@ -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