8c721a87ae
- Remove deprecated patch "work-around-SA_RESTART-race" (boo#982208) - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.6 * Patches dropped: 0002-XXX-work-around-SA_RESTART-race-wit.patch 0003-qemu-0.9.0.cvs-binfmt.patch 0004-qemu-cvs-alsa_bitfield.patch 0005-qemu-cvs-alsa_ioctl.patch 0006-qemu-cvs-alsa_mmap.patch 0007-qemu-cvs-gettimeofday.patch 0008-qemu-cvs-ioctl_debug.patch 0009-qemu-cvs-ioctl_nodirection.patch 0010-block-vmdk-Support-creation-of-SCSI.patch 0011-linux-user-add-binfmt-wrapper-for-a.patch 0012-PPC-KVM-Disable-mmu-notifier-check.patch 0013-linux-user-fix-segfault-deadlock.patch 0014-linux-user-binfmt-support-host-bina.patch 0015-linux-user-Ignore-broken-loop-ioctl.patch 0016-linux-user-lock-tcg.patch 0017-linux-user-Run-multi-threaded-code-.patch 0018-linux-user-lock-tb-flushing-too.patch 0019-linux-user-Fake-proc-cpuinfo.patch 0020-linux-user-implement-FS_IOC_GETFLAG.patch 0021-linux-user-implement-FS_IOC_SETFLAG.patch 0022-linux-user-XXX-disable-fiemap.patch 0023-slirp-nooutgoing.patch 0024-vnc-password-file-and-incoming-conn.patch 0025-linux-user-add-more-blk-ioctls.patch 0026-linux-user-use-target_ulong.patch 0027-block-Add-support-for-DictZip-enabl.patch 0028-block-Add-tar-container-format.patch OBS-URL: https://build.opensuse.org/request/show/408549 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=305
82 lines
2.5 KiB
Diff
82 lines
2.5 KiB
Diff
From 307dc6c6bde4ec04b9efd6f27db0295e349bf573 Mon Sep 17 00:00:00 2001
|
|
From: Alexander Graf <agraf@suse.de>
|
|
Date: Tue, 14 Apr 2009 16:20:50 +0200
|
|
Subject: [PATCH] qemu-cvs-alsa_bitfield
|
|
|
|
Implements TYPE_INTBITFIELD partially. (required for ALSA support)
|
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
|
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
|
---
|
|
include/exec/user/thunk.h | 3 +++
|
|
thunk.c | 21 +++++++++++++++++++++
|
|
2 files changed, 24 insertions(+)
|
|
|
|
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
|
|
index ad1d602..4e082a7 100644
|
|
--- a/include/exec/user/thunk.h
|
|
+++ b/include/exec/user/thunk.h
|
|
@@ -37,6 +37,7 @@ typedef enum argtype {
|
|
TYPE_ARRAY,
|
|
TYPE_STRUCT,
|
|
TYPE_OLDDEVT,
|
|
+ TYPE_INTBITFIELD,
|
|
} argtype;
|
|
|
|
#define MK_PTR(type) TYPE_PTR, type
|
|
@@ -90,6 +91,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
|
|
case TYPE_SHORT:
|
|
return 2;
|
|
case TYPE_INT:
|
|
+ case TYPE_INTBITFIELD:
|
|
return 4;
|
|
case TYPE_LONGLONG:
|
|
case TYPE_ULONGLONG:
|
|
@@ -152,6 +154,7 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
|
|
case TYPE_SHORT:
|
|
return 2;
|
|
case TYPE_INT:
|
|
+ case TYPE_INTBITFIELD:
|
|
return 4;
|
|
case TYPE_LONGLONG:
|
|
case TYPE_ULONGLONG:
|
|
diff --git a/thunk.c b/thunk.c
|
|
index f057d86..6db7874 100644
|
|
--- a/thunk.c
|
|
+++ b/thunk.c
|
|
@@ -37,6 +37,7 @@ static inline const argtype *thunk_type_next(const argtype *type_ptr)
|
|
case TYPE_CHAR:
|
|
case TYPE_SHORT:
|
|
case TYPE_INT:
|
|
+ case TYPE_INTBITFIELD:
|
|
case TYPE_LONGLONG:
|
|
case TYPE_ULONGLONG:
|
|
case TYPE_LONG:
|
|
@@ -139,6 +140,26 @@ const argtype *thunk_convert(void *dst, const void *src,
|
|
case TYPE_INT:
|
|
*(uint32_t *)dst = tswap32(*(uint32_t *)src);
|
|
break;
|
|
+ case TYPE_INTBITFIELD:
|
|
+#if defined(TARGET_I386) && defined(__powerpc__)
|
|
+ /* powerpc uses the MSB, whereas i386 uses the LSB
|
|
+ * to store the first bit in a field */
|
|
+ {
|
|
+ unsigned char byte = *(uint8_t *)src;
|
|
+ *(uint8_t *)dst = ((byte >> 7) & 1)
|
|
+ | ((byte >> 5) & 2)
|
|
+ | ((byte >> 3) & 4)
|
|
+ | ((byte >> 1) & 8)
|
|
+ | ((byte << 1) & 16)
|
|
+ | ((byte << 3) & 32)
|
|
+ | ((byte << 5) & 64)
|
|
+ | ((byte << 7) & 128);
|
|
+ /* FIXME: implement for bitfields > 1 byte and other archs */
|
|
+ }
|
|
+#else
|
|
+ *(uint32_t *)dst = tswap32(*(uint32_t *)src);
|
|
+#endif
|
|
+ break;
|
|
case TYPE_LONGLONG:
|
|
case TYPE_ULONGLONG:
|
|
*(uint64_t *)dst = tswap64(*(uint64_t *)src);
|