]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
mini-os: convert mlock macros to C functions
authorOlaf Hering <olaf@aepfle.de>
Tue, 31 Jan 2012 11:33:35 +0000 (11:33 +0000)
committerOlaf Hering <olaf@aepfle.de>
Tue, 31 Jan 2012 11:33:35 +0000 (11:33 +0000)
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>
include/posix/sys/mman.h

index 3b9ef19aa1243e8a1afe9b2cce045482cc234060..4d349792b6f9e0444a822dbc4bc4f97dff01b883 100644 (file)
@@ -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 */