Patchwork bsd-user: avoid conflict with qemu_vmalloc

login
register
mail settings
Submitter Blue Swirl
Date Jan. 19, 2013, 10:19 a.m.
Message ID <fe536a4e379fb0bf0ebced0b7286189f5560e7ca.1358590761.git.blauwirbel@gmail.com>
Download mbox | patch
Permalink /patch/213815/
State New
Headers show

Comments

Blue Swirl - Jan. 19, 2013, 10:19 a.m.
Rename qemu_vmalloc() to bsd_vmalloc(), adjust the only user.

Remove #ifdeffery in oslib-posix.c.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 bsd-user/mmap.c    |    4 ++--
 util/oslib-posix.c |    3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
Andreas Färber - Jan. 20, 2013, 7:28 a.m.
Am 19.01.2013 11:19, schrieb Blue Swirl:
> Rename qemu_vmalloc() to bsd_vmalloc(), adjust the only user.
> 
> Remove #ifdeffery in oslib-posix.c.
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

Tested-by: Andreas Färber <andreas.faerber@web.de>

Fixes the build on OpenBSD 5.2 for me.

Thanks,
Andreas

Patch

diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 5d6cffc..aae8ea1 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -74,7 +74,7 @@  void mmap_unlock(void)
 }
 #endif
 
-void *qemu_vmalloc(size_t size)
+static void *bsd_vmalloc(size_t size)
 {
     void *p;
     mmap_lock();
@@ -98,7 +98,7 @@  void *g_malloc(size_t size)
 {
     char * p;
     size += 16;
-    p = qemu_vmalloc(size);
+    p = bsd_vmalloc(size);
     *(size_t *)p = size;
     return p + 16;
 }
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 4f5ec67..b4152fb 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -105,8 +105,6 @@  void *qemu_memalign(size_t alignment, size_t size)
     return ptr;
 }
 
-/* conflicts with qemu_vmalloc in bsd-user/mmap.c */
-#if !defined(CONFIG_BSD_USER)
 /* alloc shared memory pages */
 void *qemu_vmalloc(size_t size)
 {
@@ -129,7 +127,6 @@  void *qemu_vmalloc(size_t size)
     trace_qemu_vmalloc(size, ptr);
     return ptr;
 }
-#endif
 
 void qemu_vfree(void *ptr)
 {