2013-02-16 15:13:11 +01:00
|
|
|
From bd87dcb81d78b92bc44d8b9675352b0f3deeb255 Mon Sep 17 00:00:00 2001
|
2011-12-11 03:42:09 +01:00
|
|
|
From: Alexander Graf <agraf@suse.de>
|
2009-08-11 17:37:13 +02:00
|
|
|
Date: Tue, 14 Apr 2009 16:24:15 +0200
|
2012-02-01 00:10:40 +01:00
|
|
|
Subject: [PATCH] qemu-cvs-alsa_mmap
|
2009-08-11 17:37:13 +02:00
|
|
|
|
|
|
|
Hack to prevent ALSA from using mmap() interface to simplify emulation.
|
|
|
|
|
2011-12-11 03:42:09 +01:00
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
2009-08-11 17:37:13 +02:00
|
|
|
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
|
|
|
---
|
|
|
|
linux-user/mmap.c | 14 ++++++++++++++
|
2013-02-10 19:32:29 +01:00
|
|
|
1 Datei geändert, 14 Zeilen hinzugefügt(+)
|
2009-08-11 17:37:13 +02:00
|
|
|
|
|
|
|
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
|
2012-08-17 18:42:52 +02:00
|
|
|
index b412e3f..46523de 100644
|
2009-08-11 17:37:13 +02:00
|
|
|
--- a/linux-user/mmap.c
|
|
|
|
+++ b/linux-user/mmap.c
|
2012-05-15 14:58:40 +02:00
|
|
|
@@ -377,6 +377,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
|
2011-02-16 20:30:51 +01:00
|
|
|
}
|
2007-07-10 18:55:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000
|
|
|
|
+#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000
|
|
|
|
+
|
|
|
|
/* NOTE: all the constants are the HOST ones */
|
2007-11-13 21:32:02 +01:00
|
|
|
abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
|
|
|
int flags, int fd, abi_ulong offset)
|
2012-08-17 18:42:52 +02:00
|
|
|
@@ -411,6 +414,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
2007-07-10 18:55:54 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+ /* Alsa tries to communcate with the kernel via mmap. This usually
|
2011-12-11 03:42:09 +01:00
|
|
|
+ * is a good idea when user- and kernelspace are running on the
|
2007-07-10 18:55:54 +02:00
|
|
|
+ * 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;
|
2009-08-11 17:37:13 +02:00
|
|
|
goto fail;
|