mini-os: convert mlock macros to C functions
PATCH 1/1 mini-os: convert mlock macros to C functions
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1327838577 -3600
# Node ID b64564ad67ebbbf5ebfceabbd0afa281d950f9a3 # Parent 34cf64e8b3f099a556b670ca96e0f3f695557a11
mini-os: convert mlock macros to C functions
mlock and munlock are implemented as macros in mini-os. Their usage requires casting in common code. Convert them to C syntax and provide an empty dummy function. Remove the now unneeded (void) cast from two munlock calls.
Signed-off-by Olaf Hering <[email protected]>
extras/mini-os/include/posix/sys/mman.h +2 -2
@@ -16,7 +16,7 @@void *mmap (void *start,size_t length,int prot,int flags,int fd,off_t offset) asm("mmap64" );int munmap (void *start,size_t length); -#define munlock (addr, len) ((void)(addr), (void)(len), 0) -#define mlock (addr, len) ((void)(addr), (void)(len), 0) +static inline mlock(const void *addr, size_t len) { return 0; } +static inline munlock(const void *addr, size_t len) { return 0; }#endif /* _POSIX_SYS_MMAN_H */
tools/libxc/xc_linux_osdep.c +1 -1
@@ -106,7 +106,7 @@ static void *linux_privcmd_alloc_hypercastatic void linux_privcmd_free_hypercall_buffer (xc_interface *xch,xc_osdep_handle h,void *ptr,int npages) { - (void )munlock (ptr, npages *XC_PAGE_SIZE ); +munlock (ptr, npages *XC_PAGE_SIZE );free (ptr); }
tools/libxc/xc_mem_paging.c +1 -1
@@ -87,7 +87,7 @@ int xc_mem_paging_load(xc_interface *xch buffer, NULL, gfn); old_errno = errno; - (void )munlock (buffer,XC_PAGE_SIZE ); +munlock (buffer,XC_PAGE_SIZE ); errno = old_errno;return rc;