diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-12-26 00:07:19 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-12-26 00:07:19 +0000 |
commit | b1b4f02f9487dee83b1575efa833c8dadb2cc2a3 (patch) | |
tree | b7bf4f20cab66ba2a3a441b5a29d43f7c995d6a1 /sys/i386 | |
parent | 88140ea8c36c7dfff34f3256cfa57d1b9217be77 (diff) | |
download | FreeBSD-src-b1b4f02f9487dee83b1575efa833c8dadb2cc2a3.zip FreeBSD-src-b1b4f02f9487dee83b1575efa833c8dadb2cc2a3.tar.gz |
Move global variable private_tss into per-cpu area.
Reviewed by: jhb
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/genassym.c | 1 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/swtch.s | 7 | ||||
-rw-r--r-- | sys/i386/i386/sys_machdep.c | 6 | ||||
-rw-r--r-- | sys/i386/include/pcpu.h | 3 |
5 files changed, 10 insertions, 10 deletions
diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c index 0cb371c..d7df503 100644 --- a/sys/i386/i386/genassym.c +++ b/sys/i386/i386/genassym.c @@ -198,6 +198,7 @@ ASSYM(PC_FSGS_GDT, offsetof(struct pcpu, pc_fsgs_gdt)); ASSYM(PC_CURRENTLDT, offsetof(struct pcpu, pc_currentldt)); ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); +ASSYM(PC_PRIVATE_TSS, offsetof(struct pcpu, pc_private_tss)); #ifdef DEV_APIC ASSYM(LA_VER, offsetof(struct LAPIC, version)); diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 19eba7c..18e30f8 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1285,8 +1285,6 @@ struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */ union descriptor ldt[NLDT]; /* local descriptor table */ struct region_descriptor r_gdt, r_idt; /* table descriptors */ -int private_tss; /* flag indicating private tss */ - #if defined(I586_CPU) && !defined(NO_F00F_HACK) extern int has_f00f_bug; #endif @@ -2241,7 +2239,6 @@ init386(first) KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - private_tss = 0; PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s index 9f03440..5d3f4a3 100644 --- a/sys/i386/i386/swtch.s +++ b/sys/i386/i386/swtch.s @@ -197,7 +197,7 @@ sw1: */ cmpl $0, PCB_EXT(%edx) /* has pcb extension? */ je 1f /* If not, use the default */ - btsl %esi, private_tss /* mark use of private tss */ + movl $1, PCPU(PRIVATE_TSS) /* mark use of private tss */ movl PCB_EXT(%edx), %edi /* new tss descriptor */ jmp 2f /* Load it up */ @@ -213,8 +213,9 @@ sw1: * Test this CPU's bit in the bitmap to see if this * CPU was using a private TSS. */ - btrl %esi, private_tss /* Already using the common? */ - jae 3f /* if so, skip reloading */ + cmpl $0, PCPU(PRIVATE_TSS) /* Already using the common? */ + je 3f /* if so, skip reloading */ + movl $0, PCPU(PRIVATE_TSS) PCPU_ADDR(COMMON_TSSD, %edi) 2: /* Move correct tss descriptor into GDT slot, then reload tr. */ diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 23e8144..d177b99 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -267,12 +267,12 @@ i386_extend_pcb(struct thread *td) KASSERT(td->td_pcb->pcb_ext == 0, ("already have a TSS!")); /* Switch to the new TSS. */ - mtx_lock_spin(&sched_lock); + critical_enter(); td->td_pcb->pcb_ext = ext; - private_tss |= PCPU_GET(cpumask); + PCPU_SET(private_tss, 1); *PCPU_GET(tss_gdt) = ext->ext_tssd; ltr(GSEL(GPROC0_SEL, SEL_KPL)); - mtx_unlock_spin(&sched_lock); + critical_exit(); return 0; } diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index 6312b97..78621a8 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -54,7 +54,8 @@ struct segment_descriptor *pc_fsgs_gdt; \ int pc_currentldt; \ u_int pc_acpi_id; \ - u_int pc_apic_id + u_int pc_apic_id; \ + int pc_private_tss /* flag indicating private tss */ #if defined(lint) |