diff options
author | kato <kato@FreeBSD.org> | 2000-09-07 13:35:44 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 2000-09-07 13:35:44 +0000 |
commit | 06674277f3ff06a552adbe5f4095448e58383796 (patch) | |
tree | 7933c06dff2ad77cc6159081bf3fc67cb98ba6d5 /sys/pc98 | |
parent | 5413a4bd485f95ab89c7e60faaa2c0ab257e68ef (diff) | |
download | FreeBSD-src-06674277f3ff06a552adbe5f4095448e58383796.zip FreeBSD-src-06674277f3ff06a552adbe5f4095448e58383796.tar.gz |
Merged from sys/i386/i386/machdep.c revision 1.406.
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/i386/machdep.c | 37 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 37 |
2 files changed, 54 insertions, 20 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 1a520ee..85b1ff9 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -59,6 +59,7 @@ #include <sys/sysproto.h> #include <sys/signalvar.h> #include <sys/kernel.h> +#include <sys/ktr.h> #include <sys/linker.h> #include <sys/malloc.h> #include <sys/proc.h> @@ -99,10 +100,12 @@ #include <machine/bootinfo.h> #include <machine/ipl.h> #include <machine/md_var.h> +#include <machine/mutex.h> #include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */ +#include <machine/globaldata.h> +#include <machine/globals.h> #ifdef SMP #include <machine/smp.h> -#include <machine/globaldata.h> #endif #ifdef PERFMON #include <machine/perfmon.h> @@ -111,6 +114,7 @@ #ifdef OLD_BUS_ARCH #include <i386/isa/isa_device.h> #endif +#include <i386/isa/icu.h> #include <i386/isa/intr_machdep.h> #ifdef PC98 #include <pc98/pc98/pc98_machdep.h> @@ -261,6 +265,11 @@ vm_offset_t clean_sva, clean_eva; static vm_offset_t pager_sva, pager_eva; static struct trapframe proc0_tf; +struct cpuhead cpuhead; + +mtx_t sched_lock; +mtx_t Giant; + #define offsetof(type, member) ((size_t)(&((type *)0)->member)) static void @@ -445,6 +454,11 @@ again: bufinit(); vm_pager_bufferinit(); + SLIST_INIT(&cpuhead); + SLIST_INSERT_HEAD(&cpuhead, GLOBALDATA, gd_allcpu); + + mtx_init(&sched_lock, "sched lock", MTX_SPIN); + #ifdef SMP /* * OK, enough kmem_alloc/malloc state should be up, lets get on with it! @@ -2107,11 +2121,6 @@ init386(first) #endif int off; - /* - * Prevent lowering of the ipl if we call tsleep() early. - */ - safepri = cpl; - proc0.p_addr = proc0paddr; atdevbase = ISA_HOLE_START + KERNBASE; @@ -2168,6 +2177,10 @@ init386(first) r_gdt.rd_base = (int) gdt; lgdt(&r_gdt); + /* setup curproc so that mutexes work */ + PCPU_SET(curproc, &proc0); + PCPU_SET(prevproc, &proc0); + /* make ldt memory segments */ /* * The data segment limit must not cover the user area because we @@ -2250,7 +2263,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ common_tss.tss_esp0 = (int) proc0.p_addr + UPAGES*PAGE_SIZE - 16; - common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ; + common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); private_tss = 0; tss_gdt = &gdt[GPROC0_SEL].sd; @@ -2271,6 +2284,12 @@ init386(first) dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); dblfault_tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL); + /* + * We grab Giant during the vm86bios routines, so we need to ensure + * that it is up and running before we use vm86. + */ + mtx_init(&Giant, "Giant", MTX_DEF); + vm86_initialize(); getmemsize(first); @@ -2306,9 +2325,7 @@ init386(first) /* setup proc 0's pcb */ proc0.p_addr->u_pcb.pcb_flags = 0; proc0.p_addr->u_pcb.pcb_cr3 = (int)IdlePTD; -#ifdef SMP - proc0.p_addr->u_pcb.pcb_mpnest = 1; -#endif + proc0.p_addr->u_pcb.pcb_schednest = 0; proc0.p_addr->u_pcb.pcb_ext = 0; proc0.p_md.md_regs = &proc0_tf; } diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 1a520ee..85b1ff9 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -59,6 +59,7 @@ #include <sys/sysproto.h> #include <sys/signalvar.h> #include <sys/kernel.h> +#include <sys/ktr.h> #include <sys/linker.h> #include <sys/malloc.h> #include <sys/proc.h> @@ -99,10 +100,12 @@ #include <machine/bootinfo.h> #include <machine/ipl.h> #include <machine/md_var.h> +#include <machine/mutex.h> #include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */ +#include <machine/globaldata.h> +#include <machine/globals.h> #ifdef SMP #include <machine/smp.h> -#include <machine/globaldata.h> #endif #ifdef PERFMON #include <machine/perfmon.h> @@ -111,6 +114,7 @@ #ifdef OLD_BUS_ARCH #include <i386/isa/isa_device.h> #endif +#include <i386/isa/icu.h> #include <i386/isa/intr_machdep.h> #ifdef PC98 #include <pc98/pc98/pc98_machdep.h> @@ -261,6 +265,11 @@ vm_offset_t clean_sva, clean_eva; static vm_offset_t pager_sva, pager_eva; static struct trapframe proc0_tf; +struct cpuhead cpuhead; + +mtx_t sched_lock; +mtx_t Giant; + #define offsetof(type, member) ((size_t)(&((type *)0)->member)) static void @@ -445,6 +454,11 @@ again: bufinit(); vm_pager_bufferinit(); + SLIST_INIT(&cpuhead); + SLIST_INSERT_HEAD(&cpuhead, GLOBALDATA, gd_allcpu); + + mtx_init(&sched_lock, "sched lock", MTX_SPIN); + #ifdef SMP /* * OK, enough kmem_alloc/malloc state should be up, lets get on with it! @@ -2107,11 +2121,6 @@ init386(first) #endif int off; - /* - * Prevent lowering of the ipl if we call tsleep() early. - */ - safepri = cpl; - proc0.p_addr = proc0paddr; atdevbase = ISA_HOLE_START + KERNBASE; @@ -2168,6 +2177,10 @@ init386(first) r_gdt.rd_base = (int) gdt; lgdt(&r_gdt); + /* setup curproc so that mutexes work */ + PCPU_SET(curproc, &proc0); + PCPU_SET(prevproc, &proc0); + /* make ldt memory segments */ /* * The data segment limit must not cover the user area because we @@ -2250,7 +2263,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ common_tss.tss_esp0 = (int) proc0.p_addr + UPAGES*PAGE_SIZE - 16; - common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL) ; + common_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); private_tss = 0; tss_gdt = &gdt[GPROC0_SEL].sd; @@ -2271,6 +2284,12 @@ init386(first) dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL); dblfault_tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL); + /* + * We grab Giant during the vm86bios routines, so we need to ensure + * that it is up and running before we use vm86. + */ + mtx_init(&Giant, "Giant", MTX_DEF); + vm86_initialize(); getmemsize(first); @@ -2306,9 +2325,7 @@ init386(first) /* setup proc 0's pcb */ proc0.p_addr->u_pcb.pcb_flags = 0; proc0.p_addr->u_pcb.pcb_cr3 = (int)IdlePTD; -#ifdef SMP - proc0.p_addr->u_pcb.pcb_mpnest = 1; -#endif + proc0.p_addr->u_pcb.pcb_schednest = 0; proc0.p_addr->u_pcb.pcb_ext = 0; proc0.p_md.md_regs = &proc0_tf; } |