MachIntrABI: Add method to return IRQ's target CPU
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 3 Oct 2011 14:28:38 +0000 (22:28 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 3 Oct 2011 14:28:38 +0000 (22:28 +0800)
sys/platform/pc32/apic/ioapic_abi.c
sys/platform/pc32/icu/icu_abi.c
sys/platform/pc64/apic/ioapic_abi.c
sys/platform/pc64/icu/icu_abi.c
sys/platform/vkernel/platform/machintr.c
sys/platform/vkernel64/platform/machintr.c
sys/sys/machintr.h

index dbe928c..f0f66fd 100644 (file)
@@ -482,6 +482,7 @@ static void ioapic_abi_intr_setup(int, int);
 static void    ioapic_abi_intr_teardown(int);
 static void    ioapic_abi_intr_config(int,
                    enum intr_trigger, enum intr_polarity);
+static int     ioapic_abi_intr_cpuid(int);
 
 static void    ioapic_abi_finalize(void);
 static void    ioapic_abi_cleanup(void);
@@ -497,6 +498,7 @@ struct machintr_abi MachIntrABI_IOAPIC = {
        .intr_setup     = ioapic_abi_intr_setup,
        .intr_teardown  = ioapic_abi_intr_teardown,
        .intr_config    = ioapic_abi_intr_config,
+       .intr_cpuid     = ioapic_abi_intr_cpuid,
 
        .finalize       = ioapic_abi_finalize,
        .cleanup        = ioapic_abi_cleanup,
@@ -910,3 +912,10 @@ ioapic_abi_extint_irqmap(int irq)
 
        return 0;
 }
+
+static int
+ioapic_abi_intr_cpuid(int irq __unused)
+{
+       /* TODO */
+       return 0;
+}
index abdce01..fdc375f 100644 (file)
@@ -99,6 +99,7 @@ extern int    imcr_present;
 static void    icu_abi_intr_setup(int, int);
 static void    icu_abi_intr_teardown(int);
 static void    icu_abi_intr_config(int, enum intr_trigger, enum intr_polarity);
+static int     icu_abi_intr_cpuid(int);
 
 static void    icu_abi_finalize(void);
 static void    icu_abi_cleanup(void);
@@ -114,6 +115,7 @@ struct machintr_abi MachIntrABI_ICU = {
        .intr_setup     = icu_abi_intr_setup,
        .intr_teardown  = icu_abi_intr_teardown,
        .intr_config    = icu_abi_intr_config,
+       .intr_cpuid     = icu_abi_intr_cpuid,
 
        .finalize       = icu_abi_finalize,
        .cleanup        = icu_abi_cleanup,
@@ -275,3 +277,9 @@ icu_abi_intr_config(int irq, enum intr_trigger trig,
        }
        elcr_write_trigger(irq, map->im_trig);
 }
+
+static int
+icu_abi_intr_cpuid(int irq __unused)
+{
+       return 0;
+}
index b7bbee6..2798911 100644 (file)
@@ -482,6 +482,7 @@ static void ioapic_abi_intr_setup(int, int);
 static void    ioapic_abi_intr_teardown(int);
 static void    ioapic_abi_intr_config(int,
                    enum intr_trigger, enum intr_polarity);
+static int     ioapic_abi_intr_cpuid(int);
 
 static void    ioapic_abi_finalize(void);
 static void    ioapic_abi_cleanup(void);
@@ -496,6 +497,7 @@ struct machintr_abi MachIntrABI_IOAPIC = {
        .intr_setup     = ioapic_abi_intr_setup,
        .intr_teardown  = ioapic_abi_intr_teardown,
        .intr_config    = ioapic_abi_intr_config,
+       .intr_cpuid     = ioapic_abi_intr_cpuid,
 
        .finalize       = ioapic_abi_finalize,
        .cleanup        = ioapic_abi_cleanup,
@@ -907,3 +909,10 @@ ioapic_abi_extint_irqmap(int irq)
 
        return 0;
 }
+
+static int
+ioapic_abi_intr_cpuid(int irq __unused)
+{
+       /* TODO */
+       return 0;
+}
index edb7321..defa319 100644 (file)
@@ -99,6 +99,7 @@ extern int    imcr_present;
 static void    icu_abi_intr_setup(int, int);
 static void    icu_abi_intr_teardown(int);
 static void    icu_abi_intr_config(int, enum intr_trigger, enum intr_polarity);
+static int     icu_abi_intr_cpuid(int);
 
 static void    icu_abi_finalize(void);
 static void    icu_abi_cleanup(void);
@@ -113,6 +114,7 @@ struct machintr_abi MachIntrABI_ICU = {
        .intr_setup     = icu_abi_intr_setup,
        .intr_teardown  = icu_abi_intr_teardown,
        .intr_config    = icu_abi_intr_config,
+       .intr_cpuid     = icu_abi_intr_cpuid,
 
        .finalize       = icu_abi_finalize,
        .cleanup        = icu_abi_cleanup,
@@ -272,3 +274,9 @@ icu_abi_intr_config(int irq, enum intr_trigger trig,
        }
        elcr_write_trigger(irq, map->im_trig);
 }
+
+static int
+icu_abi_intr_cpuid(int irq __unused)
+{
+       return 0;
+}
index 3f25432..c3cffde 100644 (file)
@@ -56,6 +56,7 @@ static void dummy_intr_disable(int);
 static void dummy_intr_enable(int);
 static void dummy_intr_setup(int, int);
 static void dummy_intr_teardown(int);
+static int dummy_intr_cpuid(int);
 static void dummy_finalize(void);
 static void dummy_intrcleanup(void);
 static void dummy_stabilize(void);
@@ -66,6 +67,7 @@ struct machintr_abi MachIntrABI = {
        .intr_enable =  dummy_intr_enable,
        .intr_setup =   dummy_intr_setup,
        .intr_teardown = dummy_intr_teardown,
+       .intr_cpuid = dummy_intr_cpuid,
 
        .finalize =     dummy_finalize,
        .cleanup =      dummy_intrcleanup,
@@ -107,6 +109,12 @@ dummy_stabilize(void)
 {
 }
 
+static int
+dummy_intr_cpuid(int irq __unused)
+{
+       return 0;
+}
+
 /*
  * Process pending interrupts
  */
index 7493e29..f12e975 100644 (file)
@@ -56,6 +56,7 @@ static void dummy_intr_disable(int);
 static void dummy_intr_enable(int);
 static void dummy_intr_setup(int, int);
 static void dummy_intr_teardown(int);
+static int dummy_intr_cpuid(int);
 static void dummy_finalize(void);
 static void dummy_intrcleanup(void);
 static void dummy_stabilize(void);
@@ -66,6 +67,7 @@ struct machintr_abi MachIntrABI = {
        .intr_enable =  dummy_intr_enable,
        .intr_setup =   dummy_intr_setup,
        .intr_teardown = dummy_intr_teardown,
+       .intr_cpuid = dummy_intr_cpuid,
 
        .finalize =     dummy_finalize,
        .cleanup =      dummy_intrcleanup,
@@ -107,6 +109,12 @@ dummy_stabilize(void)
 {
 }
 
+static int
+dummy_intr_cpuid(int irq __unused)
+{
+       return 0;
+}
+
 /*
  * Process pending interrupts
  */
index a927911..0119272 100644 (file)
@@ -64,6 +64,7 @@ struct machintr_abi {
     void       (*intr_teardown)(int);          /* tear down intr */
     void       (*intr_config)                  /* config intr */
                (int, enum intr_trigger, enum intr_polarity);
+    int                (*intr_cpuid)(int);             /* intr target cpu */
 
     void       (*finalize)(void);              /* final before ints enabled */
     void       (*cleanup)(void);               /* cleanup */
@@ -81,6 +82,7 @@ struct machintr_abi {
 
 #define machintr_intr_config(intr, trig, pola) \
            MachIntrABI.intr_config((intr), (trig), (pola))
+#define machintr_intr_cpuid(intr)      MachIntrABI.intr_cpuid((intr))
 
 extern struct machintr_abi MachIntrABI;