patch-2.1.100 linux/arch/i386/kernel/smp.c

Next file: linux/arch/i386/kernel/trampoline.S
Previous file: linux/arch/i386/kernel/ptrace.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
@@ -439,6 +439,8 @@
 				{
 					unsigned long cfg;
 
+					/* local APIC has default address */
+					mp_lapic_addr = 0xFEE00000;
 					/*
 					 *	We need to know what the local
 					 *	APIC id of the boot CPU is!
@@ -627,20 +629,29 @@
 	smp_commenced=1;
 }
 
+__initfunc(void enable_local_APIC(void))
+{
+	unsigned long value;
+
+ 	value = apic_read(APIC_SPIV);
+ 	value |= (1<<8);		/* Enable APIC (bit==1) */
+ 	value &= ~(1<<9);		/* Enable focus processor (bit==0) */
+ 	apic_write(APIC_SPIV,value);
+
+	udelay(100);			/* B safe */
+}
+
 __initfunc(void smp_callin(void))
 {
 	extern void calibrate_delay(void);
 	int cpuid=GET_APIC_ID(apic_read(APIC_ID));
-	unsigned long l;
 
 	/*
 	 *	Activate our APIC
 	 */
 	
 	SMP_PRINTK(("CALLIN %d %d\n",hard_smp_processor_id(), smp_processor_id()));
- 	l=apic_read(APIC_SPIV);
- 	l|=(1<<8);		/* Enable */
- 	apic_write(APIC_SPIV,l);
+	enable_local_APIC();
 
 	/*
 	 * Set up our APIC timer.
@@ -1004,15 +1015,7 @@
 	}
 #endif
 
-	/*
-	 *	Enable the local APIC
-	 */
-
-	cfg=apic_read(APIC_SPIV);
-	cfg|=(1<<8);		/* Enable APIC */
-	apic_write(APIC_SPIV,cfg);
-
-	udelay(10);
+	enable_local_APIC();
 
 	/*
 	 * Set up our local APIC timer:
@@ -1561,7 +1564,7 @@
  * APIC double write bug.
  */
 
-#define APIC_DIVISOR 16
+#define APIC_DIVISOR 1
 
 void setup_APIC_timer (unsigned int clocks)
 {
@@ -1585,7 +1588,7 @@
 	 */
 	tmp_value = apic_read(APIC_TDCR);
 	apic_write(APIC_TDCR , (tmp_value & ~APIC_TDR_DIV_1 )
-				 | APIC_TDR_DIV_16);
+				 | APIC_TDR_DIV_1);
 
 	tmp_value = apic_read(APIC_TMICT);
 	apic_write(APIC_TMICT, clocks/APIC_DIVISOR);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov