read_page()
PROTOTYPE
#include <bfs.h>
int read_page(ui32 addr, void *dst, void *dev);
DESCRIPTION
read_page() reads the page of NOR flash memory at address addr. Its size is set by the BFS_PAGE_SIZE definition. dst points to where the data is copied to. To facilitate DMA transfers, it will be aligned according to the CACHE_LINE_SIZE definition in “bsp.h”.
dev is a driver-supplied data pointer. The value passed to TargetBFS by the bfsAddNorVol() call is passed back as the last parameter of each driver callback function. It can be used in any way that is convenient for the driver implementation.
read_page() returns 0 for success. Any other value is interpreted as a fatal error. A fatal error causes all subsequent accesses to fail, with errno set to EIO. A fatal error should be reported if a permanent error condition exists, such as if a removable device has been extracted.