Browse Source

Defined a block device interface.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
8638a5e471
1 changed files with 39 additions and 0 deletions
  1. 39
    0
      src/include/gpxe/blockdev.h

+ 39
- 0
src/include/gpxe/blockdev.h View File

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

Loading…
Cancel
Save