From 2f832df90cd6eb2ef3b73d39fb4f29859b112113 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 1 Apr 1999 00:37:50 +0000 Subject: [PATCH] Do proc0's TSS and LDT initialization at the end of configure() (i.e. once the FPU has been attached). --- sys/arch/i386/i386/autoconf.c | 5 ++++- sys/arch/i386/i386/machdep.c | 20 ++++++++++++-------- sys/arch/i386/include/cpu.h | 3 ++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c index a8711b0e51fa..e0e57401538f 100644 --- a/sys/arch/i386/i386/autoconf.c +++ b/sys/arch/i386/i386/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.36 1999/03/28 19:55:51 fvdl Exp $ */ +/* $NetBSD: autoconf.c,v 1.37 1999/04/01 00:37:50 thorpej Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -107,6 +107,9 @@ configure() spl0(); cold = 0; + /* Set up proc0's TSS and LDT (after the FPU is configured). */ + i386_proc0_tss_ldt_init(); + /* XXX Finish deferred buffer cache allocation. */ i386_bufinit(); } diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 8e5f2f9243dd..46eca11138ed 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.348 1999/04/01 00:17:47 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.349 1999/04/01 00:37:50 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -391,11 +391,9 @@ cpu_startup() { unsigned i; caddr_t v; - int sz; + int sz, x; vaddr_t minaddr, maxaddr; vsize_t size; - struct pcb *pcb; - int x; #if NBIOSCALL > 0 extern int biostramp_image_size; extern u_char biostramp_image[]; @@ -533,10 +531,17 @@ cpu_startup() /* Safe for i/o port allocation to use malloc now. */ ioport_malloc_safe = 1; +} + +/* + * Set up proc0's TSS and LDT. + */ +void +i386_proc0_tss_ldt_init() +{ + struct pcb *pcb; + int x; - /* - * Set up proc0's TSS and LDT. - */ gdt_init(); curpcb = pcb = &proc0.p_addr->u_pcb; pcb->pcb_flags = 0; @@ -555,7 +560,6 @@ cpu_startup() lldt(pcb->pcb_ldt_sel); proc0.p_md.md_regs = (struct trapframe *)pcb->pcb_tss.tss_esp0 - 1; - } /* diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 3cc3060dc309..dcd488290bc5 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.52 1999/03/12 01:01:42 fvdl Exp $ */ +/* $NetBSD: cpu.h,v 1.53 1999/04/01 00:37:50 thorpej Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -132,6 +132,7 @@ extern struct cpu_cpuid_nameclass i386_cpuid_cpus[]; void delay __P((int)); void dumpconf __P((void)); void cpu_reset __P((void)); +void i386_proc0_tss_ldt_init __P((void)); void i386_bufinit __P((void)); /* locore.s */