Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144540673
D7692.1775307877.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7692.1775307877.diff
View Options
Index: sys/mips/mips/mips_pic.c
===================================================================
--- sys/mips/mips/mips_pic.c
+++ sys/mips/mips/mips_pic.c
@@ -68,6 +68,7 @@
#define NHARD_IRQS 6
#define NSOFT_IRQS 2
#define NREAL_IRQS (NHARD_IRQS + NSOFT_IRQS)
+#define NFDT_CELLS 1
static int mips_pic_intr(void *);
@@ -383,6 +384,37 @@
{
}
+static int
+cpu_create_intr_map(int irq)
+{
+ struct intr_map_data_fdt *fdt_data;
+ size_t len;
+ phandle_t iparent;
+ u_int new_irq;
+
+ iparent = pic_xref(pic_sc->pic_dev);
+ len = sizeof(*fdt_data) + NFDT_CELLS * sizeof(pcell_t);
+
+ /* Allocate artificial FDT data and fill it in */
+ fdt_data = (struct intr_map_data_fdt *)intr_alloc_map_data(
+ INTR_MAP_DATA_FDT, len, M_WAITOK | M_ZERO);
+ fdt_data->hdr.type = INTR_MAP_DATA_FDT;
+ fdt_data->iparent = iparent;
+ fdt_data->ncells = NFDT_CELLS;
+ fdt_data->cells[0] = irq;
+
+ /* Get the new irq number */
+ new_irq = intr_map_irq(pic_sc->pic_dev, iparent,
+ (struct intr_map_data *)fdt_data);
+
+ /* Adjust the resource accordingly */
+ rman_set_start(pic_sc->pic_irqs[irq].res, new_irq);
+ rman_set_end(pic_sc->pic_irqs[irq].res, new_irq);
+
+ /* Activate the new irq */
+ return (intr_activate_irq(pic_sc->pic_dev, pic_sc->pic_irqs[irq].res));
+}
+
void
cpu_establish_hardintr(const char *name, driver_filter_t *filt,
void (*handler)(void*), void *arg, int irq, int flags, void **cookiep)
@@ -398,6 +430,10 @@
KASSERT(pic_sc != NULL, ("%s: no pic", __func__));
irq += NSOFT_IRQS;
+
+ res = cpu_create_intr_map(irq);
+ if (res != 0) panic("Unable to create map for hard IRQ %d", irq);
+
res = intr_setup_irq(pic_sc->pic_dev, pic_sc->pic_irqs[irq].res, filt,
handler, arg, flags, cookiep);
if (res != 0) panic("Unable to add hard IRQ %d handler", irq);
@@ -415,6 +451,9 @@
KASSERT(pic_sc != NULL, ("%s: no pic", __func__));
+ res = cpu_create_intr_map(irq);
+ if (res != 0) panic("Unable to create map for soft IRQ %d", irq);
+
res = intr_setup_irq(pic_sc->pic_dev, pic_sc->pic_irqs[irq].res, filt,
handler, arg, flags, cookiep);
if (res != 0) panic("Unable to add soft IRQ %d handler", irq);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 4, 1:04 PM (1 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28259411
Default Alt Text
D7692.1775307877.diff (2 KB)
Attached To
Mode
D7692: MIPS: Fix cpu_establish_[hard|soft]intr() post r304459
Attached
Detach File
Event Timeline
Log In to Comment