[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] mini-os: convert mlock macros to C functions



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1328009615 0
# Node ID 03fdacb67f2cb76a24fd9517f1b0ea13e83973d2
# Parent  828639c20dcc9f48d155bd99ef6f963484ef7527
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@xxxxxxxxx>
---


diff -r 828639c20dcc -r 03fdacb67f2c extras/mini-os/include/posix/sys/mman.h
--- a/extras/mini-os/include/posix/sys/mman.h   Mon Jan 30 13:06:34 2012 +0100
+++ b/extras/mini-os/include/posix/sys/mman.h   Tue Jan 31 11:33:35 2012 +0000
@@ -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 828639c20dcc -r 03fdacb67f2c tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c      Mon Jan 30 13:06:34 2012 +0100
+++ b/tools/libxc/xc_linux_osdep.c      Tue Jan 31 11:33:35 2012 +0000
@@ -106,7 +106,7 @@
 
 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 828639c20dcc -r 03fdacb67f2c tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c       Mon Jan 30 13:06:34 2012 +0100
+++ b/tools/libxc/xc_mem_paging.c       Tue Jan 31 11:33:35 2012 +0000
@@ -87,7 +87,7 @@
                                 buffer, NULL, gfn);
 
     old_errno = errno;
-    (void) munlock(buffer, XC_PAGE_SIZE);
+    munlock(buffer, XC_PAGE_SIZE);
     errno = old_errno;
 
     return rc;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.