Changeset 3869c596 in mainline
- Timestamp:
- 2012-08-30T18:15:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 57b28f9
- Parents:
- f3fb83a
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/i8237.c
rf3fb83a r3869c596 38 38 #include <bool.h> 39 39 #include <errno.h> 40 #include <ddi.h> 41 #include <ddf/log.h> 40 42 #include <fibril_synch.h> 41 #include <ddi.h>42 43 #include <libarch/ddi.h> 43 #include <ddf/log.h>44 44 #include "i8237.h" 45 45 … … 454 454 * @return Error code. 455 455 */ 456 int dma_channel_remain(unsigned channel, uint16_t *size)456 int dma_channel_remain(unsigned channel, size_t *size) 457 457 { 458 458 assert(size); … … 484 484 fibril_mutex_unlock(&guard); 485 485 486 const int remain = (value_high << 8 | value_low) + 1; 487 /* 16 bit DMA size is in words */ 488 *size = is_dma16(channel) ? remain << 1 : remain; 486 uint16_t remain = (value_high << 8 | value_low) ; 487 /* 16 bit DMA size is in words, 488 * the upper bits are bogus for 16bit transfers so we need to get 489 * rid of them. Using limited type works well.*/ 490 if (is_dma16(channel)) 491 remain <<= 1; 492 *size = is_dma16(channel) ? remain + 2: remain + 1; 489 493 return EOK; 490 494 } -
uspace/drv/bus/isa/i8237.h
rf3fb83a r3869c596 39 39 40 40 extern int dma_channel_setup(unsigned, uint32_t, uint16_t, uint8_t); 41 extern int dma_channel_remain(unsigned, uint16_t *);41 extern int dma_channel_remain(unsigned, size_t *); 42 42 43 43 #endif -
uspace/drv/bus/isa/isa.c
rf3fb83a r3869c596 170 170 171 171 static int isa_fun_remain_dma(ddf_fun_t *fnode, 172 unsigned channel, uint16_t *size)172 unsigned channel, size_t *size) 173 173 { 174 174 assert(size); -
uspace/lib/drv/generic/remote_hw_res.c
rf3fb83a r3869c596 130 130 } 131 131 const unsigned channel = DEV_IPC_GET_ARG1(*call); 132 uint16_t remain = 0;132 size_t remain = 0; 133 133 const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain); 134 134 async_answer_1(callid, ret, remain); -
uspace/lib/drv/include/ops/hw_res.h
rf3fb83a r3869c596 45 45 bool (*enable_interrupt)(ddf_fun_t *); 46 46 int (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint16_t, uint8_t); 47 int (*dma_channel_remain)(ddf_fun_t *, unsigned, uint16_t *);47 int (*dma_channel_remain)(ddf_fun_t *, unsigned, size_t *); 48 48 } hw_res_ops_t; 49 49
Note:
See TracChangeset
for help on using the changeset viewer.