summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2025-04-24 18:11:30 +0200
committerMichael Brown2025-04-24 18:11:30 +0200
commit2f11f466e6b6cb47ac3b703b145e01f87bf8092e (patch)
tree48ca106e7c8d7f42c504af9447dff713099d1339 /src/include
parent[uaccess] Remove now-obsolete memchr_user() (diff)
downloadipxe-2f11f466e6b6cb47ac3b703b145e01f87bf8092e.tar.gz
ipxe-2f11f466e6b6cb47ac3b703b145e01f87bf8092e.tar.xz
ipxe-2f11f466e6b6cb47ac3b703b145e01f87bf8092e.zip
[block] Remove userptr_t from block device abstraction
Simplify the block device code by assuming that all read/write buffers are directly accessible via pointer dereferences. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/ata.h5
-rw-r--r--src/include/ipxe/blockdev.h13
-rw-r--r--src/include/ipxe/blocktrans.h7
-rw-r--r--src/include/ipxe/sanboot.h4
-rw-r--r--src/include/ipxe/scsi.h5
5 files changed, 15 insertions, 19 deletions
diff --git a/src/include/ipxe/ata.h b/src/include/ipxe/ata.h
index a10cfafcc..cd78cd795 100644
--- a/src/include/ipxe/ata.h
+++ b/src/include/ipxe/ata.h
@@ -2,7 +2,6 @@
#define _IPXE_ATA_H
#include <stdint.h>
-#include <ipxe/uaccess.h>
#include <ipxe/interface.h>
/** @file
@@ -173,7 +172,7 @@ struct ata_cmd {
* If non-NULL, this buffer must be ata_command::cb::count
* sectors in size.
*/
- userptr_t data_out;
+ void *data_out;
/** Data-out buffer length
*
* Must be zero if @c data_out is NULL
@@ -184,7 +183,7 @@ struct ata_cmd {
* If non-NULL, this buffer must be ata_command::cb::count
* sectors in size.
*/
- userptr_t data_in;
+ void *data_in;
/** Data-in buffer length
*
* Must be zero if @c data_in is NULL
diff --git a/src/include/ipxe/blockdev.h b/src/include/ipxe/blockdev.h
index 418c43004..ef6fc8d5a 100644
--- a/src/include/ipxe/blockdev.h
+++ b/src/include/ipxe/blockdev.h
@@ -11,7 +11,6 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
-#include <ipxe/uaccess.h>
#include <ipxe/interface.h>
/** Block device capacity */
@@ -25,20 +24,20 @@ struct block_device_capacity {
};
extern int block_read ( struct interface *control, struct interface *data,
- uint64_t lba, unsigned int count,
- userptr_t buffer, size_t len );
+ uint64_t lba, unsigned int count, void *buffer,
+ size_t len );
#define block_read_TYPE( object_type ) \
typeof ( int ( object_type, struct interface *data, \
uint64_t lba, unsigned int count, \
- userptr_t buffer, size_t len ) )
+ void *buffer, size_t len ) )
extern int block_write ( struct interface *control, struct interface *data,
- uint64_t lba, unsigned int count,
- userptr_t buffer, size_t len );
+ uint64_t lba, unsigned int count, void *buffer,
+ size_t len );
#define block_write_TYPE( object_type ) \
typeof ( int ( object_type, struct interface *data, \
uint64_t lba, unsigned int count, \
- userptr_t buffer, size_t len ) )
+ void *buffer, size_t len ) )
extern int block_read_capacity ( struct interface *control,
struct interface *data );
diff --git a/src/include/ipxe/blocktrans.h b/src/include/ipxe/blocktrans.h
index fee71b96c..1167a256e 100644
--- a/src/include/ipxe/blocktrans.h
+++ b/src/include/ipxe/blocktrans.h
@@ -13,7 +13,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/refcnt.h>
#include <ipxe/interface.h>
#include <ipxe/xferbuf.h>
-#include <ipxe/uaccess.h>
/** A block device translator */
struct block_translator {
@@ -27,12 +26,12 @@ struct block_translator {
/** Data transfer buffer */
struct xfer_buffer xferbuf;
/** Data buffer */
- userptr_t buffer;
+ void *buffer;
/** Block size */
size_t blksize;
};
-extern int block_translate ( struct interface *block,
- userptr_t buffer, size_t size );
+extern int block_translate ( struct interface *block, void *buffer,
+ size_t size );
#endif /* _IPXE_BLOCKTRANS_H */
diff --git a/src/include/ipxe/sanboot.h b/src/include/ipxe/sanboot.h
index e44367cdb..9d5fceee0 100644
--- a/src/include/ipxe/sanboot.h
+++ b/src/include/ipxe/sanboot.h
@@ -261,9 +261,9 @@ extern struct san_device * sandev_next ( unsigned int drive );
extern int sandev_reopen ( struct san_device *sandev );
extern int sandev_reset ( struct san_device *sandev );
extern int sandev_read ( struct san_device *sandev, uint64_t lba,
- unsigned int count, userptr_t buffer );
+ unsigned int count, void *buffer );
extern int sandev_write ( struct san_device *sandev, uint64_t lba,
- unsigned int count, userptr_t buffer );
+ unsigned int count, void *buffer );
extern struct san_device * alloc_sandev ( struct uri **uris, unsigned int count,
size_t priv_size );
extern int register_sandev ( struct san_device *sandev, unsigned int drive,
diff --git a/src/include/ipxe/scsi.h b/src/include/ipxe/scsi.h
index 28b55b2d5..9bb38a059 100644
--- a/src/include/ipxe/scsi.h
+++ b/src/include/ipxe/scsi.h
@@ -2,7 +2,6 @@
#define _IPXE_SCSI_H
#include <stdint.h>
-#include <ipxe/uaccess.h>
#include <ipxe/interface.h>
/** @file
@@ -252,14 +251,14 @@ struct scsi_cmd {
/** CDB for this command */
union scsi_cdb cdb;
/** Data-out buffer (may be NULL) */
- userptr_t data_out;
+ void *data_out;
/** Data-out buffer length
*
* Must be zero if @c data_out is NULL
*/
size_t data_out_len;
/** Data-in buffer (may be NULL) */
- userptr_t data_in;
+ void *data_in;
/** Data-in buffer length
*
* Must be zero if @c data_in is NULL