Changeset 54de5ebd in mainline for uspace/lib/c/include/device/hw_res.h
- Timestamp:
- 2011-01-09T12:26:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0adddea
- Parents:
- a676574
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/device/hw_res.h
ra676574 r54de5ebd 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 43 43 typedef enum { 44 44 GET_RESOURCE_LIST = 0, 45 ENABLE_INTERRUPT 45 ENABLE_INTERRUPT 46 46 } hw_res_funcs_t; 47 47 … … 58 58 } endianness_t; 59 59 60 61 60 /** HW resource (e.g. interrupt, memory register, i/o register etc.). */ 62 61 typedef struct hw_resource { … … 65 64 struct { 66 65 uint64_t address; 67 endianness_t endianness; 68 size_t size; 66 endianness_t endianness; 67 size_t size; 69 68 } mem_range; 70 69 struct { 71 70 uint64_t address; 72 endianness_t endianness; 73 size_t size; 71 endianness_t endianness; 72 size_t size; 74 73 } io_range; 75 74 struct { 76 int irq; 77 } interrupt; 78 } res; 75 int irq; 76 } interrupt; 77 } res; 79 78 } hw_resource_t; 80 79 81 80 typedef struct hw_resource_list { 82 81 size_t count; 83 hw_resource_t *resources; 82 hw_resource_t *resources; 84 83 } hw_resource_list_t; 85 84 86 85 static inline void clean_hw_resource_list(hw_resource_list_t *hw_res) 87 86 { 88 if (NULL != hw_res->resources) {87 if (NULL != hw_res->resources) { 89 88 free(hw_res->resources); 89 90 90 hw_res->resources = NULL; 91 91 } 92 hw_res->count = 0; 92 93 hw_res->count = 0; 93 94 } 94 95 96 95 97 96 extern int get_hw_resources(int, hw_resource_list_t *); 98 97 extern bool enable_interrupt(int); 99 100 98 101 99 #endif
Note:
See TracChangeset
for help on using the changeset viewer.