* [PATCH] mini-os: convert mlock macros to C functions
@ 2012-01-29 12:04 Olaf Hering
0 siblings, 0 replies; only message in thread
From: Olaf Hering @ 2012-01-29 12:04 UTC (permalink / raw)
To: xen-devel
# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# 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 <olaf@aepfle.de>
diff -r 34cf64e8b3f0 -r b64564ad67eb extras/mini-os/include/posix/sys/mman.h
--- a/extras/mini-os/include/posix/sys/mman.h
+++ b/extras/mini-os/include/posix/sys/mman.h
@@ -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 */
diff -r 34cf64e8b3f0 -r b64564ad67eb tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -106,7 +106,7 @@ static void *linux_privcmd_alloc_hyperca
static 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);
}
diff -r 34cf64e8b3f0 -r b64564ad67eb tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c
+++ b/tools/libxc/xc_mem_paging.c
@@ -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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-29 12:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-29 12:04 [PATCH] mini-os: convert mlock macros to C functions Olaf Hering
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).