mirror of
https://github.com/ipxe/ipxe
synced 2026-05-18 10:00:30 +03:00
[uaccess] Remove redundant copy_from_user() and copy_to_user()
Remove the now-redundant copy_from_user() and copy_to_user() wrapper functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define DUMMY_INX( _prefix, _suffix, _type ) \
|
||||
static inline __always_inline _type \
|
||||
IOAPI_INLINE ( _prefix, in ## _suffix ) ( volatile _type *io_addr __unused) { \
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef IOMAP_VIRT
|
||||
#define IOMAP_PREFIX_virt
|
||||
#else
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <ipxe/api.h>
|
||||
#include <config/ioapi.h>
|
||||
|
||||
@@ -127,30 +126,4 @@ virt_to_phys ( volatile const void *virt );
|
||||
*/
|
||||
void * __attribute__ (( const )) phys_to_virt ( physaddr_t phys );
|
||||
|
||||
/**
|
||||
* Copy data to user buffer
|
||||
*
|
||||
* @v dest Destination
|
||||
* @v dest_off Destination offset
|
||||
* @v src Source
|
||||
* @v len Length
|
||||
*/
|
||||
static inline __always_inline void
|
||||
copy_to_user ( userptr_t dest, off_t dest_off, const void *src, size_t len ) {
|
||||
memcpy ( ( dest + dest_off ), src, len );
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy data from user buffer
|
||||
*
|
||||
* @v dest Destination
|
||||
* @v src Source
|
||||
* @v src_off Source offset
|
||||
* @v len Length
|
||||
*/
|
||||
static inline __always_inline void
|
||||
copy_from_user ( void *dest, userptr_t src, off_t src_off, size_t len ) {
|
||||
memcpy ( dest, ( src + src_off ), len );
|
||||
}
|
||||
|
||||
#endif /* _IPXE_UACCESS_H */
|
||||
|
||||
Reference in New Issue
Block a user