david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Defined a block device interface.

This commit is contained in:
Michael Brown 2006-05-13 11:36:30 +00:00
parent 1838b58c3f
commit 8638a5e471
1 changed files with 39 additions and 0 deletions

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 */