Changeset 6fd365d in mainline for uspace/lib/c
- Timestamp:
- 2012-08-18T14:20:28Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1864948
- Parents:
- bc6762f
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
-
generic/device/hw_res.c (modified) (1 diff)
-
include/device/hw_res.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/device/hw_res.c
rbc6762f r6fd365d 115 115 } 116 116 117 /** 118 * Query remaining bytes in the buffer. 119 * @param channel DMA Channel 1,2,3 for 8 bit transfers, 5,6,7 for 16 bit. 120 * @return Number of bytes remaining in the buffer(>=0) or error code(<0). 121 */ 122 int hw_res_dma_channel_remain(async_sess_t *sess, unsigned channel) 123 { 124 async_exch_t *exch = async_exchange_begin(sess); 125 if (exch == NULL) 126 return ENOMEM; 127 sysarg_t remain; 128 const int ret = async_req_2_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE), 129 HW_RES_DMA_CHANNEL_REMAIN, channel, &remain); 130 async_exchange_end(exch); 131 if (ret == EOK) 132 return remain; 133 return ret; 134 } 135 117 136 /** @} 118 137 */ -
uspace/lib/c/include/device/hw_res.h
rbc6762f r6fd365d 53 53 HW_RES_ENABLE_INTERRUPT, 54 54 HW_RES_DMA_CHANNEL_SETUP, 55 HW_RES_DMA_CHANNEL_REMAIN, 55 56 } hw_res_method_t; 56 57 … … 116 117 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t, 117 118 uint16_t, uint8_t); 119 extern int hw_res_dma_channel_remain(async_sess_t *, unsigned); 118 120 119 121 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
