Overview   API Reference  

block_driver Struct Reference

Interface defining routines to access block devices (or to act as a block device). More...

#include <block_driver.hpp>

Inheritance diagram for block_driver:

Inheritance graph
[legend]
Collaboration diagram for block_driver:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~block_driver (void)
 Empty virtual destructor to enforce derived virtual destructors.
virtual const char * name (void) const =0
 Returns the driver's name.
virtual bool is (state_flags flags) const =0
 Returns whether a specific feature/state (or all) is currently present/active.
virtual const state_flags state (void) const =0
 Returns all feature/state flags at once.
virtual int reset (void)=0
 Resets the driver's state back to defaults as when powering up the machine.
virtual l4_sector_t sectors (void) const =0
 Returns the number of disk sectors the underlying medium (e.g a file) provides.
virtual int read_sectors (uint8_t *buffer, l4_sector_t sector, l4_sector_t number)=0
 Reads (from disk) the specified number of sectors starting at the specified sector (inclusive) into the specified data buffer (which must be big enough).
virtual int write_sectors (uint8_t *buffer, l4_sector_t sector, l4_sector_t number)=0
 Writes (to disk) the specified number of sectors starting at the specified sector (inclusive) from the specified data buffer (which must be big enough).
virtual int flush_sectors (void)=0
 Flushes all currently pending operations.


Detailed Description

Interface defining routines to access block devices (or to act as a block device).

Member Function Documentation

virtual int block_driver::reset ( void   )  [pure virtual]

Resets the driver's state back to defaults as when powering up the machine.

Returns 0 on success. Negative error codes otherwise.

Implemented in block_driver_base, and partition_driver.

Referenced by partition_driver::reset().

virtual int block_driver::read_sectors ( uint8_t *  buffer,
l4_sector_t  sector,
l4_sector_t  number 
) [pure virtual]

Reads (from disk) the specified number of sectors starting at the specified sector (inclusive) into the specified data buffer (which must be big enough).

Returns 0 on success. Negative error codes otherwise.

Implemented in memory_image, partition_driver, raw_image, and windhoek_driver.

Referenced by partition_driver::read_write_sectors().

virtual int block_driver::write_sectors ( uint8_t *  buffer,
l4_sector_t  sector,
l4_sector_t  number 
) [pure virtual]

Writes (to disk) the specified number of sectors starting at the specified sector (inclusive) from the specified data buffer (which must be big enough).

Returns 0 on success. Negative error codes otherwise.

Implemented in memory_image, partition_driver, raw_image, and windhoek_driver.

Referenced by partition_driver::read_write_sectors().

virtual int block_driver::flush_sectors ( void   )  [pure virtual]

Flushes all currently pending operations.

That is requests to write to the backend, if the driver provides some mechanism to cache blocks. Returns 0 on success. Negative error codes otherwise.

Implemented in block_driver_base, partition_driver, and raw_image.

Referenced by partition_driver::flush_sectors().


The documentation for this struct was generated from the following file:

L4vmm Reference Manual, written by Mario Schwalbe  © 2006-2008