static size_t at91_flash_readDirect(struct KBlock *blk, block_idx_t idx, void *buf, size_t offset, size_t size)
{
- ASSERT(offset == 0);
- ASSERT(size == blk->blk_size);
-
memcpy(buf, (void *)(idx * blk->blk_size + FLASH_BASE), size);
return size;
}
static size_t lpc2_flash_readDirect(struct KBlock *blk, block_idx_t idx, void *buf, size_t offset, size_t size)
{
- ASSERT(offset == 0);
- ASSERT(size == blk->blk_size);
-
memcpy(buf, (void *)(idx * blk->blk_size), size);
return size;
}
static size_t avr_flash_readDirect(struct KBlock *blk, block_idx_t idx, void *buf, size_t offset, size_t size)
{
- ASSERT(offset == 0);
- ASSERT(size == blk->blk_size);
-
memcpy_P(buf, (const void *)(uint16_t)(idx * blk->blk_size), size);
return blk->blk_size;
}
static size_t lm3s_flash_readDirect(struct KBlock *blk, block_idx_t idx, void *buf, size_t offset, size_t size)
{
- ASSERT(offset == 0);
- ASSERT(size == blk->blk_size);
-
memcpy(buf, (void *)(idx * blk->blk_size), size);
return size;
}
static size_t stm32_flash_readDirect(struct KBlock *blk, block_idx_t idx, void *buf, size_t offset, size_t size)
{
- ASSERT(offset == 0);
- ASSERT(size == blk->blk_size);
-
memcpy(buf, (void *)(idx * blk->blk_size), size);
return size;
}