summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/blockdev.h
diff options
context:
space:
mode:
authorMichael Brown2006-05-19 17:06:51 +0200
committerMichael Brown2006-05-19 17:06:51 +0200
commitd48d0fb1bb53262bf44a03dbe8388529f1566a1c (patch)
tree31081f33dbeb48c42d2e4cf806570853162781d9 /src/include/gpxe/blockdev.h
parentUse typeof(sizeof(...)) to define a size_t. This stops gcc complaining (diff)
downloadipxe-d48d0fb1bb53262bf44a03dbe8388529f1566a1c.tar.gz
ipxe-d48d0fb1bb53262bf44a03dbe8388529f1566a1c.tar.xz
ipxe-d48d0fb1bb53262bf44a03dbe8388529f1566a1c.zip
Add the concept of a "user pointer" (similar to the void __user * in
the kernel), which encapsulates the information needed to refer to an external buffer. Under normal operation, this can just be a void * equivalent, but under -DKEEP_IT_REAL it would be a segoff_t equivalent. Use this concept to avoid the need for bounce buffers in int13.c, which reduces memory usage and opens up the possibility of using multi-sector reads. Extend the block-device API and the SCSI block device implementation to support multi-sector reads. Update iscsi.c to use user buffers. Move the obsolete portions of realmode.h to old_realmode.h. MS-DOS now boots an order of magnitude faster over iSCSI (~10 seconds from power-up to C:> prompt in bochs).
Diffstat (limited to 'src/include/gpxe/blockdev.h')
-rw-r--r--src/include/gpxe/blockdev.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/gpxe/blockdev.h b/src/include/gpxe/blockdev.h
index 59f5bf746..467ed1d9d 100644
--- a/src/include/gpxe/blockdev.h
+++ b/src/include/gpxe/blockdev.h
@@ -8,6 +8,8 @@
*
*/
+#include <gpxe/uaccess.h>
+
/** A block device */
struct block_device {
/** Block size */
@@ -19,21 +21,23 @@ struct block_device {
*
* @v blockdev Block device
* @v block Block number
+ * @v count Block count
* @v buffer Data buffer
* @ret rc Return status code
*/
int ( * read ) ( struct block_device *blockdev, uint64_t block,
- void *buffer );
+ unsigned long count, userptr_t buffer );
/**
* Write block
*
* @v blockdev Block device
* @v block Block number
+ * @v count Block count
* @v buffer Data buffer
* @ret rc Return status code
*/
int ( * write ) ( struct block_device *blockdev, uint64_t block,
- const void *buffer );
+ unsigned long count, userptr_t buffer );
};
#endif /* _GPXE_BLOCKDEV_H */