Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101968262
D47344.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
D47344.diff
View Options
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -52,6 +52,9 @@
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/cpuset.h>
+#ifdef INTRNG
+#include <sys/intr.h>
+#endif
#include <net/vnet.h>
@@ -4378,17 +4381,26 @@
if (error != 0)
return (error);
- if ((rman_get_flags(r) & RF_UNMAPPED) == 0 &&
- (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) {
- error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map);
- if (error != 0) {
- rman_deactivate_resource(r);
- return (error);
- }
+ switch (type) {
+ case SYS_RES_IOPORT:
+ case SYS_RES_MEMORY:
+ if ((rman_get_flags(r) & RF_UNMAPPED) == 0) {
+ error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map);
+ if (error != 0)
+ break;
- rman_set_mapping(r, &map);
+ rman_set_mapping(r, &map);
+ }
+ break;
+#ifdef INTRNG
+ case SYS_RES_IRQ:
+ error = intr_activate_irq(child, r);
+ break;
+#endif
}
- return (0);
+ if (error != 0)
+ rman_deactivate_resource(r);
+ return (error);
}
/**
@@ -4417,10 +4429,19 @@
if (error != 0)
return (error);
- if ((rman_get_flags(r) & RF_UNMAPPED) == 0 &&
- (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) {
- rman_get_mapping(r, &map);
- BUS_UNMAP_RESOURCE(dev, child, type, r, &map);
+ switch (type) {
+ case SYS_RES_IOPORT:
+ case SYS_RES_MEMORY:
+ if ((rman_get_flags(r) & RF_UNMAPPED) == 0) {
+ rman_get_mapping(r, &map);
+ BUS_UNMAP_RESOURCE(dev, child, type, r, &map);
+ }
+ break;
+#ifdef INTRNG
+ case SYS_RES_IRQ:
+ intr_deactivate_irq(child, r);
+ break;
+#endif
}
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 10:41 PM (11 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14400158
Default Alt Text
D47344.diff (1 KB)
Attached To
Mode
D47344: MFC of D47282
Attached
Detach File
Event Timeline
Log In to Comment