norflash: fix handling of boundaries
This was slightly off since my introduction of hidden sectors^^^^^ blocks in the norflash driver.
This commit is contained in:
parent
bd3bcbe5d6
commit
31e17f9d7b
@ -63,6 +63,9 @@ nor_init_device(void *_info, void **_cookie)
|
||||
if (info->id < 0)
|
||||
return info->id;
|
||||
|
||||
info->mapped += HIDDEN_BLOCKS * info->blocksize;
|
||||
|
||||
|
||||
*_cookie = info;
|
||||
return B_OK;
|
||||
}
|
||||
@ -142,8 +145,6 @@ nor_read(void *_cookie, off_t position, void *data, size_t *numbytes)
|
||||
nor_driver_info *info = (nor_driver_info*)_cookie;
|
||||
TRACE("read(%Ld,%lu)\n", position, *numbytes);
|
||||
|
||||
position += HIDDEN_BLOCKS * info->blocksize;
|
||||
|
||||
if (position + *numbytes > info->totalsize)
|
||||
*numbytes = info->totalsize - (position + *numbytes);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user