svn commit: r241371 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 sparc64/include sparc64/sparc64 x86/x86

Attilio Rao attilio at FreeBSD.org
Tue Oct 9 12:22:44 UTC 2012


Author: attilio
Date: Tue Oct  9 12:22:43 2012
New Revision: 241371
URL: http://svn.freebsd.org/changeset/base/241371

Log:
  Reverts r234074,234105,234564,234723,234989,235231-235232 and part of
  r234247.
  Use, instead, the static intializer introduced in r239923 for x86 and
  sparc64 intr_cpus, unwinding the code to the initial version.
  
  Reviewed by:	marius

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/include/intr_machdep.h
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/include/intr_machdep.h
  head/sys/pc98/pc98/machdep.c
  head/sys/sparc64/include/intr_machdep.h
  head/sys/sparc64/sparc64/intr_machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/x86/x86/intr_machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/amd64/amd64/machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -298,11 +298,6 @@ cpu_startup(dummy)
 	vm_pager_bufferinit();
 
 	cpu_setregs();
-
-	/*
-	 * Add BSP as an interrupt target.
-	 */
-	intr_add_cpu(0);
 }
 
 /*

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/amd64/amd64/mp_machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -784,6 +784,8 @@ init_secondary(void)
  * We tell the I/O APIC code about all the CPUs we want to receive
  * interrupts.  If we don't want certain CPUs to receive IRQs we
  * can simply not tell the I/O APIC code about them in this function.
+ * We also do not tell it about the BSP since it tells itself about
+ * the BSP internally to work with UP kernels and on UP machines.
  */
 static void
 set_interrupt_apic_ids(void)
@@ -794,6 +796,8 @@ set_interrupt_apic_ids(void)
 		apic_id = cpu_apic_ids[i];
 		if (apic_id == -1)
 			continue;
+		if (cpu_info[apic_id].cpu_bsp)
+			continue;
 		if (cpu_info[apic_id].cpu_disabled)
 			continue;
 

Modified: head/sys/amd64/include/intr_machdep.h
==============================================================================
--- head/sys/amd64/include/intr_machdep.h	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/amd64/include/intr_machdep.h	Tue Oct  9 12:22:43 2012	(r241371)
@@ -140,7 +140,9 @@ int	elcr_probe(void);
 enum intr_trigger elcr_read_trigger(u_int irq);
 void	elcr_resume(void);
 void	elcr_write_trigger(u_int irq, enum intr_trigger trigger);
+#ifdef SMP
 void	intr_add_cpu(u_int cpu);
+#endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter, 
 			 driver_intr_t handler, void *arg, enum intr_type flags, 
 			 void **cookiep);    

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/i386/i386/machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -338,11 +338,6 @@ cpu_startup(dummy)
 #ifndef XEN
 	cpu_setregs();
 #endif
-
-	/*
-	 * Add BSP as an interrupt target.
-	 */
-	intr_add_cpu(0);
 }
 
 /*

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/i386/i386/mp_machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -823,6 +823,8 @@ init_secondary(void)
  * We tell the I/O APIC code about all the CPUs we want to receive
  * interrupts.  If we don't want certain CPUs to receive IRQs we
  * can simply not tell the I/O APIC code about them in this function.
+ * We also do not tell it about the BSP since it tells itself about
+ * the BSP internally to work with UP kernels and on UP machines.
  */
 static void
 set_interrupt_apic_ids(void)
@@ -833,6 +835,8 @@ set_interrupt_apic_ids(void)
 		apic_id = cpu_apic_ids[i];
 		if (apic_id == -1)
 			continue;
+		if (cpu_info[apic_id].cpu_bsp)
+			continue;
 		if (cpu_info[apic_id].cpu_disabled)
 			continue;
 

Modified: head/sys/i386/include/intr_machdep.h
==============================================================================
--- head/sys/i386/include/intr_machdep.h	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/i386/include/intr_machdep.h	Tue Oct  9 12:22:43 2012	(r241371)
@@ -131,7 +131,9 @@ int	elcr_probe(void);
 enum intr_trigger elcr_read_trigger(u_int irq);
 void	elcr_resume(void);
 void	elcr_write_trigger(u_int irq, enum intr_trigger trigger);
+#ifdef SMP
 void	intr_add_cpu(u_int cpu);
+#endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter,
     driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep);
 #ifdef SMP

Modified: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/pc98/pc98/machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -273,11 +273,6 @@ cpu_startup(dummy)
 	bufinit();
 	vm_pager_bufferinit();
 	cpu_setregs();
-
-	/*
-	 * Add BSP as an interrupt target.
-	 */
-	intr_add_cpu(0);
 }
 
 /*

Modified: head/sys/sparc64/include/intr_machdep.h
==============================================================================
--- head/sys/sparc64/include/intr_machdep.h	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/sparc64/include/intr_machdep.h	Tue Oct  9 12:22:43 2012	(r241371)
@@ -91,10 +91,10 @@ struct intr_vector {
 extern ih_func_t *intr_handlers[];
 extern struct intr_vector intr_vectors[];
 
-void	intr_add_cpu(u_int cpu);
 #ifdef SMP
-int	intr_bind(int vec, u_char cpu);
+void	intr_add_cpu(u_int cpu);
 #endif
+int	intr_bind(int vec, u_char cpu);
 int	intr_describe(int vec, void *ih, const char *descr);
 void	intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf,
 	    void *iva);

Modified: head/sys/sparc64/sparc64/intr_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/intr_machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/sparc64/sparc64/intr_machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -456,7 +456,7 @@ intr_describe(int vec, void *ih, const c
  * allocate CPUs round-robin.
  */
 
-static cpuset_t intr_cpus;
+static cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
 static int current_cpu;
 
 static void
@@ -554,11 +554,4 @@ intr_shuffle_irqs(void *arg __unused)
 }
 SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs,
     NULL);
-#else /* !SMP */
-/* Use an empty stub for compatibility. */
-void
-intr_add_cpu(u_int cpu __unused)
-{
-
-}
 #endif

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/sparc64/sparc64/machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -196,11 +196,6 @@ cpu_startup(void *arg)
 		printf("machine: %s\n", sparc64_model);
 
 	cpu_identify(rdpr(ver), PCPU_GET(clock), curcpu);
-
-	/*
-	 * Add BSP as an interrupt target.
-	 */
-	intr_add_cpu(0);
 }
 
 void

Modified: head/sys/x86/x86/intr_machdep.c
==============================================================================
--- head/sys/x86/x86/intr_machdep.c	Tue Oct  9 08:27:40 2012	(r241370)
+++ head/sys/x86/x86/intr_machdep.c	Tue Oct  9 12:22:43 2012	(r241371)
@@ -452,7 +452,7 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
  * allocate CPUs round-robin.
  */
 
-static cpuset_t intr_cpus;
+static cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
 static int current_cpu;
 
 /*
@@ -565,11 +565,4 @@ intr_next_cpu(void)
 
 	return (PCPU_GET(apic_id));
 }
-
-/* Use an empty stub for compatibility. */
-void
-intr_add_cpu(u_int cpu __unused)
-{
-
-}
 #endif


More information about the svn-src-all mailing list