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

Methods

impl<'a> NonvolatileStorage<'a>
[src]

[src]

[src]

[src]

[src]

Trait Implementations

impl<'a> NonvolatileStorageClient for NonvolatileStorage<'a>
[src]

This is the callback client for the underlying physical storage driver.

[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

[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.

[src]

[src]

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

[src]

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.

[src]

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.

[src]

Setup callbacks.

subscribe_num

  • 0: Setup a read done callback.
  • 1: Setup a write done callback.

[src]

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.