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:
parent
1838b58c3f
commit
8638a5e471
39
src/include/gpxe/blockdev.h
Normal file
39
src/include/gpxe/blockdev.h
Normal 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 */
|
Loading…
Reference in New Issue
Block a user