Ignore:
Timestamp:
2010-04-09T13:54:06Z (15 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
892e4e1
Parents:
3a5909f
Message:

device classes as interface sets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/device/hw_res.h

    r3a5909f r3843ecb  
    3939#include <bool.h>
    4040
     41/** HW resource (e.g. interrupt, memory register, i/o register etc.). */
     42typedef struct hw_resource {
     43        hw_res_type_t type;
     44        union {
     45                struct {
     46                        uint64_t address;
     47                        endianness_t endianness;                       
     48                        size_t size;                   
     49                } mem_range;
     50                struct {
     51                        uint64_t address;
     52                        endianness_t endianness;                       
     53                        size_t size;                   
     54                } io_range;
     55                struct {
     56                        int irq;                       
     57                } interrupt;           
     58        } res; 
     59} hw_resource_t;
     60
     61typedef struct hw_resource_list {
     62        size_t count;
     63        hw_resource_t *resources;       
     64} hw_resource_list_t;
     65
     66static inline void clean_hw_resource_list(hw_resource_list_t *hw_res)
     67{
     68        if(NULL != hw_res->resources) {
     69                free(hw_res->resources);
     70                hw_res->resources = NULL;
     71        }
     72        hw_res->count = 0;     
     73}
     74
    4175
    4276bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources);
Note: See TracChangeset for help on using the changeset viewer.