Changeset 3869c596 in mainline for uspace/drv/bus/isa/i8237.c
- 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
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.