diff options
author | Michael Brown | 2007-07-06 14:07:10 +0200 |
---|---|---|
committer | Michael Brown | 2007-07-06 14:07:10 +0200 |
commit | f660e8ef584e55924762ae49f5e500b55da2b74c (patch) | |
tree | 2df3aef5ce9a243fb718277d9a5325a600f942fc /src | |
parent | Add .pdsk target (padded .dsk, suitable for qemu). (diff) | |
download | ipxe-f660e8ef584e55924762ae49f5e500b55da2b74c.tar.gz ipxe-f660e8ef584e55924762ae49f5e500b55da2b74c.tar.xz ipxe-f660e8ef584e55924762ae49f5e500b55da2b74c.zip |
Add strlen_user() (will be needed for PXE API extensions)
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/i386/include/librm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h index 31bafb3e..9e9498cb 100644 --- a/src/arch/i386/include/librm.h +++ b/src/arch/i386/include/librm.h @@ -194,6 +194,18 @@ memset_user ( userptr_t buffer, off_t offset, int c, size_t len ) { } /** + * Find length of NUL-terminated string in user buffer + * + * @v buffer User buffer + * @v offset Offset within buffer + * @ret len Length of string (excluding NUL) + */ +static inline __attribute__ (( always_inline )) size_t +strlen_user ( userptr_t buffer, off_t offset ) { + return strlen ( ( void * ) buffer + offset ); +} + +/** * Convert virtual address to user buffer * * @v virtual Virtual address |