2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-14 07:11:32 +00:00

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

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
*