From fb79192cce2b536913cbaeba392acf00eb222e2c Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 10 Jul 2003 01:02:59 +0000 Subject: unifdef -DLAZY_SWITCH and start to tidy up the associated glue. --- sys/i386/i386/apic_vector.s | 4 ---- sys/i386/i386/mp_machdep.c | 3 --- sys/i386/i386/mptable.c | 3 --- sys/i386/i386/pmap.c | 9 ++------- sys/i386/i386/swtch.s | 3 --- sys/i386/include/mptable.h | 3 --- sys/i386/isa/apic_vector.s | 4 ---- 7 files changed, 2 insertions(+), 27 deletions(-) (limited to 'sys/i386') diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s index 9230caf..bb0055f 100644 --- a/sys/i386/i386/apic_vector.s +++ b/sys/i386/i386/apic_vector.s @@ -3,8 +3,6 @@ * $FreeBSD$ */ -#include "opt_swtch.h" - #include #include @@ -643,7 +641,6 @@ IDTVEC(rendezvous) POP_FRAME iret -#ifdef LAZY_SWITCH /* * Clean up when we lose out on the lazy context switch optimization. * ie: when we are about to release a PTD but a cpu is still borrowing it. @@ -662,7 +659,6 @@ IDTVEC(lazypmap) movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */ POP_FRAME iret -#endif #endif /* SMP */ .data diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 9701476..c212ca7 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_kstack_pages.h" -#include "opt_swtch.h" #ifdef SMP #include @@ -644,11 +643,9 @@ mp_enable(u_int boot_addr) setidt(XSTATCLOCK_OFFSET, Xstatclock, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); -#ifdef LAZY_SWITCH /* install an inter-CPU IPI for lazy pmap release */ setidt(XLAZYPMAP_OFFSET, Xlazypmap, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); -#endif /* install an inter-CPU IPI for all-CPU rendezvous */ setidt(XRENDEZVOUS_OFFSET, Xrendezvous, diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index 9701476..c212ca7 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_kstack_pages.h" -#include "opt_swtch.h" #ifdef SMP #include @@ -644,11 +643,9 @@ mp_enable(u_int boot_addr) setidt(XSTATCLOCK_OFFSET, Xstatclock, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); -#ifdef LAZY_SWITCH /* install an inter-CPU IPI for lazy pmap release */ setidt(XLAZYPMAP_OFFSET, Xlazypmap, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); -#endif /* install an inter-CPU IPI for all-CPU rendezvous */ setidt(XRENDEZVOUS_OFFSET, Xrendezvous, diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index a819da2..6edd0e0 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -104,7 +104,6 @@ __FBSDID("$FreeBSD$"); #include "opt_pmap.h" #include "opt_msgbuf.h" #include "opt_kstack_pages.h" -#include "opt_swtch.h" #include #include @@ -187,7 +186,7 @@ struct pmap kernel_pmap_store; LIST_HEAD(pmaplist, pmap); static struct pmaplist allpmaps; static struct mtx allpmaps_lock; -#if defined(SMP) && defined(LAZY_SWITCH) +#ifdef SMP static struct mtx lazypmap_lock; #endif @@ -340,7 +339,7 @@ pmap_bootstrap(firstaddr, loadaddr) kernel_pmap->pm_active = -1; /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvlist); LIST_INIT(&allpmaps); -#if defined(SMP) && defined(LAZY_SWITCH) +#ifdef SMP mtx_init(&lazypmap_lock, "lazypmap", NULL, MTX_SPIN); #endif mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN); @@ -1285,7 +1284,6 @@ pmap_allocpte(pmap_t pmap, vm_offset_t va) * Pmap allocation/deallocation routines. ***************************************************/ -#ifdef LAZY_SWITCH #ifdef SMP /* * Deal with a SMP shootdown of other users of the pmap that we are @@ -1374,7 +1372,6 @@ pmap_lazyfix(pmap_t pmap) } } #endif /* SMP */ -#endif /* LAZY_SWITCH */ /* * Release any resources held by the given physical map. @@ -1397,9 +1394,7 @@ pmap_release(pmap_t pmap) ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); -#ifdef LAZY_SWITCH pmap_lazyfix(pmap); -#endif mtx_lock_spin(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); mtx_unlock_spin(&allpmaps_lock); diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s index b0a0574..7cbe7a3 100644 --- a/sys/i386/i386/swtch.s +++ b/sys/i386/i386/swtch.s @@ -37,7 +37,6 @@ */ #include "opt_npx.h" -#include "opt_swtch.h" #include @@ -162,14 +161,12 @@ ENTRY(cpu_switch) /* switch address space */ movl PCB_CR3(%edx),%eax -#ifdef LAZY_SWITCH #ifdef PAE cmpl %eax,IdlePDPT /* Kernel address space? */ #else cmpl %eax,IdlePTD /* Kernel address space? */ #endif je sw1 -#endif movl %cr3,%ebx /* The same address space? */ cmpl %ebx,%eax je sw1 diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index 9701476..c212ca7 100644 --- a/sys/i386/include/mptable.h +++ b/sys/i386/include/mptable.h @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_kstack_pages.h" -#include "opt_swtch.h" #ifdef SMP #include @@ -644,11 +643,9 @@ mp_enable(u_int boot_addr) setidt(XSTATCLOCK_OFFSET, Xstatclock, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); -#ifdef LAZY_SWITCH /* install an inter-CPU IPI for lazy pmap release */ setidt(XLAZYPMAP_OFFSET, Xlazypmap, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); -#endif /* install an inter-CPU IPI for all-CPU rendezvous */ setidt(XRENDEZVOUS_OFFSET, Xrendezvous, diff --git a/sys/i386/isa/apic_vector.s b/sys/i386/isa/apic_vector.s index 9230caf..bb0055f 100644 --- a/sys/i386/isa/apic_vector.s +++ b/sys/i386/isa/apic_vector.s @@ -3,8 +3,6 @@ * $FreeBSD$ */ -#include "opt_swtch.h" - #include #include @@ -643,7 +641,6 @@ IDTVEC(rendezvous) POP_FRAME iret -#ifdef LAZY_SWITCH /* * Clean up when we lose out on the lazy context switch optimization. * ie: when we are about to release a PTD but a cpu is still borrowing it. @@ -662,7 +659,6 @@ IDTVEC(lazypmap) movl $0, lapic+LA_EOI /* End Of Interrupt to APIC */ POP_FRAME iret -#endif #endif /* SMP */ .data -- cgit v1.1