Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101987563
D35406.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D35406.diff
View Options
diff --git a/sys/x86/include/intr_machdep.h b/sys/x86/include/intr_machdep.h
--- a/sys/x86/include/intr_machdep.h
+++ b/sys/x86/include/intr_machdep.h
@@ -82,7 +82,6 @@
void (*pic_eoi_source)(struct intsrc *);
void (*pic_enable_intr)(struct intsrc *);
void (*pic_disable_intr)(struct intsrc *);
- int (*pic_vector)(struct intsrc *);
int (*pic_source_pending)(struct intsrc *);
void (*pic_suspend)(struct pic *);
void (*pic_resume)(struct pic *, bool suspend_cancelled);
@@ -148,7 +147,7 @@
u_int intr_next_cpu(int domain);
struct intsrc *intr_lookup_source(int vector);
int intr_register_pic(struct pic *pic);
-int intr_register_source(struct intsrc *isrc);
+int intr_register_source(u_int vector, struct intsrc *isrc);
int intr_remove_handler(void *cookie);
void intr_resume(bool suspend_cancelled);
void intr_suspend(void);
diff --git a/sys/x86/include/xen/arch-intr.h b/sys/x86/include/xen/arch-intr.h
--- a/sys/x86/include/xen/arch-intr.h
+++ b/sys/x86/include/xen/arch-intr.h
@@ -34,7 +34,6 @@
typedef struct {
struct intsrc intsrc; /* @TOP -> *xen_arch_isrc */
- u_int vector; /* Global isrc vector number */
} xen_arch_isrc_t;
#include <dev/xen/bus/intr-internal.h>
diff --git a/sys/x86/isa/atpic.c b/sys/x86/isa/atpic.c
--- a/sys/x86/isa/atpic.c
+++ b/sys/x86/isa/atpic.c
@@ -100,7 +100,6 @@
.pic_eoi_source = (eoi), \
.pic_enable_intr = atpic_enable_intr, \
.pic_disable_intr = atpic_disable_intr, \
- .pic_vector = atpic_vector, \
.pic_source_pending = atpic_source_pending, \
.pic_resume = atpic_resume, \
.pic_config_intr = atpic_config_intr, \
@@ -235,7 +234,7 @@
for (i = 0, ai = atintrs; i < NUM_ISA_IRQS; i++, ai++) {
if (i == ICU_SLAVEID)
continue;
- intr_register_source(&ai->at_intsrc);
+ intr_register_source(i, &ai->at_intsrc);
}
}
diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c
--- a/sys/x86/x86/intr_machdep.c
+++ b/sys/x86/x86/intr_machdep.c
@@ -216,12 +216,11 @@
* called.
*/
int
-intr_register_source(struct intsrc *isrc)
+intr_register_source(u_int vector, struct intsrc *isrc)
{
- int error, vector;
+ int error;
KASSERT(intr_pic_registered(isrc->is_pic), ("unregistered PIC"));
- vector = isrc->is_pic->pic_vector(isrc);
KASSERT(vector < num_io_irqs, ("IRQ %d too large (%u irqs)", vector,
num_io_irqs));
if (interrupt_sources[vector] != NULL)
@@ -336,7 +335,7 @@
* XXX: We assume that IRQ 0 is only used for the ISA timer
* device (clk).
*/
- vector = isrc->is_pic->pic_vector(isrc);
+ vector = isrc->is_event->ie_irq;
if (vector == 0)
clkintr_pending = 1;
@@ -436,7 +435,7 @@
is->is_index = intrcnt_index;
intrcnt_index += 2;
snprintf(straystr, sizeof(straystr), "stray irq%d",
- is->is_pic->pic_vector(is));
+ is->is_event->ie_irq);
intrcnt_updatename(is);
is->is_count = &intrcnt[is->is_index];
intrcnt_setname(straystr, is->is_index + 1);
diff --git a/sys/x86/x86/io_apic.c b/sys/x86/x86/io_apic.c
--- a/sys/x86/x86/io_apic.c
+++ b/sys/x86/x86/io_apic.c
@@ -117,7 +117,6 @@
static void ioapic_eoi_source(struct intsrc *isrc);
static void ioapic_enable_intr(struct intsrc *isrc);
static void ioapic_disable_intr(struct intsrc *isrc);
-static int ioapic_vector(struct intsrc *isrc);
static int ioapic_source_pending(struct intsrc *isrc);
static int ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
@@ -134,7 +133,6 @@
.pic_eoi_source = ioapic_eoi_source,
.pic_enable_intr = ioapic_enable_intr,
.pic_disable_intr = ioapic_disable_intr,
- .pic_vector = ioapic_vector,
.pic_source_pending = ioapic_source_pending,
.pic_suspend = NULL,
.pic_resume = ioapic_resume,
@@ -528,15 +526,6 @@
}
}
-static int
-ioapic_vector(struct intsrc *isrc)
-{
- struct ioapic_intsrc *pin;
-
- pin = (struct ioapic_intsrc *)isrc;
- return (pin->io_irq);
-}
-
static int
ioapic_source_pending(struct intsrc *isrc)
{
@@ -949,7 +938,7 @@
io = (struct ioapic *)pic;
for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) {
if (pin->io_irq >= 0)
- intr_register_source(&pin->io_intsrc);
+ intr_register_source(pin->io_irq, &pin->io_intsrc);
}
}
diff --git a/sys/x86/x86/msi.c b/sys/x86/x86/msi.c
--- a/sys/x86/x86/msi.c
+++ b/sys/x86/x86/msi.c
@@ -131,7 +131,6 @@
static void msi_eoi_source(struct intsrc *isrc);
static void msi_enable_intr(struct intsrc *isrc);
static void msi_disable_intr(struct intsrc *isrc);
-static int msi_vector(struct intsrc *isrc);
static int msi_source_pending(struct intsrc *isrc);
static int msi_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
@@ -143,7 +142,6 @@
.pic_eoi_source = msi_eoi_source,
.pic_enable_intr = msi_enable_intr,
.pic_disable_intr = msi_disable_intr,
- .pic_vector = msi_vector,
.pic_source_pending = msi_source_pending,
.pic_suspend = NULL,
.pic_resume = NULL,
@@ -226,14 +224,6 @@
}
}
-static int
-msi_vector(struct intsrc *isrc)
-{
- struct msi_intsrc *msi = (struct msi_intsrc *)isrc;
-
- return (msi->msi_irq);
-}
-
static int
msi_source_pending(struct intsrc *isrc)
{
@@ -392,7 +382,7 @@
msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO);
msi->msi_intsrc.is_pic = &msi_pic;
msi->msi_irq = irq;
- intr_register_source(&msi->msi_intsrc);
+ intr_register_source(irq, &msi->msi_intsrc);
nexus_add_irq(irq);
}
diff --git a/sys/x86/xen/xen_arch_intr.c b/sys/x86/xen/xen_arch_intr.c
--- a/sys/x86/xen/xen_arch_intr.c
+++ b/sys/x86/xen/xen_arch_intr.c
@@ -191,24 +191,6 @@
xen_intr_disable_intr((struct xenisrc *)isrc);
}
-/**
- * Determine the global interrupt vector number for
- * a Xen interrupt source.
- *
- * \param isrc The interrupt source to query.
- *
- * \return The vector number corresponding to the given interrupt source.
- */
-static int
-xen_intr_pic_vector(struct intsrc *isrc)
-{
-
- _Static_assert(offsetof(struct xenisrc, xi_arch.intsrc) == 0,
- "xi_arch MUST be at top of xenisrc for x86");
-
- return (((struct xenisrc *)isrc)->xi_arch.vector);
-}
-
/**
* Determine whether or not interrupt events are pending on the
* the given interrupt source.
@@ -282,7 +264,6 @@
.pic_eoi_source = xen_intr_pic_eoi_source,
.pic_enable_intr = xen_intr_pic_enable_intr,
.pic_disable_intr = xen_intr_pic_disable_intr,
- .pic_vector = xen_intr_pic_vector,
.pic_source_pending = xen_intr_pic_source_pending,
.pic_suspend = xen_intr_pic_suspend,
.pic_resume = xen_intr_pic_resume,
@@ -354,8 +335,7 @@
mtx_unlock(&xen_intr_x86_lock);
isrc = malloc(sizeof(*isrc), M_XENINTR, M_WAITOK | M_ZERO);
isrc->xi_arch.intsrc.is_pic = &xen_intr_pic;
- isrc->xi_arch.vector = vector;
- error = intr_register_source(&isrc->xi_arch.intsrc);
+ error = intr_register_source(vector, &isrc->xi_arch.intsrc);
if (error != 0)
panic("%s(): failed registering interrupt %u, error=%d\n",
__func__, vector, error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 5:38 AM (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14505316
Default Alt Text
D35406.diff (6 KB)
Attached To
Mode
D35406: intr/x86: remove ->pic_vector() from x86 interrupt framework
Attached
Detach File
Event Timeline
Log In to Comment