summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2007-07-06 14:07:10 +0200
committerMichael Brown2007-07-06 14:07:10 +0200
commitf660e8ef584e55924762ae49f5e500b55da2b74c (patch)
tree2df3aef5ce9a243fb718277d9a5325a600f942fc /src
parentAdd .pdsk target (padded .dsk, suitable for qemu). (diff)
downloadipxe-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.h12
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