diff options
author | Michael Brown <mcb30@ipxe.org> | 2012-11-05 16:09:38 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2012-11-05 16:15:14 +0000 |
commit | 1494d41d0a20a1facff7558ff825a2681b419e9d (patch) | |
tree | 63950ade91da20fa06e2b47429dea8433625f441 /src/include/ipxe/efi | |
parent | 54a861a7bdfb2186239d520d5e4b0ce88c7604ab (diff) | |
download | ipxe-1494d41d0a20a1facff7558ff825a2681b419e9d.zip ipxe-1494d41d0a20a1facff7558ff825a2681b419e9d.tar.gz ipxe-1494d41d0a20a1facff7558ff825a2681b419e9d.tar.bz2 |
[uaccess] Add userptr_sub() to find the difference between two user pointers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi')
-rw-r--r-- | src/include/ipxe/efi/efi_uaccess.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi_uaccess.h b/src/include/ipxe/efi/efi_uaccess.h index dc226a3..79c1897 100644 --- a/src/include/ipxe/efi/efi_uaccess.h +++ b/src/include/ipxe/efi/efi_uaccess.h @@ -56,6 +56,12 @@ UACCESS_INLINE ( efi, userptr_add ) ( userptr_t userptr, off_t offset ) { return trivial_userptr_add ( userptr, offset ); } +static inline __always_inline off_t +UACCESS_INLINE ( efi, userptr_sub ) ( userptr_t userptr, + userptr_t subtrahend ) { + return trivial_userptr_sub ( userptr, subtrahend ); +} + static inline __always_inline void UACCESS_INLINE ( efi, memcpy_user ) ( userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, |