diff options
author | Alexander Graf <agraf@suse.de> | 2009-04-14 16:24:15 +0200 |
---|---|---|
committer | hyokeun <hyokeun.jeon@samsung.com> | 2016-09-06 15:55:30 +0900 |
commit | ac67f1819a2a2db413435df6f43ae48ecf9ae97e (patch) | |
tree | b5fd683b999af7432c223d581b4775797a32ccf8 | |
parent | 234f1b3d2a96cc146d258463f3497a31f5cf134f (diff) | |
download | qemu-ac67f1819a2a2db413435df6f43ae48ecf9ae97e.tar.gz qemu-ac67f1819a2a2db413435df6f43ae48ecf9ae97e.tar.bz2 qemu-ac67f1819a2a2db413435df6f43ae48ecf9ae97e.zip |
qemu-cvs-alsa_mmap
Hack to prevent ALSA from using mmap() interface to simplify emulation.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Ulrich Hecht <uli@suse.de>
-rw-r--r-- | linux-user/mmap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c index c4371d943..68a655e63 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -357,6 +357,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size) } } +#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000 +#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000 + /* NOTE: all the constants are the HOST ones */ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, int flags, int fd, abi_ulong offset) @@ -391,6 +394,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, } #endif + /* Alsa tries to communcate with the kernel via mmap. This usually + * is a good idea when user- and kernelspace are running on the + * same architecture but does not work out when not. To make alsa + * not to use mmap, we can just have it fail on the mmap calls that + * would initiate this. + */ + if(offset == SNDRV_PCM_MMAP_OFFSET_STATUS || offset == SNDRV_PCM_MMAP_OFFSET_CONTROL) { + errno = EINVAL; + return -1; + } + if (offset & ~TARGET_PAGE_MASK) { errno = EINVAL; goto fail; |