david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Add strlen_user() (will be needed for PXE API extensions)

This commit is contained in:
Michael Brown 2007-07-06 13:07:10 +01:00
parent 763a3eab8a
commit f660e8ef58
1 changed files with 12 additions and 0 deletions

View File

@ -193,6 +193,18 @@ memset_user ( userptr_t buffer, off_t offset, int c, size_t len ) {
memset ( ( ( void * ) buffer + offset ), c, 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
*