summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2009-04-14 14:24:15 (GMT)
committerYury Usishchev <y.usishchev@samsung.com>2014-12-10 10:47:57 (GMT)
commit627d4a022152ca0bed14df7288822a9ec0c19a68 (patch)
tree4bebb326da7a15f0f9a9b863ab45a32ff7344899
parent489213c69537697507d200200f5e5f7d3008098a (diff)
downloadqemu-627d4a022152ca0bed14df7288822a9ec0c19a68.zip
qemu-627d4a022152ca0bed14df7288822a9ec0c19a68.tar.gz
qemu-627d4a022152ca0bed14df7288822a9ec0c19a68.tar.bz2
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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index a249f0c..34a5615 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -366,6 +366,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)
@@ -400,6 +403,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;