Struct capsules::nonvolatile_storage_driver::NonvolatileStorage
[−]
[src]
pub struct NonvolatileStorage<'a> { driver: &'a NonvolatileStorage, apps: Grant<App>, buffer: TakeCell<'static, [u8]>, current_user: Cell<Option<NonvolatileUser>>, userspace_start_address: usize, userspace_length: usize, kernel_start_address: usize, kernel_length: usize, kernel_client: Cell<Option<&'static NonvolatileStorageClient>>, kernel_pending_command: Cell<bool>, kernel_command: Cell<NonvolatileCommand>, kernel_buffer: TakeCell<'static, [u8]>, kernel_readwrite_length: Cell<usize>, kernel_readwrite_address: Cell<usize>, }
Fields
driver: &'a NonvolatileStorage
apps: Grant<App>
buffer: TakeCell<'static, [u8]>
current_user: Cell<Option<NonvolatileUser>>
userspace_start_address: usize
userspace_length: usize
kernel_start_address: usize
kernel_length: usize
kernel_client: Cell<Option<&'static NonvolatileStorageClient>>
kernel_pending_command: Cell<bool>
kernel_command: Cell<NonvolatileCommand>
kernel_buffer: TakeCell<'static, [u8]>
kernel_readwrite_length: Cell<usize>
kernel_readwrite_address: Cell<usize>
Methods
impl<'a> NonvolatileStorage<'a>
[src]
pub fn new(
driver: &'a NonvolatileStorage,
grant: Grant<App>,
userspace_start_address: usize,
userspace_length: usize,
kernel_start_address: usize,
kernel_length: usize,
buffer: &'static mut [u8]
) -> NonvolatileStorage<'a>
[src]
driver: &'a NonvolatileStorage,
grant: Grant<App>,
userspace_start_address: usize,
userspace_length: usize,
kernel_start_address: usize,
kernel_length: usize,
buffer: &'static mut [u8]
) -> NonvolatileStorage<'a>
fn enqueue_command(
&self,
command: NonvolatileCommand,
offset: usize,
length: usize,
app_id: Option<AppId>
) -> ReturnCode
[src]
&self,
command: NonvolatileCommand,
offset: usize,
length: usize,
app_id: Option<AppId>
) -> ReturnCode
fn userspace_call_driver(
&self,
command: NonvolatileCommand,
offset: usize,
length: usize
) -> ReturnCode
[src]
&self,
command: NonvolatileCommand,
offset: usize,
length: usize
) -> ReturnCode
fn check_queue(&self)
[src]
Trait Implementations
impl<'a> NonvolatileStorageClient for NonvolatileStorage<'a>
[src]
This is the callback client for the underlying physical storage driver.
fn read_done(&self, buffer: &'static mut [u8], length: usize)
[src]
read_done
is called when the implementor is finished reading in to the buffer. The callback returns the buffer and the number of bytes that were actually read. Read more
fn write_done(&self, buffer: &'static mut [u8], length: usize)
[src]
write_done
is called when the implementor is finished writing from the buffer. The callback returns the buffer and the number of bytes that were actually written. Read more
impl<'a> NonvolatileStorage for NonvolatileStorage<'a>
[src]
Provide an interface for the kernel.
fn set_client(&self, client: &'static NonvolatileStorageClient)
[src]
fn read(
&self,
buffer: &'static mut [u8],
address: usize,
length: usize
) -> ReturnCode
[src]
&self,
buffer: &'static mut [u8],
address: usize,
length: usize
) -> ReturnCode
Read length
bytes starting at address address
in to the provided buffer. The buffer must be at least length
bytes long. The address must be in the address space of the physical storage. Read more
fn write(
&self,
buffer: &'static mut [u8],
address: usize,
length: usize
) -> ReturnCode
[src]
&self,
buffer: &'static mut [u8],
address: usize,
length: usize
) -> ReturnCode
Write length
bytes starting at address address
from the provided buffer. The buffer must be at least length
bytes long. This address must be in the address space of the physical storage. Read more
impl<'a> Driver for NonvolatileStorage<'a>
[src]
Provide an interface for userland.
fn allow(
&self,
appid: AppId,
allow_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
[src]
&self,
appid: AppId,
allow_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
Setup shared buffers.
allow_num
0
: Setup a buffer to read from the nonvolatile storage into.1
: Setup a buffer to write bytes to the nonvolatile storage.
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode
[src]
fn command(
&self,
arg0: usize,
arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode
[src]
&self,
arg0: usize,
arg1: usize,
_: usize,
appid: AppId
) -> ReturnCode
Command interface.
Commands are selected by the lowest 8 bits of the first argument.
command_num
0
: Return SUCCESS if this driver is included on the platform.1
: Return the number of bytes available to userspace.2
: Start a read from the nonvolatile storage.3
: Start a write to the nonvolatile_storage.