Changeset 5960b48 in mainline for uspace/drv/bus/isa/isa.c
- Timestamp:
- 2011-12-25T19:50:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b1f44b4
- Parents:
- ee163b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/isa.c
ree163b3 r5960b48 51 51 #include <dirent.h> 52 52 #include <fcntl.h> 53 #include <ipc/irc.h> 54 #include <ipc/services.h> 55 #include <sysinfo.h> 56 #include <ns.h> 53 57 #include <sys/stat.h> 54 58 … … 96 100 static bool isa_enable_fun_interrupt(ddf_fun_t *fnode) 97 101 { 98 /* TODO */ 99 100 return false; 102 /* This is an old ugly way, copied from pci driver */ 103 assert(fnode); 104 isa_fun_t *isa_fun = fnode->driver_data; 105 106 sysarg_t apic; 107 sysarg_t i8259; 108 109 async_sess_t *irc_sess = NULL; 110 111 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic)) 112 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) { 113 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE, 114 SERVICE_IRC, 0, 0); 115 } 116 117 if (!irc_sess) 118 return false; 119 120 assert(isa_fun); 121 const hw_resource_list_t *res = &isa_fun->hw_resources; 122 assert(res); 123 for (size_t i = 0; i < res->count; ++i) { 124 if (res->resources[i].type == INTERRUPT) { 125 const int irq = res->resources[i].res.interrupt.irq; 126 127 async_exch_t *exch = async_exchange_begin(irc_sess); 128 const int rc = 129 async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq); 130 async_exchange_end(exch); 131 132 if (rc != EOK) { 133 async_hangup(irc_sess); 134 return false; 135 } 136 } 137 } 138 139 async_hangup(irc_sess); 140 return true; 101 141 } 102 142
Note:
See TracChangeset
for help on using the changeset viewer.