|
muteki
|
Flash Translation Layer (FTL) and block device API. More...
#include <muteki/common.h>Go to the source code of this file.
Data Structures | |
| struct | nand_params_t |
| NAND flash parameter. More... | |
Functions | |
| size_t | FTL_GetCurDiskSize (size_t *size_hi) |
| Get the size of block device the current active drive belongs to. | |
| int | FTL_ReadSector (size_t sector, void *ptr, size_t count) |
| Read sectors from the block device the current active drive belongs to. | |
| short | FTL_CreateRamDisk (size_t size) |
| Allocate a RAM disk. | |
| void | FTL_DestroyRamDisk (void) |
| Close the previously allocated RAM disk. | |
| int | nand_get_params (int sbz, nand_params_t *params) |
| Get NAND flash parameters. | |
| int | nand_read_page (int sbz, size_t page, void *ptr, size_t count, short arg5) |
| Read NAND flash pages at a specific page number. | |
Flash Translation Layer (FTL) and block device API.
Requires -lkrnllib when dynamically linking with the shims.
|
extern |
Allocate a RAM disk.
This may be used internally to buffer file writes under circumstances when low latency I/O is required, such as when streaming audio data from on-board NAND flash.
| size | Size of the RAM disk in bytes. |
|
extern |
Close the previously allocated RAM disk.
|
extern |
Get the size of block device the current active drive belongs to.
When the size is >= 4GiB, the size is split into 2 parts and they must be joined together by using
| size_hi | The high 32-bit of the size. |
|
extern |
Read sectors from the block device the current active drive belongs to.
Sector size seems to be constant 512 bytes.
| sector | Start sector number. |
| ptr | Target pointer. The size must be multiple of 512 bytes. |
| count | How many sectors to read. |
| 0 | The operation was completed successfully. |
| -1 | The operation failed with error. |
| int nand_get_params | ( | int | sbz, |
| nand_params_t * | params | ||
| ) |
Get NAND flash parameters.
| sbz | Reserved. Should be set to 0. |
| params | Parameter structure to write to. |
| 0 | The operation was completed successfully. |
| -1 | The operation failed with error. |
| int nand_read_page | ( | int | sbz, |
| size_t | page, | ||
| void * | ptr, | ||
| size_t | count, | ||
| short | arg5 | ||
| ) |
Read NAND flash pages at a specific page number.
| sbz | Reserved. Should be set to 0. |
| page | Page number where the read should start. |
| ptr | Buffer where the page content will be stored. |
| count | Number of pages to read. |
| arg5 | Unknown. May be related to reading spare sector? |
| 0 | The operation was completed successfully. |
| -1 | The operation failed with error. |