2007-07-10 18:55:54 +02:00
|
|
|
Index: qemu/linux-user/mmap.c
|
2007-11-13 21:32:02 +01:00
|
|
|
================================================================================
|
|
|
|
--- qemu/linux-user/mmap.c
|
2007-07-10 18:55:54 +02:00
|
|
|
+++ qemu/linux-user/mmap.c
|
2007-11-13 21:32:02 +01:00
|
|
|
@@ -153,6 +153,9 @@
|
2007-07-10 18:55:54 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#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)
|
|
|
|
@@ -194,6 +197,17 @@
|
2007-07-10 18:55:54 +02:00
|
|
|
}
|
|
|
|
#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;
|
|
|
|
return -1;
|