[contrib] Allow Network Protocol header to display in rom-o-matic
[gpxe.git] / src / include / gpxe / blockdev.h
blobcf28524de0d04e751ee4bc30f7b949090ed50962
1 #ifndef _GPXE_BLOCKDEV_H
2 #define _GPXE_BLOCKDEV_H
4 /**
5 * @file
7 * Block devices
9 */
11 FILE_LICENCE ( GPL2_OR_LATER );
13 #include <gpxe/uaccess.h>
15 struct block_device;
17 /** Block device operations */
18 struct block_device_operations {
19 /**
20 * Read block
22 * @v blockdev Block device
23 * @v block Block number
24 * @v count Block count
25 * @v buffer Data buffer
26 * @ret rc Return status code
28 int ( * read ) ( struct block_device *blockdev, uint64_t block,
29 unsigned long count, userptr_t buffer );
30 /**
31 * Write block
33 * @v blockdev Block device
34 * @v block Block number
35 * @v count Block count
36 * @v buffer Data buffer
37 * @ret rc Return status code
39 int ( * write ) ( struct block_device *blockdev, uint64_t block,
40 unsigned long count, userptr_t buffer );
43 /** A block device */
44 struct block_device {
45 /** Block device operations */
46 struct block_device_operations *op;
47 /** Block size */
48 size_t blksize;
49 /** Total number of blocks */
50 uint64_t blocks;
53 #endif /* _GPXE_BLOCKDEV_H */