From 8c800ec582517905069e92bf0cfd91861baaca19 Mon Sep 17 00:00:00 2001 From: davidxu Date: Tue, 19 Apr 2005 13:15:52 +0000 Subject: [PATCH] Use critical section functions rather than scheduler lock to protect critical region. --- sys/i386/i386/sys_machdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 21590439fd6e..137674fb791b 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -171,11 +171,11 @@ sysarch(td, uap) sd.sd_xx = 0; sd.sd_def32 = 1; sd.sd_gran = 1; - mtx_lock_spin(&sched_lock); + critical_enter(); td->td_pcb->pcb_fsd = sd; PCPU_GET(fsgs_gdt)[0] = sd; td->td_frame->tf_fs = GSEL(GUFS_SEL, SEL_UPL); - mtx_unlock_spin(&sched_lock); + critical_exit(); } break; case I386_GET_GSBASE: @@ -201,11 +201,11 @@ sysarch(td, uap) sd.sd_xx = 0; sd.sd_def32 = 1; sd.sd_gran = 1; - mtx_lock_spin(&sched_lock); + critical_enter(); td->td_pcb->pcb_gsd = sd; PCPU_GET(fsgs_gdt)[1] = sd; + critical_exit(); load_gs(GSEL(GUGS_SEL, SEL_UPL)); - mtx_unlock_spin(&sched_lock); } break; default: