diff options
author | Michael Brown | 2012-11-05 17:09:38 +0100 |
---|---|---|
committer | Michael Brown | 2012-11-05 17:15:14 +0100 |
commit | 1494d41d0a20a1facff7558ff825a2681b419e9d (patch) | |
tree | 63950ade91da20fa06e2b47429dea8433625f441 /src/arch/i386/include/librm.h | |
parent | [list] Reduce overall code size by externalising many list functions (diff) | |
download | ipxe-1494d41d0a20a1facff7558ff825a2681b419e9d.tar.gz ipxe-1494d41d0a20a1facff7558ff825a2681b419e9d.tar.xz ipxe-1494d41d0a20a1facff7558ff825a2681b419e9d.zip |
[uaccess] Add userptr_sub() to find the difference between two user pointers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/include/librm.h')
-rw-r--r-- | src/arch/i386/include/librm.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h index c6992f64..801f586b 100644 --- a/src/arch/i386/include/librm.h +++ b/src/arch/i386/include/librm.h @@ -68,6 +68,12 @@ UACCESS_INLINE ( librm, userptr_add ) ( userptr_t userptr, off_t offset ) { return trivial_userptr_add ( userptr, offset ); } +static inline __always_inline off_t +UACCESS_INLINE ( librm, userptr_sub ) ( userptr_t userptr, + userptr_t subtrahend ) { + return trivial_userptr_sub ( userptr, subtrahend ); +} + static inline __always_inline void UACCESS_INLINE ( librm, memcpy_user ) ( userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, |