2006-05-13 11:36:30 +00:00
|
|
|
#ifndef _GPXE_BLOCKDEV_H
|
|
|
|
#define _GPXE_BLOCKDEV_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Block devices
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-05-19 15:06:51 +00:00
|
|
|
#include <gpxe/uaccess.h>
|
|
|
|
|
2006-05-13 11:36:30 +00:00
|
|
|
/** 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
|
2006-05-19 15:06:51 +00:00
|
|
|
* @v count Block count
|
2006-05-13 11:36:30 +00:00
|
|
|
* @v buffer Data buffer
|
|
|
|
* @ret rc Return status code
|
|
|
|
*/
|
|
|
|
int ( * read ) ( struct block_device *blockdev, uint64_t block,
|
2006-05-19 15:06:51 +00:00
|
|
|
unsigned long count, userptr_t buffer );
|
2006-05-13 11:36:30 +00:00
|
|
|
/**
|
|
|
|
* Write block
|
|
|
|
*
|
|
|
|
* @v blockdev Block device
|
|
|
|
* @v block Block number
|
2006-05-19 15:06:51 +00:00
|
|
|
* @v count Block count
|
2006-05-13 11:36:30 +00:00
|
|
|
* @v buffer Data buffer
|
|
|
|
* @ret rc Return status code
|
|
|
|
*/
|
|
|
|
int ( * write ) ( struct block_device *blockdev, uint64_t block,
|
2006-05-19 15:06:51 +00:00
|
|
|
unsigned long count, userptr_t buffer );
|
2006-05-13 11:36:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _GPXE_BLOCKDEV_H */
|