2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-14 23:31:39 +00:00

Defined a block device interface.

This commit is contained in:
Michael Brown 2006-05-13 11:36:30 +00:00
parent 1838b58c3f
commit 8638a5e471

View File

@ -0,0 +1,39 @@
#ifndef _GPXE_BLOCKDEV_H
#define _GPXE_BLOCKDEV_H
/**
* @file
*
* Block devices
*
*/
/** A block device */
struct block_device {
/** Block size */
size_t blksize;
/** Total number of blocks */
uint64_t blocks;
/**
* Read block
*
* @v blockdev Block device
* @v block Block number
* @v buffer Data buffer
* @ret rc Return status code
*/
int ( * read ) ( struct block_device *blockdev, uint64_t block,
void *buffer );
/**
* Write block
*
* @v blockdev Block device
* @v block Block number
* @v buffer Data buffer
* @ret rc Return status code
*/
int ( * write ) ( struct block_device *blockdev, uint64_t block,
const void *buffer );
};
#endif /* _GPXE_BLOCKDEV_H */