Struct SolidSyslogNorFlash¶
ClassList > SolidSyslogNorFlash
#include <SolidSyslogNorFlashDefinition.h>
struct SolidSyslogNorFlash
{
bool (*Read)(struct SolidSyslogNorFlash* base, size_t blockIndex, size_t offset, void* buffer, size_t count);
bool (*Program)(
struct SolidSyslogNorFlash* base,
size_t blockIndex,
size_t offset,
const void* buffer,
size_t count
);
bool (*Erase)(struct SolidSyslogNorFlash* base, size_t blockIndex);
size_t (*GetBlockSize)(struct SolidSyslogNorFlash* base);
size_t (*GetBlockCount)(struct SolidSyslogNorFlash* base);
};
Detailed Description¶
The NOR flash extension point: an implementor fills this vtable and embeds it as the first member of its own struct, so_ base _downcasts back to that struct.
Each method's contract is the matching SolidSyslogNorFlash_* wrapper in SolidSyslogNorFlash.h. SolidSyslogNullNorFlash is the "no flash" implementation: every method returns false / 0.
A block is the unit Erase works on, and the flash is addressed by block and by offset within it, so a part of any capacity fits the same signatures.
Every call returns in bounded time. One the flash does not finish within the time the part allows for it answers false, so a part that stops answering costs a bounded wait, not a Service that never returns. The bound includes the bus under the flash. What the false does depends on the block device operation that met it: most fail with it, which freezes a store above; a state that cannot be read is taken as a block that is not there (see SolidSyslogNorFlashBlockDevice.h), so the store carries on and freezes only at a later operation that fails.
Access is single-threaded, so an implementation need not be reentrant. Where the part is shared with another user, the implementation takes whatever lock that needs around each call; the library holds none.
The part must allow a byte that has been programmed to be programmed again before its block is erased: a SolidSyslogNorFlashBlockDevice marks a record sent, and advances a block's state, by clearing further bits in place.
Public Attributes Documentation¶
Erase¶
GetBlockCount¶
Blocks in the flash; fixed for the flash's lifetime.
GetBlockSize¶
Bytes in a block; fixed for the flash's lifetime.
Program¶
bool(* SolidSyslogNorFlash::Program) (struct SolidSyslogNorFlash *base, size_t blockIndex, size_t offset, const void *buffer, size_t count);
Read¶
bool(* SolidSyslogNorFlash::Read) (struct SolidSyslogNorFlash *base, size_t blockIndex, size_t offset, void *buffer, size_t count);
The documentation for this class was generated from the following file Core/Interface/SolidSyslogNorFlashDefinition.h