|
@@ -0,0 +1,39 @@
|
|
1
|
+#ifndef _GPXE_BLOCKDEV_H
|
|
2
|
+#define _GPXE_BLOCKDEV_H
|
|
3
|
+
|
|
4
|
+/**
|
|
5
|
+ * @file
|
|
6
|
+ *
|
|
7
|
+ * Block devices
|
|
8
|
+ *
|
|
9
|
+ */
|
|
10
|
+
|
|
11
|
+/** A block device */
|
|
12
|
+struct block_device {
|
|
13
|
+ /** Block size */
|
|
14
|
+ size_t blksize;
|
|
15
|
+ /** Total number of blocks */
|
|
16
|
+ uint64_t blocks;
|
|
17
|
+ /**
|
|
18
|
+ * Read block
|
|
19
|
+ *
|
|
20
|
+ * @v blockdev Block device
|
|
21
|
+ * @v block Block number
|
|
22
|
+ * @v buffer Data buffer
|
|
23
|
+ * @ret rc Return status code
|
|
24
|
+ */
|
|
25
|
+ int ( * read ) ( struct block_device *blockdev, uint64_t block,
|
|
26
|
+ void *buffer );
|
|
27
|
+ /**
|
|
28
|
+ * Write block
|
|
29
|
+ *
|
|
30
|
+ * @v blockdev Block device
|
|
31
|
+ * @v block Block number
|
|
32
|
+ * @v buffer Data buffer
|
|
33
|
+ * @ret rc Return status code
|
|
34
|
+ */
|
|
35
|
+ int ( * write ) ( struct block_device *blockdev, uint64_t block,
|
|
36
|
+ const void *buffer );
|
|
37
|
+};
|
|
38
|
+
|
|
39
|
+#endif /* _GPXE_BLOCKDEV_H */
|