Changeset cccd60c3 in mainline for uspace/drv
- Timestamp:
- 2017-10-10T06:51:02Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c46bfbc
- Parents:
- 2bdf92a5
- Location:
- uspace/drv
- Files:
-
- 11 edited
-
audio/sb16/main.c (modified) (4 diffs)
-
bus/isa/isa.c (modified) (1 diff)
-
bus/pci/pciintel/pci.c (modified) (1 diff)
-
char/i8042/i8042.c (modified) (1 diff)
-
platform/amdm37x/main.c (modified) (2 diffs)
-
platform/icp/icp.c (modified) (1 diff)
-
platform/mac/mac.c (modified) (1 diff)
-
platform/malta/malta.c (modified) (1 diff)
-
platform/msim/msim.c (modified) (1 diff)
-
platform/pc/pc.c (modified) (1 diff)
-
platform/sun4u/sun4u.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/main.c
r2bdf92a5 rcccd60c3 50 50 static int sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs, 51 51 addr_range_t **pp_mpu_regs, int *irq, int *dma8, int *dma16); 52 static int sb_enable_interrupt s(ddf_dev_t *device);52 static int sb_enable_interrupt(ddf_dev_t *device, int irq); 53 53 54 54 static driver_ops_t sb_driver_ops = { … … 134 134 handler_regd = true; 135 135 136 rc = sb_enable_interrupt s(device);136 rc = sb_enable_interrupt(device, irq); 137 137 if (rc != EOK) { 138 138 ddf_log_error("Failed to enable interrupts: %s.", … … 242 242 } 243 243 244 int sb_enable_interrupts(ddf_dev_t *device)244 static int sb_enable_interrupt(ddf_dev_t *device, int irq) 245 245 { 246 246 async_sess_t *parent_sess = ddf_dev_parent_sess_get(device); … … 248 248 return ENOMEM; 249 249 250 bool enabled = hw_res_enable_interrupt(parent_sess); 251 252 return enabled ? EOK : EIO; 250 return hw_res_enable_interrupt(parent_sess, irq); 253 251 } 254 252 -
uspace/drv/bus/isa/isa.c
r2bdf92a5 rcccd60c3 115 115 } 116 116 117 static bool isa_fun_enable_interrupt(ddf_fun_t *fnode) 118 { 119 /* This is an old ugly way, copied from pci driver */ 120 assert(fnode); 117 static int isa_fun_enable_interrupt(ddf_fun_t *fnode, int irq) 118 { 121 119 isa_fun_t *fun = isa_fun(fnode); 122 assert(fun);123 124 120 const hw_resource_list_t *res = &fun->hw_resources; 125 assert(res); 121 bool found; 122 123 /* Check that specified irq really belongs to the function */ 124 found = false; 126 125 for (size_t i = 0; i < res->count; ++i) { 127 if (res->resources[i].type == INTERRUPT) { 128 int rc = irc_enable_interrupt( 129 res->resources[i].res.interrupt.irq); 130 131 if (rc != EOK) 132 return false; 133 } 134 } 135 136 return true; 126 if (res->resources[i].type == INTERRUPT && 127 res->resources[i].res.interrupt.irq == irq) { 128 found = true; 129 break; 130 } 131 } 132 133 if (!found) 134 return EINVAL; 135 136 return irc_enable_interrupt(irq); 137 137 } 138 138 -
uspace/drv/bus/pci/pciintel/pci.c
r2bdf92a5 rcccd60c3 99 99 } 100 100 101 static bool pciintel_enable_interrupt(ddf_fun_t *fnode) 102 { 103 /* This is an old ugly way */ 104 assert(fnode); 101 static int pciintel_enable_interrupt(ddf_fun_t *fnode, int irq) 102 { 105 103 pci_fun_t *dev_data = pci_fun(fnode); 106 104 107 size_t i = 0;105 size_t i; 108 106 hw_resource_list_t *res = &dev_data->hw_resources; 109 for (; i < res->count; i++) { 107 bool found = false; 108 109 found = false; 110 for (i = 0; i < res->count; i++) { 110 111 if (res->resources[i].type == INTERRUPT) { 111 int rc = irc_enable_interrupt( 112 res->resources[i].res.interrupt.irq); 113 114 if (rc != EOK) 115 return false; 112 found = true; 113 break; 116 114 } 117 115 } 118 116 119 return true; 117 if (!found) 118 return EINVAL; 119 120 return irc_enable_interrupt(irq); 120 121 } 121 122 -
uspace/drv/char/i8042/i8042.c
r2bdf92a5 rcccd60c3 291 291 assert(parent_sess != NULL); 292 292 293 const bool enabled = hw_res_enable_interrupt(parent_sess); 294 if (!enabled) { 295 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to enable interrupts: %s.", 293 rc = hw_res_enable_interrupt(parent_sess, irq_kbd); 294 if (rc != EOK) { 295 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to enable keyboard interrupt: %s.", 296 ddf_dev_get_name(ddf_dev)); 297 rc = EIO; 298 goto error; 299 } 300 301 rc = hw_res_enable_interrupt(parent_sess, irq_mouse); 302 if (rc != EOK) { 303 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to enable mouse interrupt: %s.", 296 304 ddf_dev_get_name(ddf_dev)); 297 305 rc = EIO; -
uspace/drv/platform/amdm37x/main.c
r2bdf92a5 rcccd60c3 150 150 151 151 static hw_resource_list_t *amdm37x_get_resources(ddf_fun_t *fnode); 152 static bool amdm37x_enable_interrupt(ddf_fun_t *fun);152 static int amdm37x_enable_interrupt(ddf_fun_t *fun, int); 153 153 154 154 static hw_res_ops_t fun_hw_res_ops = { … … 265 265 } 266 266 267 static bool amdm37x_enable_interrupt(ddf_fun_t *fun)267 static int amdm37x_enable_interrupt(ddf_fun_t *fun, int irq) 268 268 { 269 269 //TODO: Implement -
uspace/drv/platform/icp/icp.c
r2bdf92a5 rcccd60c3 142 142 } 143 143 144 static bool icp_enable_interrupt(ddf_fun_t *fun)144 static int icp_enable_interrupt(ddf_fun_t *fun, int irq) 145 145 { 146 146 /* TODO */ -
uspace/drv/platform/mac/mac.c
r2bdf92a5 rcccd60c3 227 227 } 228 228 229 static bool mac_enable_interrupt(ddf_fun_t *fun)229 static int mac_enable_interrupt(ddf_fun_t *fun, int irq) 230 230 { 231 231 /* TODO */ -
uspace/drv/platform/malta/malta.c
r2bdf92a5 rcccd60c3 143 143 } 144 144 145 static bool malta_enable_interrupt(ddf_fun_t *fun)145 static int malta_enable_interrupt(ddf_fun_t *fun, int irq) 146 146 { 147 147 /* TODO */ -
uspace/drv/platform/msim/msim.c
r2bdf92a5 rcccd60c3 121 121 } 122 122 123 static bool msim_enable_interrupt(ddf_fun_t *fun)123 static int msim_enable_interrupt(ddf_fun_t *fun, int irq) 124 124 { 125 125 /* Nothing to do. */ -
uspace/drv/platform/pc/pc.c
r2bdf92a5 rcccd60c3 125 125 } 126 126 127 static bool pc_enable_interrupt(ddf_fun_t *fun)127 static int pc_enable_interrupt(ddf_fun_t *fun, int irq) 128 128 { 129 129 /* TODO */ -
uspace/drv/platform/sun4u/sun4u.c
r2bdf92a5 rcccd60c3 130 130 } 131 131 132 static bool sun4u_enable_interrupt(ddf_fun_t *fun)132 static int sun4u_enable_interrupt(ddf_fun_t *fun, int irq) 133 133 { 134 134 /* TODO */
Note:
See TracChangeset
for help on using the changeset viewer.
