Changeset cf02eaf in mainline for uspace/lib/c/generic/device/hw_res.c
- Timestamp:
- 2013-08-22T16:01:19Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5b1adf5
- Parents:
- a6bdccc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/device/hw_res.c
ra6bdccc rcf02eaf 42 42 { 43 43 sysarg_t count = 0; 44 44 45 45 async_exch_t *exch = async_exchange_begin(sess); 46 46 if (exch == NULL) … … 48 48 int rc = async_req_1_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE), 49 49 HW_RES_GET_RESOURCE_LIST, &count); 50 50 51 51 if (rc != EOK) { 52 52 async_exchange_end(exch); 53 53 return rc; 54 54 } 55 55 56 56 size_t size = count * sizeof(hw_resource_t); 57 57 hw_resource_t *resources = (hw_resource_t *) malloc(size); … … 61 61 return ENOMEM; 62 62 } 63 63 64 64 rc = async_data_read_start(exch, resources, size); 65 65 async_exchange_end(exch); 66 66 67 67 if (rc != EOK) { 68 68 free(resources); 69 69 return rc; 70 70 } 71 71 72 72 hw_resources->resources = resources; 73 73 hw_resources->count = count; 74 74 75 75 return EOK; 76 76 } … … 84 84 HW_RES_ENABLE_INTERRUPT); 85 85 async_exchange_end(exch); 86 86 87 87 return (rc == EOK); 88 88 }
Note:
See TracChangeset
for help on using the changeset viewer.