Changeset d51838f in mainline for uspace/drv/platform/icp/icp.c
- Timestamp:
- 2017-10-14T22:49:18Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 75911d24
- Parents:
- ce732e74
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/icp/icp.c
rce732e74 rd51838f 39 39 #include <stdio.h> 40 40 #include <errno.h> 41 #include <irc.h> 41 42 #include <stdbool.h> 42 43 #include <stdlib.h> … … 142 143 } 143 144 144 static int icp_enable_interrupt(ddf_fun_t *fun, int irq) 145 { 146 /* TODO */ 145 static bool icp_fun_owns_interrupt(icp_fun_t *fun, int irq) 146 { 147 const hw_resource_list_t *res = &fun->hw_resources; 148 149 /* Check that specified irq really belongs to the function */ 150 for (size_t i = 0; i < res->count; ++i) { 151 if (res->resources[i].type == INTERRUPT && 152 res->resources[i].res.interrupt.irq == irq) { 153 return true; 154 } 155 } 156 147 157 return false; 158 } 159 160 static int icp_fun_enable_interrupt(ddf_fun_t *fnode, int irq) 161 { 162 icp_fun_t *fun = icp_fun(fnode); 163 164 if (!icp_fun_owns_interrupt(fun, irq)) 165 return EINVAL; 166 167 return irc_enable_interrupt(irq); 148 168 } 149 169 … … 155 175 static hw_res_ops_t icp_hw_res_ops = { 156 176 .get_resource_list = &icp_get_resources, 157 .enable_interrupt = &icp_ enable_interrupt,177 .enable_interrupt = &icp_fun_enable_interrupt, 158 178 }; 159 179
Note:
See TracChangeset
for help on using the changeset viewer.