Ignore:
Timestamp:
2010-04-01T14:08:55Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
57937dd
Parents:
a1769ee
Message:

device interfaces - parts of code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/ipc/dev_iface.h

    ra1769ee r52b7b1bb  
    3535
    3636typedef enum { 
    37         GENERIC_DEV_IFACE = DEV_IFACE_FIRST,
    38         DIRECTLY_ADDRESSABLE_DEV_IFACE,
     37        HW_RES_DEV_IFACE = DEV_IFACE_FIRST,     
    3938        // TODO add more interfaces
    4039        DEV_IFACE_MAX
     
    4544
    4645
     46// data types related to some interface - TODO move this to separate header files
    4747
    4848
     49// HW resource provider interface
    4950
     51typedef enum {
     52        GET_RESOURCE_LIST = 0,
     53        ENABLE_INTERRUPT       
     54} hw_res_funcs_t;
    5055
     56/** HW resource types. */
     57typedef enum {
     58        INTERRUPT,
     59        REGISTER
     60} hw_res_type_t;
     61
     62typedef enum {
     63        LITTLE_ENDIAN = 0,
     64        BIG_ENDIAN
     65} endianness_t;
     66
     67/** HW resource (e.g. interrupt, memory register, i/o register etc.). */
     68typedef struct hw_resource {
     69        hw_res_type_t type;
     70        union {
     71                struct {
     72                        void *address;
     73                        endianness_t endianness;                       
     74                        size_t size;                   
     75                } reg;
     76                struct {
     77                        int irq;                       
     78                } intr;         
     79        };     
     80} hw_resource_t;
     81
     82typedef struct {
     83        size_t count;
     84        hw_resource_t *resources;       
     85} hw_resource_list_t;
    5186
    5287#endif
Note: See TracChangeset for help on using the changeset viewer.