1 #ifndef _IPXE_LINUX_UACCESS_H 2 #define _IPXE_LINUX_UACCESS_H 22 #define UACCESS_PREFIX_linux 24 #define UACCESS_PREFIX_linux __linux_ 46 return ( userptr +
offset );
106 int c,
size_t len ) {
117 int c,
size_t len ) {
static __always_inline size_t trivial_strlen_user(userptr_t buffer, off_t offset)
Find length of NUL-terminated string in user buffer.
static __always_inline void off_t userptr_t off_t src_off
static __always_inline void off_t dest_off
static __always_inline int trivial_memcmp_user(userptr_t first, off_t first_off, userptr_t second, off_t second_off, size_t len)
Compare data between user buffers.
uint32_t first
First block in range.
static __always_inline void * trivial_user_to_virt(userptr_t userptr, off_t offset)
Convert user pointer to virtual address.
off_t memchr_user(userptr_t userptr, off_t offset, int c, size_t len)
Find character in user buffer.
unsigned long user_to_phys(userptr_t userptr, off_t offset)
Convert user pointer to physical address.
static __always_inline int off_t first_off
static __always_inline userptr_t trivial_userptr_add(userptr_t userptr, off_t offset)
Add offset to user pointer.
userptr_t phys_to_user(unsigned long phys_addr)
Convert physical address to user pointer.
static __always_inline void trivial_memmove_user(userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, size_t len)
Copy data between user buffers, allowing for overlap.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
static __always_inline off_t trivial_memchr_user(userptr_t buffer, off_t offset, int c, size_t len)
Find character in user buffer.
static __always_inline void off_t userptr_t off_t size_t len
off_t userptr_sub(userptr_t userptr, userptr_t subtrahend)
Subtract user pointers.
void memset_user(userptr_t userptr, off_t offset, int c, size_t len)
Fill user buffer with a constant byte.
userptr_t userptr_add(userptr_t userptr, off_t offset)
Add offset to user pointer.
uint32_t userptr_t
A pointer to a user buffer.
static __always_inline void off_t int c
static __always_inline unsigned long UACCESS_INLINE(linux, user_to_phys)(userptr_t userptr
Convert user pointer to physical address.
#define __always_inline
Declare a function to be always inline.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static __always_inline int off_t userptr_t off_t second_off
static __always_inline off_t trivial_userptr_sub(userptr_t userptr, userptr_t subtrahend)
Subtract user pointers.
size_t strlen_user(userptr_t userptr, off_t offset)
Find length of NUL-terminated string in user buffer.
static __always_inline off_t userptr_t subtrahend
int memcmp_user(userptr_t first, off_t first_off, userptr_t second, off_t second_off, size_t len)
Compare data between user buffers.
static __always_inline void trivial_memcpy_user(userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, size_t len)
Copy data between user buffers.
userptr_t virt_to_user(volatile const void *addr)
Convert virtual address to user pointer.
void * user_to_virt(userptr_t userptr, off_t offset)
Convert user pointer to virtual address.
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
void memmove_user(userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, size_t len)
Copy data between user buffers, allowing for overlap.
static __always_inline userptr_t trivial_virt_to_user(volatile const void *addr)
Convert virtual address to user pointer.
static __always_inline int off_t userptr_t second
static __always_inline void off_t userptr_t src
void memcpy_user(userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, size_t len)
Copy data between user buffers.
static __always_inline unsigned long off_t offset
static __always_inline void trivial_memset_user(userptr_t buffer, off_t offset, int c, size_t len)
Fill user buffer with a constant byte.