Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.ramdisk

PROTOCOLS

Ramdisk

Defined in fuchsia.hardware.ramdisk/ramdisk.fidl

The protocol for interacting with a instance of a ramdisk.

GetBlockCounts

Returns the number of write requests since the last call to either "SleepAfter" or "Wake".

Request

<EMPTY>

Response

NameType
s zx/status
counts BlockWriteCounts?

Grow

Causes the ramdisk size to grow to required_size in bytes. If required_size is smaller than the current size an error will be returned. required_size must be a multiple of block_size.

Request

NameType
new_size uint64

Response

NameType
s zx/status

SetFlags

Sets any of the RAMDISK_FLAG_* flags.

Request

NameType
flags uint32

Response

NameType
s zx/status

SleepAfter

Causes the ramdisk to sleep after count blocks are written successfully. After count blocks are written, requests either wait for the ramdisk to be awoken (if RESUME_ON_WAKE has been set), or begin failing immediately.

Resets the block counts being stored by the ramdisk.

Request

NameType
count uint64

Response

NameType
s zx/status

Wake

Wakes a ramdisk, if it was sleeping.

Resets the block counts being stored by the ramdisk.

Request

<EMPTY>

Response

NameType
s zx/status

RamdiskController

Defined in fuchsia.hardware.ramdisk/ramdisk.fidl

Create

Initializes a new Ramdisk instance with the provided block size and block count. Takes an optional type_guid, which may be queried from the ramdisk instance.

Request

NameType
block_size uint64
block_count uint64
type_guid GUID?

Response

NameType
s zx/status
name string[32]?

CreateFromVmo

Initializes a new Ramdisk instance from a VMO. Uses a block size of PAGE_SIZE, and derives the block count from the size of the VMO.

Request

NameType
vmo handle<vmo>

Response

NameType
s zx/status
name string[32]?

CreateFromVmoWithBlockSize

Request

NameType
vmo handle<vmo>
block_size uint64

Response

NameType
s zx/status
name string[32]?

STRUCTS

BlockWriteCounts

Defined in fuchsia.hardware.ramdisk/ramdisk.fidl

Counters for the number of write requests since the last call to either "SleepAfter" or "Wake". All units are in individual blocks.

NameTypeDescriptionDefault
received uint64 No default
successful uint64 No default
failed uint64 No default

GUID

Defined in fuchsia.hardware.ramdisk/ramdisk.fidl

An array of bytes interpreted as a GUID. Wrapped in a struct to allow optional GUIDs.

NameTypeDescriptionDefault
value uint8[16] No default

CONSTANTS

NameValueTypeDescription
GUID_LEN 16 uint32

Matches the value of ZBI_PARTITION_GUID_LEN.

MAX_NAME_LENGTH 32 uint32
RAMDISK_FLAG_DISCARD_NOT_FLUSHED_ON_WAKE 2 uint32
RAMDISK_FLAG_DISCARD_RANDOM 4 uint32
RAMDISK_FLAG_RESUME_ON_WAKE 1 uint32

Identifies if requests which are sent ot the ramdisk while it is considered "asleep" should be processed when the ramdisk wakes up. If this flag is not set, those requests are failed immediately.