Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148468167
D36609.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36609.diff
View Options
diff --git a/sys/powerpc/include/intr.h b/sys/powerpc/include/intr.h
--- a/sys/powerpc/include/intr.h
+++ b/sys/powerpc/include/intr.h
@@ -38,6 +38,11 @@
extern struct intr_event *intr2event(interrupt_t *intr);
+#define INTR_FOREACH(i) \
+ for (u_int INTR_FOREACH = 0; \
+ ((i) = powerpc_get_irqnum(INTR_FOREACH)) < ((u_int)-1); \
+ ++INTR_FOREACH)
+
/* FreeBSD standard interrupt controller interface */
#define INTR_VECTORS 256
@@ -73,4 +78,6 @@
void powerpc_intr_mask(u_int irq);
void powerpc_intr_unmask(u_int irq);
+u_int powerpc_get_irqnum(u_int idx);
+
#endif /* _MACHINE_INTR_MACHDEP_H_ */
diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c
--- a/sys/powerpc/powerpc/intr_machdep.c
+++ b/sys/powerpc/powerpc/intr_machdep.c
@@ -307,6 +307,15 @@
return (NULL);
}
+u_int
+powerpc_get_irqnum(u_int idx)
+{
+
+ if (idx >= num_io_irqs)
+ return (-1);
+ return (powerpc_intrs[idx]->irq);
+}
+
struct intr_event *
intr2event(interrupt_t *intr)
{
diff --git a/sys/sys/intr.h b/sys/sys/intr.h
--- a/sys/sys/intr.h
+++ b/sys/sys/intr.h
@@ -45,6 +45,14 @@
#define intr2event(intr) ((intr) == NULL ? NULL : (intr)->isrc_event)
+#define INTR_FOREACH(i) \
+ for ((i) = 0; __extension__ ({ \
+ do { \
+ ++(i); \
+ } while ((i) < intr_nirq && intr_lookup(i) == NULL); \
+ (i) < intr_nirq; \
+ }); )
+
/* FreeBSD standard interrupt controller interface */
#define INTR_IRQ_INVALID 0xFFFFFFFF
diff --git a/sys/x86/include/intr.h b/sys/x86/include/intr.h
--- a/sys/x86/include/intr.h
+++ b/sys/x86/include/intr.h
@@ -40,6 +40,14 @@
#define intr2event(intr) ((intr) == NULL ? NULL : (intr)->is_event)
+#define INTR_FOREACH(i) \
+ for ((i) = 0; __extension__ ({ \
+ do { \
+ ++(i); \
+ } while ((i) < num_io_irqs && intr_lookup(i) == NULL); \
+ (i) < num_io_irqs; \
+ }); )
+
/* FreeBSD standard interrupt controller interface */
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 19, 2:32 AM (6 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29921872
Default Alt Text
D36609.diff (1 KB)
Attached To
Mode
D36609: intr: add interrupt FOREACH macro
Attached
Detach File
Event Timeline
Log In to Comment