Changeset d51838f in mainline for uspace/lib/c


Ignore:
Timestamp:
2017-10-14T22:49:18Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
75911d24
Parents:
ce732e74
Message:

Let leaf drivers enable/disable/clear interrupts via hw_res instead of directly using irc.

Location:
uspace/lib/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/device/hw_res.c

    rce732e74 rd51838f  
    8686}
    8787
     88int hw_res_disable_interrupt(async_sess_t *sess, int irq)
     89{
     90        async_exch_t *exch = async_exchange_begin(sess);
     91       
     92        int rc = async_req_2_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
     93            HW_RES_DISABLE_INTERRUPT, irq);
     94        async_exchange_end(exch);
     95       
     96        return rc;
     97}
     98
     99int hw_res_clear_interrupt(async_sess_t *sess, int irq)
     100{
     101        async_exch_t *exch = async_exchange_begin(sess);
     102       
     103        int rc = async_req_2_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
     104            HW_RES_CLEAR_INTERRUPT, irq);
     105        async_exchange_end(exch);
     106       
     107        return rc;
     108}
     109
    88110/** Setup DMA channel to specified place and mode.
    89111 *
  • uspace/lib/c/include/device/hw_res.h

    rce732e74 rd51838f  
    5252        HW_RES_GET_RESOURCE_LIST = 0,
    5353        HW_RES_ENABLE_INTERRUPT,
     54        HW_RES_DISABLE_INTERRUPT,
     55        HW_RES_CLEAR_INTERRUPT,
    5456        HW_RES_DMA_CHANNEL_SETUP,
    5557        HW_RES_DMA_CHANNEL_REMAIN,
     
    116118extern int hw_res_get_resource_list(async_sess_t *, hw_resource_list_t *);
    117119extern int hw_res_enable_interrupt(async_sess_t *, int);
     120extern int hw_res_disable_interrupt(async_sess_t *, int);
     121extern int hw_res_clear_interrupt(async_sess_t *, int);
    118122
    119123extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t,
Note: See TracChangeset for help on using the changeset viewer.