On 24 November 2011 23:43, Alexander Graf <ag...@suse.de> wrote:
> ---
>
> v1 -> v2:
>
>  - make prettier by just wrapping mmap in linux-user/mmap.c

Hmm. I prefer the non-wrapped version :-)
In particular, qemu_mmap() implies that (like other qemu_foo
wrappers) this is a portability wrapper that should be used for
all mmap calls. But actually we only want to apply MAP_32BIT
for those mmap()s which are mmapping guest memory requests.
So just having an extra flag in the cases where we need the
flag seems more straightforward.

I'd prefer a

#if defined(MAP_32BIT) && defined(__x86_64__) && (TARGET_LONG_BITS == 32)
#define QEMU_MAP_32BIT MAP_32BIT
#else
#define QEMU_MAP_32BIT 0
#endif

and then use QEMU_MAP_32BIT. (That way it's obvious when you're
looking at the mmap() calls that they're not using the host's
MAP_32BIT but something that might be different.)

-- PMM

Reply via email to