diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/autoconf.c | 5 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 20 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 3 |
3 files changed, 19 insertions, 9 deletions
diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c index 13657604bc4..16c7f3423fe 100644 --- a/sys/arch/i386/i386/autoconf.c +++ b/sys/arch/i386/i386/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.33 2000/08/17 20:15:39 mickey Exp $ */ +/* $OpenBSD: autoconf.c,v 1.34 2001/04/30 13:23:11 art Exp $ */ /* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */ /*- @@ -100,6 +100,9 @@ configure() */ md_diskconf = diskconf; cold = 0; + + /* Set up proc0's TSS and LDT (after the FPU is configured). */ + i386_proc0_tss_ldt_init(); } /* diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 500f07d7805..4789b130ba3 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.155 2001/04/09 07:14:15 tholo Exp $ */ +/* $OpenBSD: machdep.c,v 1.156 2001/04/30 13:23:11 art Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -361,8 +361,6 @@ cpu_startup() caddr_t v; int sz; vm_offset_t minaddr, maxaddr, pa; - struct pcb *pcb; - int x; /* * Initialize error message buffer (at end of core). @@ -472,10 +470,18 @@ cpu_startup() } ioport_malloc_safe = 1; configure(); +} - /* - * Set up proc0's TSS and LDT. - */ +/* + * Set up proc0's TSS and LDT. + */ +void +i386_proc0_tss_ldt_init() +{ + struct pcb *pcb; + int x; + + gdt_init(); curpcb = pcb = &proc0.p_addr->u_pcb; pcb->pcb_flags = 0; pcb->pcb_tss.tss_ioopt = @@ -484,7 +490,7 @@ cpu_startup() pcb->pcb_iomap[x] = 0xffffffff; pcb->pcb_iomap_pad = 0xff; - pcb->pcb_ldt_sel = GSEL(GLDT_SEL, SEL_KPL); + pcb->pcb_ldt_sel = pmap_kernel()->pm_ldt_sel = GSEL(GLDT_SEL, SEL_KPL); pcb->pcb_cr0 = rcr0(); pcb->pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL); pcb->pcb_tss.tss_esp0 = (int)proc0.p_addr + USPACE - 16; diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 6476366c944..17d31917151 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.34 2001/02/19 04:57:02 ho Exp $ */ +/* $OpenBSD: cpu.h,v 1.35 2001/04/30 13:23:11 art Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -184,6 +184,7 @@ void dkcsumattach __P((void)); void delay __P((int)); void dumpconf __P((void)); void cpu_reset __P((void)); +void i386_proc0_tss_ldt_init __P((void)); /* locore.s */ struct region_descriptor; |