- Consolidate some pre-main initialization into an hp300_init() function.

- Initialize the message buffer earlier, in hp300_init(), rather than in
  cpu_startup(), so that it's initialized before main() is called.
This commit is contained in:
thorpej 1997-10-12 18:47:51 +00:00
parent c3637caf77
commit 4dd0bf9d01

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.99 1997/10/05 02:15:48 carrel Exp $ */
/* $NetBSD: machdep.c,v 1.100 1997/10/12 18:47:51 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -156,6 +156,7 @@ void cpu_init_kcore_hdr __P((void));
/* functions called from locore.s */
void dumpsys __P((void));
void hp300_init __P((void));
void straytrap __P((int, u_short));
void nmihand __P((struct frame));
@ -183,6 +184,30 @@ int conforced; /* console has been forced */
int cpuspeed; /* relative cpu speed; XXX skewed on 68040 */
int delay_divisor; /* delay constant */
/*
* Early initialization, before main() is called.
*/
void
hp300_init()
{
int i;
/* Initialize the interrupt handlers. */
intr_init();
/* Calibrate the delay loop. */
hp300_calibrate_delay();
/*
* Initialize error message buffer (at end of core).
* avail_end was pre-decremented in pmap_bootstrap to compensate.
*/
for (i = 0; i < btoc(MSGBUFSIZE); i++)
pmap_enter(pmap_kernel(), (vm_offset_t)msgbufaddr + i * NBPG,
avail_end + i * NBPG, VM_PROT_ALL, TRUE);
initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE));
}
/*
* Console initialization: called early on from main,
* before vm init or startup. Do enough configuration
@ -245,15 +270,6 @@ cpu_startup()
*/
cpu_init_kcore_hdr();
/*
* Initialize error message buffer (at end of core).
* avail_end was pre-decremented in pmap_bootstrap to compensate.
*/
for (i = 0; i < btoc(MSGBUFSIZE); i++)
pmap_enter(pmap_kernel(), (vm_offset_t)msgbufaddr + i * NBPG,
avail_end + i * NBPG, VM_PROT_ALL, TRUE);
initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE));
/*
* Good {morning,afternoon,evening,night}.
*/