Defined a block device interface.
authorMichael Brown <mcb30@etherboot.org>
Sat, 13 May 2006 11:36:30 +0000 (11:36 +0000)
committerMichael Brown <mcb30@etherboot.org>
Sat, 13 May 2006 11:36:30 +0000 (11:36 +0000)
src/include/gpxe/blockdev.h [new file with mode: 0644]

diff --git a/src/include/gpxe/blockdev.h b/src/include/gpxe/blockdev.h
new file mode 100644 (file)
index 0000000..59f5bf7
--- /dev/null
@@ -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 */