From 739def183842864e58fb04a5ef7774017551168e Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 6 Nov 2012 07:50:36 -0800 Subject: [PATCH] add packaging --- .../0001-Handle-CPU-interrupts-by-inline-che.patch | 211 ++ .../0002-XXX-dont-dump-core-on-sigabort.patc.patch | 33 + .../0003-XXX-work-around-SA_RESTART-race-wit.patch | 241 ++ packaging/0004-qemu-0.9.0.cvs-binfmt.patch.patch | 83 + packaging/0005-qemu-cvs-alsa_bitfield.patch.patch | 81 + packaging/0006-qemu-cvs-alsa_ioctl.patch.patch | 3624 ++++++++++++++++++++ packaging/0007-qemu-cvs-alsa_mmap.patch.patch | 45 + packaging/0008-qemu-cvs-gettimeofday.patch.patch | 23 + packaging/0009-qemu-cvs-ioctl_debug.patch.patch | 31 + .../0010-qemu-cvs-ioctl_nodirection.patch.patch | 40 + .../0011-block-vmdk-Support-creation-of-SCSI.patch | 131 + .../0012-configure-Enable-mipsn32-linux-user.patch | 29 + .../0013-linux-user-add-binfmt-wrapper-for-a.patch | 199 ++ .../0014-linux-user-Ignore-timer_create-sysc.patch | 29 + .../0015-linux-user-be-silent-about-capget-f.patch | 27 + .../0016-PPC-KVM-Disable-mmu-notifier-check..patch | 31 + .../0017-linux-user-fix-segfault-deadlock.pa.patch | 64 + .../0018-linux-user-binfmt-support-host-bina.patch | 56 + .../0019-linux-user-arm-no-tb_flush-on-reset.patch | 31 + .../0020-linux-user-fix-multi-threaded-proc-.patch | 32 + .../0021-use-libexecdir-instead-of-ignoring-.patch | 83 + .../0022-linux-user-Ignore-broken-loop-ioctl.patch | 72 + .../0023-linux-user-fix-segmentation-fault-p.patch | 41 + packaging/0024-linux-user-lock-tcg.patch.patch | 154 + .../0025-linux-user-Run-multi-threaded-code-.patch | 40 + .../0026-linux-user-lock-tb-flushing-too.pat.patch | 125 + .../0027-linux-user-Fake-proc-cpuinfo.patch.patch | 56 + .../0028-linux-user-implement-FS_IOC_GETFLAG.patch | 36 + .../0029-linux-user-implement-FS_IOC_SETFLAG.patch | 35 + packaging/0030-linux-user-fix-statfs.patch.patch | 48 + .../0031-linux-user-XXX-disable-fiemap.patch.patch | 26 + packaging/0032-slirp-nooutgoing.patch.patch | 135 + .../0033-vnc-password-file-and-incoming-conn.patch | 127 + packaging/bridge.conf | 11 + packaging/qemu.spec | 296 ++ 35 files changed, 6326 insertions(+) create mode 100644 packaging/0001-Handle-CPU-interrupts-by-inline-che.patch create mode 100644 packaging/0002-XXX-dont-dump-core-on-sigabort.patc.patch create mode 100644 packaging/0003-XXX-work-around-SA_RESTART-race-wit.patch create mode 100644 packaging/0004-qemu-0.9.0.cvs-binfmt.patch.patch create mode 100644 packaging/0005-qemu-cvs-alsa_bitfield.patch.patch create mode 100644 packaging/0006-qemu-cvs-alsa_ioctl.patch.patch create mode 100644 packaging/0007-qemu-cvs-alsa_mmap.patch.patch create mode 100644 packaging/0008-qemu-cvs-gettimeofday.patch.patch create mode 100644 packaging/0009-qemu-cvs-ioctl_debug.patch.patch create mode 100644 packaging/0010-qemu-cvs-ioctl_nodirection.patch.patch create mode 100644 packaging/0011-block-vmdk-Support-creation-of-SCSI.patch create mode 100644 packaging/0012-configure-Enable-mipsn32-linux-user.patch create mode 100644 packaging/0013-linux-user-add-binfmt-wrapper-for-a.patch create mode 100644 packaging/0014-linux-user-Ignore-timer_create-sysc.patch create mode 100644 packaging/0015-linux-user-be-silent-about-capget-f.patch create mode 100644 packaging/0016-PPC-KVM-Disable-mmu-notifier-check..patch create mode 100644 packaging/0017-linux-user-fix-segfault-deadlock.pa.patch create mode 100644 packaging/0018-linux-user-binfmt-support-host-bina.patch create mode 100644 packaging/0019-linux-user-arm-no-tb_flush-on-reset.patch create mode 100644 packaging/0020-linux-user-fix-multi-threaded-proc-.patch create mode 100644 packaging/0021-use-libexecdir-instead-of-ignoring-.patch create mode 100644 packaging/0022-linux-user-Ignore-broken-loop-ioctl.patch create mode 100644 packaging/0023-linux-user-fix-segmentation-fault-p.patch create mode 100644 packaging/0024-linux-user-lock-tcg.patch.patch create mode 100644 packaging/0025-linux-user-Run-multi-threaded-code-.patch create mode 100644 packaging/0026-linux-user-lock-tb-flushing-too.pat.patch create mode 100644 packaging/0027-linux-user-Fake-proc-cpuinfo.patch.patch create mode 100644 packaging/0028-linux-user-implement-FS_IOC_GETFLAG.patch create mode 100644 packaging/0029-linux-user-implement-FS_IOC_SETFLAG.patch create mode 100644 packaging/0030-linux-user-fix-statfs.patch.patch create mode 100644 packaging/0031-linux-user-XXX-disable-fiemap.patch.patch create mode 100644 packaging/0032-slirp-nooutgoing.patch.patch create mode 100644 packaging/0033-vnc-password-file-and-incoming-conn.patch create mode 100644 packaging/bridge.conf create mode 100644 packaging/qemu.spec diff --git a/packaging/0001-Handle-CPU-interrupts-by-inline-che.patch b/packaging/0001-Handle-CPU-interrupts-by-inline-che.patch new file mode 100644 index 0000000..0c692f2 --- /dev/null +++ b/packaging/0001-Handle-CPU-interrupts-by-inline-che.patch @@ -0,0 +1,211 @@ +From 2cd9bcd07f83ae11c02b2e12eb4b4d743dca777a Mon Sep 17 00:00:00 2001 +From: Peter Maydell +Date: Wed, 5 Oct 2011 10:04:02 +0100 +Subject: [PATCH] Handle CPU interrupts by inline checking of a flag + +Fix the nasty TCG race conditions and crashes by implementing cpu_exit +as setting a flag which is checked at the start of each TB. This is +slightly slower than the attempt to have cpu_exit alter the graph of +TBs, but it doesn't crash if a thread or signal handler calls cpu_exit +while the execution thread is itself modifying the TB graph. + +This version of the patch includes command line option "-no-stopflag" +which reverts to the previous racy behaviour. This is intended for +convenience in testing and comparative benchmarking and won't be +in the final patch. + +It's probably worth experimenting with whether the flag-testing +code has the branch in a sense which confuses branch-prediction +and thus whether flipping it might change performance. + +Mostly this needs benchmarking to determine what the actual speed +hit is, which I never got round to. Feel free to do some :-) + +[AF: CPUState -> CPUArchState] +--- + cpu-exec.c | 11 ++++++++++- + exec.c | 14 ++++++++++++-- + gen-icount.h | 16 ++++++++++++++++ + linux-user/main.c | 8 ++++++++ + qemu-options.hx | 9 +++++++++ + vl.c | 5 +++++ + 6 files changed, 60 insertions(+), 3 deletions(-) + +diff --git a/cpu-exec.c b/cpu-exec.c +index 134b3c4..e90ea29 100644 +--- a/cpu-exec.c ++++ b/cpu-exec.c +@@ -599,7 +599,16 @@ int cpu_exec(CPUArchState *env) + tc_ptr = tb->tc_ptr; + /* execute the generated code */ + next_tb = tcg_qemu_tb_exec(env, tc_ptr); +- if ((next_tb & 3) == 2) { ++ if ((next_tb & 3) == 3) { ++ /* hit stopflag check */ ++ tb = (TranslationBlock *)(long)(next_tb & ~3); ++ /* Restore PC. */ ++ cpu_pc_from_tb(env, tb); ++ next_tb = 0; ++ env->exit_request = 0; ++ env->exception_index = EXCP_INTERRUPT; ++ cpu_loop_exit(env); ++ } else if ((next_tb & 3) == 2) { + /* Instruction counter expired. */ + int insns_left; + tb = (TranslationBlock *)(next_tb & ~3); +diff --git a/exec.c b/exec.c +index 5834766..9cbdc35 100644 +--- a/exec.c ++++ b/exec.c +@@ -130,6 +130,8 @@ DEFINE_TLS(CPUArchState *,cpu_single_env); + 1 = Precise instruction counting. + 2 = Adaptive rate instruction counting. */ + int use_icount = 0; ++/* 1 to do cpu_exit by inline flag check rather than tb link breaking */ ++int use_stopflag = 1; + + typedef struct PageDesc { + /* list of TBs intersecting this ram page */ +@@ -1708,7 +1710,13 @@ static void tcg_handle_interrupt(CPUArchState *env, int mask) + cpu_abort(env, "Raised interrupt while not in I/O function"); + } + } else { +- cpu_unlink_tb(env); ++ // XXX just call cpu_exit ? ++ if (use_stopflag) { ++ // XXX is this OK? ++ env->exit_request = 1; ++ } else { ++ cpu_unlink_tb(env); ++ } + } + } + +@@ -1731,7 +1739,9 @@ void cpu_reset_interrupt(CPUArchState *env, int mask) + void cpu_exit(CPUArchState *env) + { + env->exit_request = 1; +- cpu_unlink_tb(env); ++ if (!use_stopflag) { ++ cpu_unlink_tb(env); ++ } + } + + void cpu_abort(CPUArchState *env, const char *fmt, ...) +diff --git a/gen-icount.h b/gen-icount.h +index 430cb44..65a75d9 100644 +--- a/gen-icount.h ++++ b/gen-icount.h +@@ -2,13 +2,25 @@ + + /* Helpers for instruction counting code generation. */ + ++extern int use_stopflag; ++ + static TCGArg *icount_arg; + static int icount_label; ++static int stopflag_label; + + static inline void gen_icount_start(void) + { + TCGv_i32 count; + ++ if (use_stopflag) { ++ TCGv_i32 flag; ++ stopflag_label = gen_new_label(); ++ flag = tcg_temp_local_new_i32(); ++ tcg_gen_ld_i32(flag, cpu_env, offsetof(CPUArchState, exit_request)); ++ tcg_gen_brcondi_i32(TCG_COND_NE, flag, 0, stopflag_label); ++ tcg_temp_free_i32(flag); ++ } ++ + if (!use_icount) + return; + +@@ -26,6 +38,10 @@ static inline void gen_icount_start(void) + + static void gen_icount_end(TranslationBlock *tb, int num_insns) + { ++ if (use_stopflag) { ++ gen_set_label(stopflag_label); ++ tcg_gen_exit_tb((long)tb + 3); // XXX ++ } + if (use_icount) { + *icount_arg = num_insns; + gen_set_label(icount_label); +diff --git a/linux-user/main.c b/linux-user/main.c +index 1a1c661..b7687c5 100644 +--- a/linux-user/main.c ++++ b/linux-user/main.c +@@ -64,6 +64,7 @@ unsigned long reserved_va; + #endif + + static void usage(void); ++extern int use_stopflag; + + static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX; + const char *qemu_uname_release = CONFIG_UNAME_RELEASE; +@@ -3196,6 +3197,11 @@ static void handle_arg_reserved_va(const char *arg) + } + #endif + ++static void handle_arg_nostopflag(const char *arg) ++{ ++ use_stopflag = 0; ++} ++ + static void handle_arg_singlestep(const char *arg) + { + singlestep = 1; +@@ -3251,6 +3257,8 @@ static const struct qemu_argument arg_table[] = { + "options", "activate log"}, + {"D", "QEMU_LOG_FILENAME", true, handle_arg_log_filename, + "logfile", "override default logfile location"}, ++ {"no-stopflag", "QEMU_NOSTOPFLAG", false, handle_arg_nostopflag, ++ "", "run in singlestep mode"}, + {"p", "QEMU_PAGESIZE", true, handle_arg_pagesize, + "pagesize", "set the host page size to 'pagesize'"}, + {"singlestep", "QEMU_SINGLESTEP", false, handle_arg_singlestep, +diff --git a/qemu-options.hx b/qemu-options.hx +index 3c411c4..af614bf 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -1196,6 +1196,15 @@ STEXI + Disable HPET support. + ETEXI + ++DEF("no-stopflag", 0, QEMU_OPTION_no_stopflag, ++ "-no-stopflag use old behaviour, not inline stopflag checks\n", QEMU_ARCH_ALL) ++STEXI ++@item -no-stopflag ++@findex -no-stopflag ++Implement cpu-exit by the old tb link breaking method rather than inline checks ++(this is slightly faster but racy!) ++ETEXI ++ + DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, + "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n" + " ACPI table description\n", QEMU_ARCH_I386) +diff --git a/vl.c b/vl.c +index 7c577fa..fdf755f 100644 +--- a/vl.c ++++ b/vl.c +@@ -176,6 +176,8 @@ int main(int argc, char **argv) + + #define MAX_VIRTIO_CONSOLES 1 + ++extern int use_stopflag; ++ + static const char *data_dir; + const char *bios_name = NULL; + enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; +@@ -3039,6 +3041,9 @@ int main(int argc, char **argv, char **envp) + qdev_prop_register_global_list(slew_lost_ticks); + break; + } ++ case QEMU_OPTION_no_stopflag: ++ use_stopflag = 0; ++ break; + case QEMU_OPTION_acpitable: + do_acpitable_option(optarg); + break; diff --git a/packaging/0002-XXX-dont-dump-core-on-sigabort.patc.patch b/packaging/0002-XXX-dont-dump-core-on-sigabort.patc.patch new file mode 100644 index 0000000..ee960ce --- /dev/null +++ b/packaging/0002-XXX-dont-dump-core-on-sigabort.patc.patch @@ -0,0 +1,33 @@ +From ed58a0a90acc2299a306080d356095a0978bca91 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Mon, 21 Nov 2011 23:50:36 +0100 +Subject: [PATCH] XXX dont dump core on sigabort + +--- + linux-user/signal.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/linux-user/signal.c b/linux-user/signal.c +index 7869147..0078b32 100644 +--- a/linux-user/signal.c ++++ b/linux-user/signal.c +@@ -373,6 +373,10 @@ static void QEMU_NORETURN force_sig(int target_sig) + host_sig = target_to_host_signal(target_sig); + gdb_signalled(thread_env, target_sig); + ++ if (target_sig == 6) { ++ goto no_core; ++ } ++ + /* dump core if supported by target binary format */ + if (core_dump_signal(target_sig) && (ts->bprm->core_dump != NULL)) { + stop_all_tasks(); +@@ -390,6 +394,8 @@ static void QEMU_NORETURN force_sig(int target_sig) + target_sig, strsignal(host_sig), "core dumped" ); + } + ++no_core: ++ + /* The proper exit code for dying from an uncaught signal is + * -. The kernel doesn't allow exit() or _exit() to pass + * a negative value. To get the proper exit code we need to diff --git a/packaging/0003-XXX-work-around-SA_RESTART-race-wit.patch b/packaging/0003-XXX-work-around-SA_RESTART-race-wit.patch new file mode 100644 index 0000000..7b8e390 --- /dev/null +++ b/packaging/0003-XXX-work-around-SA_RESTART-race-wit.patch @@ -0,0 +1,241 @@ +From 484a06c7e009880519d417c3b72e7170563ea36d Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Thu, 1 Dec 2011 19:00:01 +0100 +Subject: [PATCH] XXX work around SA_RESTART race with boehm-gc (ARM only) + +[AF: CPUState -> CPUArchState, adapt to reindentation] +--- + linux-user/main.c | 25 +++++++++----- + linux-user/qemu.h | 3 ++ + linux-user/signal.c | 22 ++++++++++++ + linux-user/syscall.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++- + 4 files changed, 130 insertions(+), 10 deletions(-) + +diff --git a/linux-user/main.c b/linux-user/main.c +index b7687c5..8002c77 100644 +--- a/linux-user/main.c ++++ b/linux-user/main.c +@@ -847,15 +847,22 @@ void cpu_loop(CPUARMState *env) + break; + } + } else { +- env->regs[0] = do_syscall(env, +- n, +- env->regs[0], +- env->regs[1], +- env->regs[2], +- env->regs[3], +- env->regs[4], +- env->regs[5], +- 0, 0); ++ TaskState *ts = ((CPUArchState*)env)->opaque; ++ target_ulong r; ++ r = do_syscall(env, n, env->regs[0], env->regs[1], ++ env->regs[2], env->regs[3], env->regs[4], ++ env->regs[5], 0, 0); ++ if ((r == -EINTR) && ts->signal_restart && ++ syscall_restartable(n)) { ++ if (env->thumb) { ++ env->regs[15] -= 2; ++ } else { ++ env->regs[15] -= 4; ++ } ++ } else { ++ env->regs[0] = r; ++ } ++ ts->signal_restart = 0; + } + } else { + goto error; +diff --git a/linux-user/qemu.h b/linux-user/qemu.h +index 69b27d7..175d502 100644 +--- a/linux-user/qemu.h ++++ b/linux-user/qemu.h +@@ -137,6 +137,8 @@ typedef struct TaskState { + struct sigqueue sigqueue_table[MAX_SIGQUEUE_SIZE]; /* siginfo queue */ + struct sigqueue *first_free; /* first free siginfo queue entry */ + int signal_pending; /* non zero if a signal may be pending */ ++ int signal_in_syscall; /* non zero if we are in do_syscall() */ ++ int signal_restart; /* non zero if we need to restart a syscall */ + } __attribute__((aligned(16))) TaskState; + + extern char *exec_path; +@@ -203,6 +205,7 @@ char *target_strerror(int err); + int get_osversion(void); + void fork_start(void); + void fork_end(int child); ++int syscall_restartable(int syscall_nr); + + /* Creates the initial guest address space in the host memory space using + * the given host start address hint and size. The guest_start parameter +diff --git a/linux-user/signal.c b/linux-user/signal.c +index 0078b32..4a637f4 100644 +--- a/linux-user/signal.c ++++ b/linux-user/signal.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include "qemu.h" + #include "qemu-common.h" +@@ -481,6 +482,11 @@ int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info) + k->pending = 1; + /* signal that a new signal is pending */ + ts->signal_pending = 1; ++ /* check if we have to restart the current syscall */ ++ if ((sigact_table[sig - 1].sa_flags & SA_RESTART) && ++ ts->signal_in_syscall) { ++ ts->signal_restart = 1; ++ } + return 1; /* indicates that the signal was queued */ + } + } +@@ -621,8 +627,24 @@ int do_sigaction(int sig, const struct target_sigaction *act, + if (host_sig != SIGSEGV && host_sig != SIGBUS) { + sigfillset(&act1.sa_mask); + act1.sa_flags = SA_SIGINFO; ++#ifdef TARGET_ARM ++ /* Breaks boehm-gc, we have to do this manually */ ++ /* ++ * Unfortunately our hacks only work as long as we don't do parallel ++ * signal delivery and futexes, so let's do a dirty hack here to ++ * pin our guest process to a single host CPU if we're using the ++ * boehm-gc. ++ */ ++ if ((k->sa_flags & TARGET_SA_RESTART) && host_sig == SIGPWR) { ++ cpu_set_t mask; ++ CPU_ZERO(&mask); ++ CPU_SET(0, &mask); ++ sched_setaffinity(0, sizeof(mask), &mask); ++ } ++#else + if (k->sa_flags & TARGET_SA_RESTART) + act1.sa_flags |= SA_RESTART; ++#endif + /* NOTE: it is important to update the host kernel signal + ignore state to avoid getting unexpected interrupted + syscalls */ +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 6257a04..10ea39f 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -5086,6 +5086,87 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode) + return get_errno(open(path(pathname), flags, mode)); + } + ++int syscall_restartable(int syscall_nr) ++{ ++ switch (syscall_nr) { ++#ifdef TARGET_NR_sigsuspend ++ case TARGET_NR_sigsuspend: ++#endif ++#ifdef TARGET_NR_pause ++ case TARGET_NR_pause: ++#endif ++#ifdef TARGET_NR_setsockopt ++ case TARGET_NR_setsockopt: ++#endif ++#ifdef TARGET_NR_accept ++ case TARGET_NR_accept: ++#endif ++#ifdef TARGET_NR_recv ++ case TARGET_NR_recv: ++#endif ++#ifdef TARGET_NR_recvfrom ++ case TARGET_NR_recvfrom: ++#endif ++#ifdef TARGET_NR_recvmsg ++ case TARGET_NR_recvmsg: ++#endif ++#ifdef TARGET_NR_socketcall ++ case TARGET_NR_socketcall: ++#endif ++#ifdef TARGET_NR_connect ++ case TARGET_NR_connect: ++#endif ++#ifdef TARGET_NR_send ++ case TARGET_NR_send: ++#endif ++#ifdef TARGET_NR_sendmsg ++ case TARGET_NR_sendmsg: ++#endif ++#ifdef TARGET_NR_sendto ++ case TARGET_NR_sendto: ++#endif ++#ifdef TARGET_NR_poll ++ case TARGET_NR_poll: ++#endif ++#ifdef TARGET_NR_ppoll ++ case TARGET_NR_ppoll: ++#endif ++#if defined(TARGET_NR_select) ++ case TARGET_NR_select: ++#endif ++#ifdef TARGET_NR_pselect6 ++ case TARGET_NR_pselect6: ++#endif ++#ifdef TARGET_NR__newselect ++ case TARGET_NR__newselect: ++#endif ++#ifdef TARGET_NR_msgrcv ++ case TARGET_NR_msgrcv: ++#endif ++#ifdef TARGET_NR_msgsnd ++ case TARGET_NR_msgsnd: ++#endif ++#ifdef TARGET_NR_semop ++ case TARGET_NR_semop: ++#endif ++#ifdef TARGET_NR_ipc ++ case TARGET_NR_ipc: ++#endif ++#ifdef TARGET_NR_clock_nanosleep ++ case TARGET_NR_clock_nanosleep: ++#endif ++ case TARGET_NR_rt_sigsuspend: ++ case TARGET_NR_rt_sigtimedwait: ++ case TARGET_NR_nanosleep: ++ case TARGET_NR_close: ++ /* can not be restarted */ ++ return 0; ++ } ++ ++ /* every other syscall can be restarted */ ++ return 1; ++} ++ + /* do_syscall() should always have a single exit point at the end so + that actions, such as logging of syscall results, can be performed. + All errnos that do_syscall() returns must be -TARGET_. */ +@@ -5098,6 +5179,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + struct stat st; + struct statfs stfs; + void *p; ++ TaskState *ts = ((CPUArchState*)cpu_env)->opaque; ++ ++ if (!ts->signal_restart) { ++ /* remember syscall info for restart */ ++ ts->signal_in_syscall = 1; ++ } + + #ifdef DEBUG + gemu_log("syscall %d", num); +@@ -8094,7 +8181,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + cmd = target_to_host_fcntl_cmd(arg2); + if (cmd == -TARGET_EINVAL) { + ret = cmd; +- break; ++ goto fail; + } + + switch(arg2) { +@@ -8839,6 +8926,7 @@ fail: + #endif + if(do_strace) + print_syscall_ret(num, ret); ++ ts->signal_in_syscall = 0; + return ret; + efault: + ret = -TARGET_EFAULT; diff --git a/packaging/0004-qemu-0.9.0.cvs-binfmt.patch.patch b/packaging/0004-qemu-0.9.0.cvs-binfmt.patch.patch new file mode 100644 index 0000000..e01f785 --- /dev/null +++ b/packaging/0004-qemu-0.9.0.cvs-binfmt.patch.patch @@ -0,0 +1,83 @@ +From b0fd82b0d90efb977b62491733361ea2466d1753 Mon Sep 17 00:00:00 2001 +From: Ulrich Hecht +Date: Tue, 14 Apr 2009 16:18:44 +0200 +Subject: [PATCH] qemu-0.9.0.cvs-binfmt + +Fixes binfmt_misc setup script: +- x86_64 is i386-compatible +- m68k signature fixed +- path to QEMU + +Signed-off-by: Ulrich Hecht +--- + scripts/qemu-binfmt-conf.sh | 37 ++++++++++++++++++++----------------- + 1 files changed, 20 insertions(+), 17 deletions(-) + +diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh +index 0da2618..dc652f0 100644 +--- a/scripts/qemu-binfmt-conf.sh ++++ b/scripts/qemu-binfmt-conf.sh +@@ -27,43 +27,46 @@ case "$cpu" in + armv[4-9]*) + cpu="arm" + ;; ++ sparc*) ++ cpu="sparc" ++ ;; + esac + + # register the interpreter for each cpu except for the native one + if [ $cpu != "i386" ] ; then +- echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register +- echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register ++ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register ++ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "alpha" ] ; then +- echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register ++ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "arm" ] ; then +- echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register +- echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register ++ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register ++ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "sparc" ] ; then +- echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register ++ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "ppc" ] ; then +- echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register ++ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "m68k" ] ; then + echo 'Please check cpu value and header information for m68k!' +- echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register ++ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "mips" ] ; then + # FIXME: We could use the other endianness on a MIPS host. +- echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register +- echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register +- echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mipsn32:' > /proc/sys/fs/binfmt_misc/register +- echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register +- echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register +- echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register ++ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register ++ echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register ++ echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:' > /proc/sys/fs/binfmt_misc/register ++ echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register ++ echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register ++ echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "sh" ] ; then +- echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register +- echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register ++ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register ++ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "s390x" ] ; then +- echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-s390x:' > /proc/sys/fs/binfmt_misc/register ++ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x:' > /proc/sys/fs/binfmt_misc/register + fi diff --git a/packaging/0005-qemu-cvs-alsa_bitfield.patch.patch b/packaging/0005-qemu-cvs-alsa_bitfield.patch.patch new file mode 100644 index 0000000..ae12d3e --- /dev/null +++ b/packaging/0005-qemu-cvs-alsa_bitfield.patch.patch @@ -0,0 +1,81 @@ +From 6d14e9d5678e7c6e7aa051777730b164d510341e Mon Sep 17 00:00:00 2001 +From: Alexander Graf +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 +Signed-off-by: Ulrich Hecht +--- + thunk.c | 21 +++++++++++++++++++++ + thunk.h | 3 +++ + 2 files changed, 24 insertions(+), 0 deletions(-) + +diff --git a/thunk.c b/thunk.c +index 8ebbbb4..bf43985 100644 +--- a/thunk.c ++++ b/thunk.c +@@ -41,6 +41,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: +@@ -140,6 +141,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); +diff --git a/thunk.h b/thunk.h +index 87025c3..6c35e64 100644 +--- a/thunk.h ++++ b/thunk.h +@@ -38,6 +38,7 @@ typedef enum argtype { + TYPE_ARRAY, + TYPE_STRUCT, + TYPE_OLDDEVT, ++ TYPE_INTBITFIELD, + } argtype; + + #define MK_PTR(type) TYPE_PTR, type +@@ -91,6 +92,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: +@@ -153,6 +155,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/packaging/0006-qemu-cvs-alsa_ioctl.patch.patch b/packaging/0006-qemu-cvs-alsa_ioctl.patch.patch new file mode 100644 index 0000000..53f2a34 --- /dev/null +++ b/packaging/0006-qemu-cvs-alsa_ioctl.patch.patch @@ -0,0 +1,3624 @@ +From 9723717ddf7d021c368be04f2e160156d8ed8031 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 14 Apr 2009 16:23:27 +0200 +Subject: [PATCH] qemu-cvs-alsa_ioctl + +Implements ALSA ioctls on PPC hosts. + +Signed-off-by: Alexander Graf +Signed-off-by: Ulrich Hecht +--- + linux-user/ioctls.h | 5 + + linux-user/ioctls_alsa.h | 467 ++++++++++ + linux-user/ioctls_alsa_structs.h | 1740 ++++++++++++++++++++++++++++++++++++++ + linux-user/syscall_defs.h | 2 + + linux-user/syscall_types.h | 5 + + linux-user/syscall_types_alsa.h | 1336 +++++++++++++++++++++++++++++ + 6 files changed, 3555 insertions(+), 0 deletions(-) + create mode 100644 linux-user/ioctls_alsa.h + create mode 100644 linux-user/ioctls_alsa_structs.h + create mode 100644 linux-user/syscall_types_alsa.h + +diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h +index 8a47767..6af0cb7 100644 +--- a/linux-user/ioctls.h ++++ b/linux-user/ioctls.h +@@ -316,6 +316,11 @@ + IOCTL(VFAT_IOCTL_READDIR_BOTH, IOC_R, MK_PTR(MK_ARRAY(MK_STRUCT(STRUCT_dirent), 2))) + IOCTL(VFAT_IOCTL_READDIR_SHORT, IOC_R, MK_PTR(MK_ARRAY(MK_STRUCT(STRUCT_dirent), 2))) + ++/* FIXME: including these on x86 / x86_64 breaks qemu-i386 */ ++#ifdef __powerpc__ ++#include "ioctls_alsa.h" ++#endif ++ + IOCTL(LOOP_SET_FD, 0, TYPE_INT) + IOCTL(LOOP_CLR_FD, 0, TYPE_INT) + IOCTL(LOOP_SET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info))) +diff --git a/linux-user/ioctls_alsa.h b/linux-user/ioctls_alsa.h +new file mode 100644 +index 0000000..c2aa542 +--- /dev/null ++++ b/linux-user/ioctls_alsa.h +@@ -0,0 +1,467 @@ ++#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int) ++#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int) ++#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct sndrv_seq_system_info) ++#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct sndrv_seq_running_info) ++#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct sndrv_seq_client_info) ++#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct sndrv_seq_client_info) ++#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct sndrv_seq_port_info) ++#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct sndrv_seq_port_info) ++#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct sndrv_seq_port_info) ++#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct sndrv_seq_port_info) ++#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct sndrv_seq_port_subscribe) ++#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct sndrv_seq_port_subscribe) ++#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct sndrv_seq_queue_info) ++#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct sndrv_seq_queue_info) ++#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct sndrv_seq_queue_info) ++#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct sndrv_seq_queue_info) ++#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct sndrv_seq_queue_info) ++#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct sndrv_seq_queue_status) ++#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct sndrv_seq_queue_tempo) ++#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct sndrv_seq_queue_tempo) ++#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct sndrv_seq_queue_owner) ++#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct sndrv_seq_queue_owner) ++#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct sndrv_seq_queue_timer) ++#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct sndrv_seq_queue_timer) ++#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct sndrv_seq_queue_sync) ++#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct sndrv_seq_queue_sync) ++#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct sndrv_seq_queue_client) ++#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct sndrv_seq_queue_client) ++#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct sndrv_seq_client_pool) ++#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct sndrv_seq_client_pool) ++#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct sndrv_seq_remove_events) ++#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct sndrv_seq_query_subs) ++#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct sndrv_seq_port_subscribe) ++#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct sndrv_seq_client_info) ++#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct sndrv_seq_port_info) ++#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, snd_dm_fm_info_t) ++#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21) ++#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, snd_dm_fm_note_t) ++#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, snd_dm_fm_voice_t) ++#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, snd_dm_fm_params_t) ++#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int) ++#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int) ++#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20 ++#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21 ++#define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22 ++#define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23 ++#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24 ++#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25 ++#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int) ++#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct sndrv_hwdep_info) ++#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct sndrv_hwdep_dsp_status) ++#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct sndrv_hwdep_dsp_image) ++#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int) ++#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct sndrv_pcm_info) ++#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int) ++#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct sndrv_pcm_hw_params) ++#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct sndrv_pcm_hw_params) ++#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12) ++#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct sndrv_pcm_sw_params) ++#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct sndrv_pcm_status) ++#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, sndrv_pcm_sframes_t) ++#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) ++#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct sndrv_pcm_sync_ptr) ++#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct sndrv_pcm_channel_info) ++#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40) ++#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41) ++#define SNDRV_PCM_IOCTL_START _IO('A', 0x42) ++#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43) ++#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44) ++#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int) ++#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, sndrv_pcm_uframes_t) ++#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47) ++#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48) ++#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, sndrv_pcm_uframes_t) ++#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct sndrv_xferi) ++#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct sndrv_xferi) ++#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct sndrv_xfern) ++#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct sndrv_xfern) ++#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int) ++#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61) ++#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int) ++#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct sndrv_rawmidi_info) ++#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct sndrv_rawmidi_params) ++#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct sndrv_rawmidi_status) ++#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int) ++#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int) ++#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int) ++#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct sndrv_timer_id) ++#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int) ++#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct sndrv_timer_ginfo) ++#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct sndrv_timer_gparams) ++#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct sndrv_timer_gstatus) ++#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct sndrv_timer_select) ++#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct sndrv_timer_info) ++#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct sndrv_timer_params) ++#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct sndrv_timer_status) ++#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0) ++#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1) ++#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2) ++#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3) ++#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) ++#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct sndrv_ctl_card_info) ++#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct sndrv_ctl_elem_list) ++#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct sndrv_ctl_elem_info) ++#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct sndrv_ctl_elem_value) ++#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct sndrv_ctl_elem_value) ++#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct sndrv_ctl_elem_id) ++#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct sndrv_ctl_elem_id) ++#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int) ++#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct sndrv_ctl_elem_info) ++#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct sndrv_ctl_elem_info) ++#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct sndrv_ctl_elem_id) ++#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct sndrv_ctl_tlv) ++#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct sndrv_ctl_tlv) ++#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct sndrv_ctl_tlv) ++#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int) ++#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct sndrv_hwdep_info) ++#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int) ++#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct sndrv_pcm_info) ++#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int) ++#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int) ++#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct sndrv_rawmidi_info) ++#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int) ++#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int) ++#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int) ++#define SNDRV_IOCTL_READV _IOW('K', 0x00, struct sndrv_xferv) ++#define SNDRV_IOCTL_WRITEV _IOW('K', 0x01, struct sndrv_xferv) ++#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, emu10k1_fx8010_info_t) ++#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, emu10k1_fx8010_code_t) ++#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, emu10k1_fx8010_code_t) ++#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int) ++#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, emu10k1_fx8010_tram_t) ++#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, emu10k1_fx8010_tram_t) ++#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, emu10k1_fx8010_pcm_t) ++#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, emu10k1_fx8010_pcm_t) ++#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int) ++#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) ++#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) ++#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82) ++#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int) ++#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int) ++#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, hdsp_peak_rms_t) ++#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdsp_config_info_t) ++#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, hdsp_firmware_t) ++#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, hdsp_version_t) ++#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, hdsp_mixer_t) ++#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, hdsp_9632_aeb_t) ++#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, snd_sb_csp_info_t) ++#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, snd_sb_csp_microcode_t) ++#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) ++#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, snd_sb_csp_start_t) ++#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14) ++#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15) ++#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16) ++#define SND_SSCAPE_LOAD_BOOTB _IOWR('P', 100, struct sscape_bootblock) ++#define SND_SSCAPE_LOAD_MCODE _IOW ('P', 101, struct sscape_microcode) ++ ++ ++#define TARGET_SNDRV_SEQ_IOCTL_PVERSION TARGET_IOR ('S', 0x00, int) ++#define TARGET_SNDRV_SEQ_IOCTL_CLIENT_ID TARGET_IOR ('S', 0x01, int) ++#define TARGET_SNDRV_SEQ_IOCTL_SYSTEM_INFO TARGET_IOWRU('S', 0x02) ++#define TARGET_SNDRV_SEQ_IOCTL_RUNNING_MODE TARGET_IOWRU('S', 0x03) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_CLIENT_INFO TARGET_IOWRU('S', 0x10) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_CLIENT_INFO TARGET_IOWU ('S', 0x11) ++#define TARGET_SNDRV_SEQ_IOCTL_CREATE_PORT TARGET_IOWRU('S', 0x20) ++#define TARGET_SNDRV_SEQ_IOCTL_DELETE_PORT TARGET_IOWU ('S', 0x21) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_PORT_INFO TARGET_IOWRU('S', 0x22) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_PORT_INFO TARGET_IOWU ('S', 0x23) ++#define TARGET_SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT TARGET_IOWU ('S', 0x30) ++#define TARGET_SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT TARGET_IOWU ('S', 0x31) ++#define TARGET_SNDRV_SEQ_IOCTL_CREATE_QUEUE TARGET_IOWRU('S', 0x32) ++#define TARGET_SNDRV_SEQ_IOCTL_DELETE_QUEUE TARGET_IOWU ('S', 0x33) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_QUEUE_INFO TARGET_IOWRU('S', 0x34) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_QUEUE_INFO TARGET_IOWRU('S', 0x35) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE TARGET_IOWRU('S', 0x36) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS TARGET_IOWRU('S', 0x40) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO TARGET_IOWRU('S', 0x41) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO TARGET_IOWU ('S', 0x42) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER TARGET_IOWRU('S', 0x43) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER TARGET_IOWU ('S', 0x44) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER TARGET_IOWRU('S', 0x45) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER TARGET_IOWU ('S', 0x46) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC TARGET_IOWRU('S', 0x53) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC TARGET_IOWU ('S', 0x54) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT TARGET_IOWRU('S', 0x49) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT TARGET_IOWU ('S', 0x4a) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_CLIENT_POOL TARGET_IOWRU('S', 0x4b) ++#define TARGET_SNDRV_SEQ_IOCTL_SET_CLIENT_POOL TARGET_IOWU ('S', 0x4c) ++#define TARGET_SNDRV_SEQ_IOCTL_REMOVE_EVENTS TARGET_IOWU ('S', 0x4e) ++#define TARGET_SNDRV_SEQ_IOCTL_QUERY_SUBS TARGET_IOWRU('S', 0x4f) ++#define TARGET_SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION TARGET_IOWRU('S', 0x50) ++#define TARGET_SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT TARGET_IOWRU('S', 0x51) ++#define TARGET_SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT TARGET_IOWRU('S', 0x52) ++#define TARGET_SNDRV_DM_FM_IOCTL_INFO TARGET_IORU('H', 0x20) ++#define TARGET_SNDRV_DM_FM_IOCTL_RESET TARGET_IO ('H', 0x21) ++#define TARGET_SNDRV_DM_FM_IOCTL_PLAY_NOTE TARGET_IOWU('H', 0x22) ++#define TARGET_SNDRV_DM_FM_IOCTL_SET_VOICE TARGET_IOWU('H', 0x23) ++#define TARGET_SNDRV_DM_FM_IOCTL_SET_PARAMS TARGET_IOWU('H', 0x24) ++#define TARGET_SNDRV_DM_FM_IOCTL_SET_MODE TARGET_IOW('H', 0x25, int) ++#define TARGET_SNDRV_DM_FM_IOCTL_SET_CONNECTION TARGET_IOW('H', 0x26, int) ++#define TARGET_SNDRV_DM_FM_OSS_IOCTL_RESET 0x20 ++#define TARGET_SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21 ++#define TARGET_SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22 ++#define TARGET_SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23 ++#define TARGET_SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24 ++#define TARGET_SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25 ++#define TARGET_SNDRV_HWDEP_IOCTL_PVERSION TARGET_IOR ('H', 0x00, int) ++#define TARGET_SNDRV_HWDEP_IOCTL_INFO TARGET_IORU ('H', 0x01) ++#define TARGET_SNDRV_HWDEP_IOCTL_DSP_STATUS TARGET_IORU('H', 0x02) ++#define TARGET_SNDRV_HWDEP_IOCTL_DSP_LOAD TARGET_IOWU('H', 0x03) ++#define TARGET_SNDRV_PCM_IOCTL_PVERSION TARGET_IOR('A', 0x00, int) ++#define TARGET_SNDRV_PCM_IOCTL_INFO TARGET_IORU('A', 0x01) ++#define TARGET_SNDRV_PCM_IOCTL_TSTAMP TARGET_IOW('A', 0x02, int) ++#define TARGET_SNDRV_PCM_IOCTL_HW_REFINE TARGET_IOWRU('A', 0x10) ++#define TARGET_SNDRV_PCM_IOCTL_HW_PARAMS TARGET_IOWRU('A', 0x11) ++#define TARGET_SNDRV_PCM_IOCTL_HW_FREE TARGET_IO('A', 0x12) ++#define TARGET_SNDRV_PCM_IOCTL_SW_PARAMS TARGET_IOWRU('A', 0x13) ++#define TARGET_SNDRV_PCM_IOCTL_STATUS TARGET_IORU('A', 0x20) ++#define TARGET_SNDRV_PCM_IOCTL_DELAY TARGET_IORU('A', 0x21) ++#define TARGET_SNDRV_PCM_IOCTL_HWSYNC TARGET_IO('A', 0x22) ++#define TARGET_SNDRV_PCM_IOCTL_SYNC_PTR TARGET_IOWRU('A', 0x23) ++#define TARGET_SNDRV_PCM_IOCTL_CHANNEL_INFO TARGET_IORU('A', 0x32) ++#define TARGET_SNDRV_PCM_IOCTL_PREPARE TARGET_IO('A', 0x40) ++#define TARGET_SNDRV_PCM_IOCTL_RESET TARGET_IO('A', 0x41) ++#define TARGET_SNDRV_PCM_IOCTL_START TARGET_IO('A', 0x42) ++#define TARGET_SNDRV_PCM_IOCTL_DROP TARGET_IO('A', 0x43) ++#define TARGET_SNDRV_PCM_IOCTL_DRAIN TARGET_IO('A', 0x44) ++#define TARGET_SNDRV_PCM_IOCTL_PAUSE TARGET_IOW('A', 0x45, int) ++#define TARGET_SNDRV_PCM_IOCTL_REWIND TARGET_IOWU('A', 0x46) ++#define TARGET_SNDRV_PCM_IOCTL_RESUME TARGET_IO('A', 0x47) ++#define TARGET_SNDRV_PCM_IOCTL_XRUN TARGET_IO('A', 0x48) ++#define TARGET_SNDRV_PCM_IOCTL_FORWARD TARGET_IOWU('A', 0x49) ++#define TARGET_SNDRV_PCM_IOCTL_WRITEI_FRAMES TARGET_IOWU('A', 0x50) ++#define TARGET_SNDRV_PCM_IOCTL_READI_FRAMES TARGET_IORU('A', 0x51) ++#define TARGET_SNDRV_PCM_IOCTL_WRITEN_FRAMES TARGET_IOWU('A', 0x52) ++#define TARGET_SNDRV_PCM_IOCTL_READN_FRAMES TARGET_IORU('A', 0x53) ++#define TARGET_SNDRV_PCM_IOCTL_LINK TARGET_IOW('A', 0x60, int) ++#define TARGET_SNDRV_PCM_IOCTL_UNLINK TARGET_IO('A', 0x61) ++#define TARGET_SNDRV_RAWMIDI_IOCTL_PVERSION TARGET_IOR('W', 0x00, int) ++#define TARGET_SNDRV_RAWMIDI_IOCTL_INFO TARGET_IORU('W', 0x01) ++#define TARGET_SNDRV_RAWMIDI_IOCTL_PARAMS TARGET_IOWRU('W', 0x10) ++#define TARGET_SNDRV_RAWMIDI_IOCTL_STATUS TARGET_IOWRU('W', 0x20) ++#define TARGET_SNDRV_RAWMIDI_IOCTL_DROP TARGET_IOW('W', 0x30, int) ++#define TARGET_SNDRV_RAWMIDI_IOCTL_DRAIN TARGET_IOW('W', 0x31, int) ++#define TARGET_SNDRV_TIMER_IOCTL_PVERSION TARGET_IOR('T', 0x00, int) ++#define TARGET_SNDRV_TIMER_IOCTL_NEXT_DEVICE TARGET_IOWRU('T', 0x01) ++#define TARGET_SNDRV_TIMER_IOCTL_TREAD TARGET_IOW('T', 0x02, int) ++#define TARGET_SNDRV_TIMER_IOCTL_GINFO TARGET_IOWRU('T', 0x03) ++#define TARGET_SNDRV_TIMER_IOCTL_GPARAMS TARGET_IOWU('T', 0x04) ++#define TARGET_SNDRV_TIMER_IOCTL_GSTATUS TARGET_IOWRU('T', 0x05) ++#define TARGET_SNDRV_TIMER_IOCTL_SELECT TARGET_IOWU('T', 0x10) ++#define TARGET_SNDRV_TIMER_IOCTL_INFO TARGET_IORU('T', 0x11) ++#define TARGET_SNDRV_TIMER_IOCTL_PARAMS TARGET_IOWU('T', 0x12) ++#define TARGET_SNDRV_TIMER_IOCTL_STATUS TARGET_IORU('T', 0x14) ++#define TARGET_SNDRV_TIMER_IOCTL_START TARGET_IO('T', 0xa0) ++#define TARGET_SNDRV_TIMER_IOCTL_STOP TARGET_IO('T', 0xa1) ++#define TARGET_SNDRV_TIMER_IOCTL_CONTINUE TARGET_IO('T', 0xa2) ++#define TARGET_SNDRV_TIMER_IOCTL_PAUSE TARGET_IO('T', 0xa3) ++#define TARGET_SNDRV_CTL_IOCTL_PVERSION TARGET_IOR('U', 0x00, int) ++#define TARGET_SNDRV_CTL_IOCTL_CARD_INFO TARGET_IORU('U', 0x01) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_LIST TARGET_IOWRU('U', 0x10) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_INFO TARGET_IOWRU('U', 0x11) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_READ TARGET_IOWRU('U', 0x12) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_WRITE TARGET_IOWRU('U', 0x13) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_LOCK TARGET_IOWU('U', 0x14) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_UNLOCK TARGET_IOWU('U', 0x15) ++#define TARGET_SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS TARGET_IOWR('U', 0x16, int) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_ADD TARGET_IOWRU('U', 0x17) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_REPLACE TARGET_IOWRU('U', 0x18) ++#define TARGET_SNDRV_CTL_IOCTL_ELEM_REMOVE TARGET_IOWRU('U', 0x19) ++#define TARGET_SNDRV_CTL_IOCTL_TLV_READ TARGET_IOWRU('U', 0x1a) ++#define TARGET_SNDRV_CTL_IOCTL_TLV_WRITE TARGET_IOWRU('U', 0x1b) ++#define TARGET_SNDRV_CTL_IOCTL_TLV_COMMAND TARGET_IOWRU('U', 0x1c) ++#define TARGET_SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE TARGET_IOWR('U', 0x20, int) ++#define TARGET_SNDRV_CTL_IOCTL_HWDEP_INFO TARGET_IORU('U', 0x21) ++#define TARGET_SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE TARGET_IOR('U', 0x30, int) ++#define TARGET_SNDRV_CTL_IOCTL_PCM_INFO TARGET_IOWRU('U', 0x31) ++#define TARGET_SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE TARGET_IOW('U', 0x32, int) ++#define TARGET_SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE TARGET_IOWR('U', 0x40, int) ++#define TARGET_SNDRV_CTL_IOCTL_RAWMIDI_INFO TARGET_IOWRU('U', 0x41) ++#define TARGET_SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE TARGET_IOW('U', 0x42, int) ++#define TARGET_SNDRV_CTL_IOCTL_POWER TARGET_IOWR('U', 0xd0, int) ++#define TARGET_SNDRV_CTL_IOCTL_POWER_STATE TARGET_IOR('U', 0xd1, int) ++#define TARGET_SNDRV_IOCTL_READV TARGET_IOWU('K', 0x00) ++#define TARGET_SNDRV_IOCTL_WRITEV TARGET_IOWU('K', 0x01) ++#define TARGET_SNDRV_EMU10K1_IOCTL_INFO TARGET_IORU ('H', 0x10) ++#define TARGET_SNDRV_EMU10K1_IOCTL_CODE_POKE TARGET_IOWU ('H', 0x11) ++#define TARGET_SNDRV_EMU10K1_IOCTL_CODE_PEEK TARGET_IOWRU('H', 0x12) ++#define TARGET_SNDRV_EMU10K1_IOCTL_TRAM_SETUP TARGET_IOW ('H', 0x20, int) ++#define TARGET_SNDRV_EMU10K1_IOCTL_TRAM_POKE TARGET_IOWU ('H', 0x21) ++#define TARGET_SNDRV_EMU10K1_IOCTL_TRAM_PEEK TARGET_IOWRU('H', 0x22) ++#define TARGET_SNDRV_EMU10K1_IOCTL_PCM_POKE TARGET_IOWU ('H', 0x30) ++#define TARGET_SNDRV_EMU10K1_IOCTL_PCM_PEEK TARGET_IOWRU('H', 0x31) ++#define TARGET_SNDRV_EMU10K1_IOCTL_PVERSION TARGET_IOR ('H', 0x40, int) ++#define TARGET_SNDRV_EMU10K1_IOCTL_STOP TARGET_IO ('H', 0x80) ++#define TARGET_SNDRV_EMU10K1_IOCTL_CONTINUE TARGET_IO ('H', 0x81) ++#define TARGET_SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER TARGET_IO ('H', 0x82) ++#define TARGET_SNDRV_EMU10K1_IOCTL_SINGLE_STEP TARGET_IOW ('H', 0x83, int) ++#define TARGET_SNDRV_EMU10K1_IOCTL_DBG_READ TARGET_IOR ('H', 0x84, int) ++#define TARGET_SNDRV_HDSP_IOCTL_GET_PEAK_RMS TARGET_IORU('H', 0x40) ++#define TARGET_SNDRV_HDSP_IOCTL_GET_CONFIG_INFO TARGET_IORU('H', 0x41) ++#define TARGET_SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE TARGET_IOWU('H', 0x42) ++#define TARGET_SNDRV_HDSP_IOCTL_GET_VERSION TARGET_IORU('H', 0x43) ++#define TARGET_SNDRV_HDSP_IOCTL_GET_MIXER TARGET_IORU('H', 0x44) ++#define TARGET_SNDRV_HDSP_IOCTL_GET_9632_AEB TARGET_IORU('H', 0x45) ++#define TARGET_SNDRV_SB_CSP_IOCTL_INFO TARGET_IORU('H', 0x10) ++#define TARGET_SNDRV_SB_CSP_IOCTL_LOAD_CODE TARGET_IOWU('H', 0x11) ++#define TARGET_SNDRV_SB_CSP_IOCTL_UNLOAD_CODE TARGET_IO('H', 0x12) ++#define TARGET_SNDRV_SB_CSP_IOCTL_START TARGET_IOWU('H', 0x13) ++#define TARGET_SNDRV_SB_CSP_IOCTL_STOP TARGET_IO('H', 0x14) ++#define TARGET_SNDRV_SB_CSP_IOCTL_PAUSE TARGET_IO('H', 0x15) ++#define TARGET_SNDRV_SB_CSP_IOCTL_RESTART TARGET_IO('H', 0x16) ++#define TARGET_SND_SSCAPE_LOAD_BOOTB TARGET_IOWRU('P', 100) ++#define TARGET_SND_SSCAPE_LOAD_MCODE TARGET_IOWU ('P', 101) ++ ++IOCTL( SNDRV_SEQ_IOCTL_PVERSION , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_SEQ_IOCTL_CLIENT_ID , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_SEQ_IOCTL_SYSTEM_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_system_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_RUNNING_MODE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_running_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_CLIENT_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_client_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SET_CLIENT_INFO , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_client_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_CREATE_PORT , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_DELETE_PORT , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_PORT_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SET_PORT_INFO , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_subscribe)) ) ++IOCTL( SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_subscribe)) ) ++IOCTL( SNDRV_SEQ_IOCTL_CREATE_QUEUE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_DELETE_QUEUE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_QUEUE_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SET_QUEUE_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_status)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_tempo)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_tempo)) ) ++//IOCTL( SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_owner)) ) ++//IOCTL( SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_owner)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_timer)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_timer)) ) ++//IOCTL( SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_sync)) ) ++//IOCTL( SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_sync)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_client)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_queue_client)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_CLIENT_POOL , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_client_pool)) ) ++IOCTL( SNDRV_SEQ_IOCTL_SET_CLIENT_POOL , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_client_pool)) ) ++IOCTL( SNDRV_SEQ_IOCTL_REMOVE_EVENTS , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_remove_events)) ) ++IOCTL( SNDRV_SEQ_IOCTL_QUERY_SUBS , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_query_subs)) ) ++IOCTL( SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_subscribe)) ) ++IOCTL( SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_client_info)) ) ++IOCTL( SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_seq_port_info)) ) ++IOCTL( SNDRV_DM_FM_IOCTL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_snd_dm_fm_info)) ) ++IOCTL( SNDRV_DM_FM_IOCTL_RESET , 0, TYPE_NULL ) ++IOCTL( SNDRV_DM_FM_IOCTL_PLAY_NOTE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_snd_dm_fm_note)) ) ++IOCTL( SNDRV_DM_FM_IOCTL_SET_VOICE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_snd_dm_fm_voice)) ) ++IOCTL( SNDRV_DM_FM_IOCTL_SET_PARAMS , IOC_W, MK_PTR(MK_STRUCT(STRUCT_snd_dm_fm_params)) ) ++IOCTL( SNDRV_DM_FM_IOCTL_SET_MODE , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_DM_FM_IOCTL_SET_CONNECTION , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_HWDEP_IOCTL_PVERSION , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_HWDEP_IOCTL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_hwdep_info)) ) ++IOCTL( SNDRV_HWDEP_IOCTL_DSP_STATUS , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_hwdep_dsp_status)) ) ++IOCTL( SNDRV_HWDEP_IOCTL_DSP_LOAD , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_hwdep_dsp_image)) ) ++IOCTL( SNDRV_PCM_IOCTL_PVERSION , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_PCM_IOCTL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_info)) ) ++IOCTL( SNDRV_PCM_IOCTL_TSTAMP , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_PCM_IOCTL_HW_REFINE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_hw_params)) ) ++IOCTL( SNDRV_PCM_IOCTL_HW_PARAMS , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_hw_params)) ) ++IOCTL( SNDRV_PCM_IOCTL_HW_FREE , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_SW_PARAMS , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_sw_params)) ) ++IOCTL( SNDRV_PCM_IOCTL_STATUS , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_status)) ) ++IOCTL( SNDRV_PCM_IOCTL_DELAY , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_sframes)) ) ++IOCTL( SNDRV_PCM_IOCTL_HWSYNC , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_SYNC_PTR , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_sync_ptr)) ) ++IOCTL( SNDRV_PCM_IOCTL_CHANNEL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_channel_info)) ) ++IOCTL( SNDRV_PCM_IOCTL_PREPARE , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_RESET , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_START , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_DROP , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_DRAIN , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_PAUSE , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_PCM_IOCTL_REWIND , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_uframes)) ) ++IOCTL( SNDRV_PCM_IOCTL_RESUME , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_XRUN , 0, TYPE_NULL ) ++IOCTL( SNDRV_PCM_IOCTL_FORWARD , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_uframes)) ) ++IOCTL( SNDRV_PCM_IOCTL_WRITEI_FRAMES , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_xferi)) ) ++IOCTL( SNDRV_PCM_IOCTL_READI_FRAMES , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_xferi)) ) ++IOCTL( SNDRV_PCM_IOCTL_WRITEN_FRAMES , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_xfern)) ) ++IOCTL( SNDRV_PCM_IOCTL_READN_FRAMES , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_xfern)) ) ++IOCTL( SNDRV_PCM_IOCTL_LINK , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_PCM_IOCTL_UNLINK , 0, TYPE_NULL ) ++IOCTL( SNDRV_RAWMIDI_IOCTL_PVERSION , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_RAWMIDI_IOCTL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_rawmidi_info)) ) ++IOCTL( SNDRV_RAWMIDI_IOCTL_PARAMS , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_rawmidi_params)) ) ++IOCTL( SNDRV_RAWMIDI_IOCTL_STATUS , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_rawmidi_status)) ) ++IOCTL( SNDRV_RAWMIDI_IOCTL_DROP , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_RAWMIDI_IOCTL_DRAIN , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_TIMER_IOCTL_PVERSION , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_TIMER_IOCTL_NEXT_DEVICE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_id)) ) ++IOCTL( SNDRV_TIMER_IOCTL_TREAD , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_TIMER_IOCTL_GINFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_ginfo)) ) ++IOCTL( SNDRV_TIMER_IOCTL_GPARAMS , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_gparams)) ) ++IOCTL( SNDRV_TIMER_IOCTL_GSTATUS , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_gstatus)) ) ++IOCTL( SNDRV_TIMER_IOCTL_SELECT , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_select)) ) ++IOCTL( SNDRV_TIMER_IOCTL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_info)) ) ++IOCTL( SNDRV_TIMER_IOCTL_PARAMS , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_params)) ) ++IOCTL( SNDRV_TIMER_IOCTL_STATUS , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_timer_status)) ) ++IOCTL( SNDRV_TIMER_IOCTL_START , 0, TYPE_NULL ) ++IOCTL( SNDRV_TIMER_IOCTL_STOP , 0, TYPE_NULL ) ++IOCTL( SNDRV_TIMER_IOCTL_CONTINUE , 0, TYPE_NULL ) ++IOCTL( SNDRV_TIMER_IOCTL_PAUSE , 0, TYPE_NULL ) ++IOCTL( SNDRV_CTL_IOCTL_PVERSION , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_CARD_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_card_info)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_LIST , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_list)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_info)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_READ , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_value)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_WRITE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_value)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_LOCK , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_id)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_UNLOCK , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_id)) ) ++IOCTL( SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS , IOC_RW, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_ADD , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_info)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_REPLACE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_info)) ) ++IOCTL( SNDRV_CTL_IOCTL_ELEM_REMOVE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_elem_id)) ) ++IOCTL( SNDRV_CTL_IOCTL_TLV_READ , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_tlv)) ) ++IOCTL( SNDRV_CTL_IOCTL_TLV_WRITE , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_tlv)) ) ++IOCTL( SNDRV_CTL_IOCTL_TLV_COMMAND , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_ctl_tlv)) ) ++IOCTL( SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE , IOC_RW, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_HWDEP_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_sndrv_hwdep_info)) ) ++IOCTL( SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_PCM_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_pcm_info)) ) ++IOCTL( SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE , IOC_RW, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_RAWMIDI_INFO , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sndrv_rawmidi_info)) ) ++IOCTL( SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_POWER , IOC_RW, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_CTL_IOCTL_POWER_STATE , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_IOCTL_READV , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_xferv)) ) ++IOCTL( SNDRV_IOCTL_WRITEV , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sndrv_xferv)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_emu10k1_fx8010_info)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_CODE_POKE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_emu10k1_fx8010_code)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_CODE_PEEK , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_emu10k1_fx8010_code)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_TRAM_SETUP , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_TRAM_POKE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_emu10k1_fx8010_tram)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_TRAM_PEEK , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_emu10k1_fx8010_tram)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_PCM_POKE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_emu10k1_fx8010_pcm)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_PCM_PEEK , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_emu10k1_fx8010_pcm)) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_PVERSION , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_STOP , 0, TYPE_NULL ) ++IOCTL( SNDRV_EMU10K1_IOCTL_CONTINUE , 0, TYPE_NULL ) ++IOCTL( SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER , 0, TYPE_NULL ) ++IOCTL( SNDRV_EMU10K1_IOCTL_SINGLE_STEP , IOC_W, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_EMU10K1_IOCTL_DBG_READ , IOC_R, MK_PTR(TYPE_INT) ) ++IOCTL( SNDRV_HDSP_IOCTL_GET_PEAK_RMS , IOC_R, MK_PTR(MK_STRUCT(STRUCT_hdsp_peak_rms)) ) ++IOCTL( SNDRV_HDSP_IOCTL_GET_CONFIG_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_hdsp_config_info)) ) ++IOCTL( SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_hdsp_firmware)) ) ++IOCTL( SNDRV_HDSP_IOCTL_GET_VERSION , IOC_R, MK_PTR(MK_STRUCT(STRUCT_hdsp_version)) ) ++IOCTL( SNDRV_HDSP_IOCTL_GET_MIXER , IOC_R, MK_PTR(MK_STRUCT(STRUCT_hdsp_mixer)) ) ++IOCTL( SNDRV_HDSP_IOCTL_GET_9632_AEB , IOC_R, MK_PTR(MK_STRUCT(STRUCT_hdsp_9632_aeb)) ) ++IOCTL( SNDRV_SB_CSP_IOCTL_INFO , IOC_R, MK_PTR(MK_STRUCT(STRUCT_snd_sb_csp_info)) ) ++#if _IOC_SIZEBITS > 13 ++IOCTL( SNDRV_SB_CSP_IOCTL_LOAD_CODE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_snd_sb_csp_microcode)) ) ++#endif ++IOCTL( SNDRV_SB_CSP_IOCTL_UNLOAD_CODE , 0, TYPE_NULL ) ++IOCTL( SNDRV_SB_CSP_IOCTL_START , IOC_W, MK_PTR(MK_STRUCT(STRUCT_snd_sb_csp_start)) ) ++IOCTL( SNDRV_SB_CSP_IOCTL_STOP , 0, TYPE_NULL ) ++IOCTL( SNDRV_SB_CSP_IOCTL_PAUSE , 0, TYPE_NULL ) ++IOCTL( SNDRV_SB_CSP_IOCTL_RESTART , 0, TYPE_NULL ) ++IOCTL( SND_SSCAPE_LOAD_BOOTB , IOC_RW, MK_PTR(MK_STRUCT(STRUCT_sscape_bootblock)) ) ++IOCTL( SND_SSCAPE_LOAD_MCODE , IOC_W, MK_PTR(MK_STRUCT(STRUCT_sscape_microcode)) ) +diff --git a/linux-user/ioctls_alsa_structs.h b/linux-user/ioctls_alsa_structs.h +new file mode 100644 +index 0000000..e09a30d +--- /dev/null ++++ b/linux-user/ioctls_alsa_structs.h +@@ -0,0 +1,1740 @@ ++/* ++ * Advanced Linux Sound Architecture ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ */ ++ ++#ifndef __u8 ++#define __u8 uint8_t ++#define __u16 uint16_t ++#define __u32 uint32_t ++#define __s8 int8_t ++#define __s16 int16_t ++#define __s32 int32_t ++#endif ++ ++#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000 ++#define HDSP_MATRIX_MIXER_SIZE 2048 ++#define SNDRV_MASK_MAX 256 ++ ++typedef struct fm_operator { ++ unsigned char am_vib; ++ unsigned char ksl_level; ++ unsigned char attack_decay; ++ unsigned char sustain_release; ++ unsigned char wave_select; ++} fm_operator_t; ++ ++typedef struct { ++ unsigned int share_id[4]; /* share id - zero = no sharing */ ++ unsigned char type; /* instrument type */ ++ ++ fm_operator_t op[4]; ++ unsigned char feedback_connection[2]; ++ ++ unsigned char echo_delay; ++ unsigned char echo_atten; ++ unsigned char chorus_spread; ++ unsigned char trnsps; ++ unsigned char fix_dur; ++ unsigned char modes; ++ unsigned char fix_key; ++} fm_instrument_t; ++ ++typedef struct fm_xoperator { ++ __u8 am_vib; ++ __u8 ksl_level; ++ __u8 attack_decay; ++ __u8 sustain_release; ++ __u8 wave_select; ++} fm_xoperator_t; ++ ++typedef struct fm_xinstrument { ++ __u32 stype; /* structure type */ ++ ++ __u32 share_id[4]; /* share id - zero = no sharing */ ++ __u8 type; /* instrument type */ ++ ++ fm_xoperator_t op[4]; /* fm operators */ ++ __u8 feedback_connection[2]; ++ ++ __u8 echo_delay; ++ __u8 echo_atten; ++ __u8 chorus_spread; ++ __u8 trnsps; ++ __u8 fix_dur; ++ __u8 modes; ++ __u8 fix_key; ++} fm_xinstrument_t; ++ ++typedef struct gf1_wave { ++ unsigned int share_id[4]; /* share id - zero = no sharing */ ++ unsigned int format; /* wave format */ ++ ++ struct { ++ unsigned int number; /* some other ID for this instrument */ ++ unsigned int memory; /* begin of waveform in onboard memory */ ++ unsigned char *ptr; /* pointer to waveform in system memory */ ++ } address; ++ ++ unsigned int size; /* size of waveform in samples */ ++ unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned short loop_repeat; /* loop repeat - 0 = forever */ ++ ++ unsigned char flags; /* GF1 patch flags */ ++ unsigned char pad; ++ unsigned int sample_rate; /* sample rate in Hz */ ++ unsigned int low_frequency; /* low frequency range */ ++ unsigned int high_frequency; /* high frequency range */ ++ unsigned int root_frequency; /* root frequency range */ ++ signed short tune; ++ unsigned char balance; ++ unsigned char envelope_rate[6]; ++ unsigned char envelope_offset[6]; ++ unsigned char tremolo_sweep; ++ unsigned char tremolo_rate; ++ unsigned char tremolo_depth; ++ unsigned char vibrato_sweep; ++ unsigned char vibrato_rate; ++ unsigned char vibrato_depth; ++ unsigned short scale_frequency; ++ unsigned short scale_factor; /* 0-2048 or 0-2 */ ++ ++ struct gf1_wave *next; ++} gf1_wave_t; ++ ++typedef struct { ++ unsigned short exclusion; ++ unsigned short exclusion_group; /* 0 - none, 1-65535 */ ++ ++ unsigned char effect1; /* effect 1 */ ++ unsigned char effect1_depth; /* 0-127 */ ++ unsigned char effect2; /* effect 2 */ ++ unsigned char effect2_depth; /* 0-127 */ ++ ++ gf1_wave_t *wave; /* first waveform */ ++} gf1_instrument_t; ++ ++typedef struct gf1_xwave { ++ __u32 stype; /* structure type */ ++ ++ __u32 share_id[4]; /* share id - zero = no sharing */ ++ __u32 format; /* wave format */ ++ ++ __u32 size; /* size of waveform in samples */ ++ __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u16 loop_repeat; /* loop repeat - 0 = forever */ ++ ++ __u8 flags; /* GF1 patch flags */ ++ __u8 pad; ++ __u32 sample_rate; /* sample rate in Hz */ ++ __u32 low_frequency; /* low frequency range */ ++ __u32 high_frequency; /* high frequency range */ ++ __u32 root_frequency; /* root frequency range */ ++ __s16 tune; ++ __u8 balance; ++ __u8 envelope_rate[6]; ++ __u8 envelope_offset[6]; ++ __u8 tremolo_sweep; ++ __u8 tremolo_rate; ++ __u8 tremolo_depth; ++ __u8 vibrato_sweep; ++ __u8 vibrato_rate; ++ __u8 vibrato_depth; ++ __u16 scale_frequency; ++ __u16 scale_factor; /* 0-2048 or 0-2 */ ++} gf1_xwave_t; ++ ++typedef struct gf1_xinstrument { ++ __u32 stype; ++ ++ __u16 exclusion; ++ __u16 exclusion_group; /* 0 - none, 1-65535 */ ++ ++ __u8 effect1; /* effect 1 */ ++ __u8 effect1_depth; /* 0-127 */ ++ __u8 effect2; /* effect 2 */ ++ __u8 effect2_depth; /* 0-127 */ ++} gf1_xinstrument_t; ++ ++typedef struct gf1_info { ++ unsigned char flags; /* supported wave flags */ ++ unsigned char pad[3]; ++ unsigned int features; /* supported features */ ++ unsigned int max8_len; /* maximum 8-bit wave length */ ++ unsigned int max16_len; /* maximum 16-bit wave length */ ++} gf1_info_t; ++ ++typedef struct iwffff_wave { ++ unsigned int share_id[4]; /* share id - zero = no sharing */ ++ unsigned int format; /* wave format */ ++ ++ struct { ++ unsigned int number; /* some other ID for this wave */ ++ unsigned int memory; /* begin of waveform in onboard memory */ ++ unsigned char *ptr; /* pointer to waveform in system memory */ ++ } address; ++ ++ unsigned int size; /* size of waveform in samples */ ++ unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned short loop_repeat; /* loop repeat - 0 = forever */ ++ unsigned int sample_ratio; /* sample ratio (44100 * 1024 / rate) */ ++ unsigned char attenuation; /* 0 - 127 (no corresponding midi controller) */ ++ unsigned char low_note; /* lower frequency range for this waveform */ ++ unsigned char high_note; /* higher frequency range for this waveform */ ++ unsigned char pad; ++ ++ struct iwffff_wave *next; ++} iwffff_wave_t; ++ ++typedef struct iwffff_lfo { ++ unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */ ++ signed short depth; /* volume +- (0-255) 0.48675dB/step */ ++ signed short sweep; /* 0 - 950 deciseconds */ ++ unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */ ++ unsigned char delay; /* 0 - 255 deciseconds */ ++} iwffff_lfo_t; ++ ++typedef struct iwffff_env_point { ++ unsigned short offset; ++ unsigned short rate; ++} iwffff_env_point_t; ++ ++typedef struct iwffff_env_record { ++ unsigned short nattack; ++ unsigned short nrelease; ++ unsigned short sustain_offset; ++ unsigned short sustain_rate; ++ unsigned short release_rate; ++ unsigned char hirange; ++ unsigned char pad; ++ struct iwffff_env_record *next; ++ /* points are stored here */ ++ /* count of points = nattack + nrelease */ ++} iwffff_env_record_t; ++ ++typedef struct iwffff_env { ++ unsigned char flags; ++ unsigned char mode; ++ unsigned char index; ++ unsigned char pad; ++ struct iwffff_env_record *record; ++} iwffff_env_t; ++ ++typedef struct iwffff_layer { ++ unsigned char flags; ++ unsigned char velocity_mode; ++ unsigned char layer_event; ++ unsigned char low_range; /* range for layer based */ ++ unsigned char high_range; /* on either velocity or frequency */ ++ unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */ ++ unsigned char pan_freq_scale; /* position based on frequency (0-127) */ ++ unsigned char attenuation; /* 0-127 (no corresponding midi controller) */ ++ iwffff_lfo_t tremolo; /* tremolo effect */ ++ iwffff_lfo_t vibrato; /* vibrato effect */ ++ unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ ++ unsigned char freq_center; /* center for keyboard frequency scaling */ ++ unsigned char pad; ++ iwffff_env_t penv; /* pitch envelope */ ++ iwffff_env_t venv; /* volume envelope */ ++ ++ iwffff_wave_t *wave; ++ struct iwffff_layer *next; ++} iwffff_layer_t; ++ ++typedef struct { ++ unsigned short exclusion; ++ unsigned short layer_type; ++ unsigned short exclusion_group; /* 0 - none, 1-65535 */ ++ ++ unsigned char effect1; /* effect 1 */ ++ unsigned char effect1_depth; /* 0-127 */ ++ unsigned char effect2; /* effect 2 */ ++ unsigned char effect2_depth; /* 0-127 */ ++ ++ iwffff_layer_t *layer; /* first layer */ ++} iwffff_instrument_t; ++ ++typedef struct iwffff_xwave { ++ __u32 stype; /* structure type */ ++ ++ __u32 share_id[4]; /* share id - zero = no sharing */ ++ ++ __u32 format; /* wave format */ ++ __u32 offset; /* offset to ROM (address) */ ++ ++ __u32 size; /* size of waveform in samples */ ++ __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u16 loop_repeat; /* loop repeat - 0 = forever */ ++ __u32 sample_ratio; /* sample ratio (44100 * 1024 / rate) */ ++ __u8 attenuation; /* 0 - 127 (no corresponding midi controller) */ ++ __u8 low_note; /* lower frequency range for this waveform */ ++ __u8 high_note; /* higher frequency range for this waveform */ ++ __u8 pad; ++} iwffff_xwave_t; ++ ++typedef struct iwffff_xlfo { ++ __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */ ++ __s16 depth; /* volume +- (0-255) 0.48675dB/step */ ++ __s16 sweep; /* 0 - 950 deciseconds */ ++ __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */ ++ __u8 delay; /* 0 - 255 deciseconds */ ++} iwffff_xlfo_t; ++ ++typedef struct iwffff_xenv_point { ++ __u16 offset; ++ __u16 rate; ++} iwffff_xenv_point_t; ++ ++typedef struct iwffff_xenv_record { ++ __u32 stype; ++ __u16 nattack; ++ __u16 nrelease; ++ __u16 sustain_offset; ++ __u16 sustain_rate; ++ __u16 release_rate; ++ __u8 hirange; ++ __u8 pad; ++ /* points are stored here.. */ ++ /* count of points = nattack + nrelease */ ++} iwffff_xenv_record_t; ++ ++typedef struct iwffff_xenv { ++ __u8 flags; ++ __u8 mode; ++ __u8 index; ++ __u8 pad; ++} iwffff_xenv_t; ++ ++typedef struct iwffff_xlayer { ++ __u32 stype; ++ __u8 flags; ++ __u8 velocity_mode; ++ __u8 layer_event; ++ __u8 low_range; /* range for layer based */ ++ __u8 high_range; /* on either velocity or frequency */ ++ __u8 pan; /* pan offset from CC1 (0 left - 127 right) */ ++ __u8 pan_freq_scale; /* position based on frequency (0-127) */ ++ __u8 attenuation; /* 0-127 (no corresponding midi controller) */ ++ iwffff_xlfo_t tremolo; /* tremolo effect */ ++ iwffff_xlfo_t vibrato; /* vibrato effect */ ++ __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ ++ __u8 freq_center; /* center for keyboard frequency scaling */ ++ __u8 pad; ++ iwffff_xenv_t penv; /* pitch envelope */ ++ iwffff_xenv_t venv; /* volume envelope */ ++} iwffff_xlayer_t; ++ ++typedef struct iwffff_xinstrument { ++ __u32 stype; ++ ++ __u16 exclusion; ++ __u16 layer_type; ++ __u16 exclusion_group; /* 0 - none, 1-65535 */ ++ ++ __u8 effect1; /* effect 1 */ ++ __u8 effect1_depth; /* 0-127 */ ++ __u8 effect2; /* effect 2 */ ++ __u8 effect2_depth; /* 0-127 */ ++} iwffff_xinstrument_t; ++ ++typedef struct { ++ __u8 iwave[8]; ++ __u8 revision; ++ __u8 series_number; ++ __u8 series_name[16]; ++ __u8 date[10]; ++ __u16 vendor_revision_major; ++ __u16 vendor_revision_minor; ++ __u32 rom_size; ++ __u8 copyright[128]; ++ __u8 vendor_name[64]; ++ __u8 description[128]; ++} iwffff_rom_header_t; ++ ++typedef struct iwffff_info { ++ unsigned int format; /* supported format bits */ ++ unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */ ++ unsigned int lfos; /* LFO effects */ ++ unsigned int max8_len; /* maximum 8-bit wave length */ ++ unsigned int max16_len; /* maximum 16-bit wave length */ ++} iwffff_info_t; ++ ++typedef struct simple_instrument_info { ++ unsigned int format; /* supported format bits */ ++ unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */ ++ unsigned int max8_len; /* maximum 8-bit wave length */ ++ unsigned int max16_len; /* maximum 16-bit wave length */ ++} simple_instrument_info_t; ++ ++typedef struct { ++ unsigned int share_id[4]; /* share id - zero = no sharing */ ++ unsigned int format; /* wave format */ ++ ++ struct { ++ unsigned int number; /* some other ID for this instrument */ ++ unsigned int memory; /* begin of waveform in onboard memory */ ++ unsigned char *ptr; /* pointer to waveform in system memory */ ++ } address; ++ ++ unsigned int size; /* size of waveform in samples */ ++ unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned int loop_start; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned int loop_end; /* loop end offset in samples * 16 (lowest 4 bits - fraction) */ ++ unsigned short loop_repeat; /* loop repeat - 0 = forever */ ++ ++ unsigned char effect1; /* effect 1 */ ++ unsigned char effect1_depth; /* 0-127 */ ++ unsigned char effect2; /* effect 2 */ ++ unsigned char effect2_depth; /* 0-127 */ ++} simple_instrument_t; ++ ++typedef struct simple_xinstrument { ++ __u32 stype; ++ ++ __u32 share_id[4]; /* share id - zero = no sharing */ ++ __u32 format; /* wave format */ ++ ++ __u32 size; /* size of waveform in samples */ ++ __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ __u16 loop_repeat; /* loop repeat - 0 = forever */ ++ ++ __u8 effect1; /* effect 1 */ ++ __u8 effect1_depth; /* 0-127 */ ++ __u8 effect2; /* effect 2 */ ++ __u8 effect2_depth; /* 0-127 */ ++} simple_xinstrument_t; ++ ++typedef unsigned char sndrv_seq_event_type_t; ++ ++/** event address */ ++struct sndrv_seq_addr { ++ unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */ ++ unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */ ++}; ++ ++/** port connection */ ++struct sndrv_seq_connect { ++ struct sndrv_seq_addr sender; ++ struct sndrv_seq_addr dest; ++}; ++ ++struct sndrv_seq_ev_note { ++ unsigned char channel; ++ unsigned char note; ++ unsigned char velocity; ++ unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */ ++ unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */ ++}; ++ ++ /* controller event */ ++struct sndrv_seq_ev_ctrl { ++ unsigned char channel; ++ unsigned char unused1, unused2, unused3; /* pad */ ++ unsigned int param; ++ signed int value; ++}; ++ ++ /* generic set of bytes (12x8 bit) */ ++struct sndrv_seq_ev_raw8 { ++ unsigned char d[12]; /* 8 bit value */ ++}; ++ ++ /* generic set of integers (3x32 bit) */ ++struct sndrv_seq_ev_raw32 { ++ unsigned int d[3]; /* 32 bit value */ ++}; ++ ++ /* external stored data */ ++struct sndrv_seq_ev_ext { ++ unsigned int len; /* length of data */ ++ void *ptr; /* pointer to data (note: maybe 64-bit) */ ++} __attribute__((packed)); ++ ++/* Instrument cluster type */ ++typedef unsigned int sndrv_seq_instr_cluster_t; ++ ++/* Instrument type */ ++struct sndrv_seq_instr { ++ sndrv_seq_instr_cluster_t cluster; ++ unsigned int std; /* the upper byte means a private instrument (owner - client #) */ ++ unsigned short bank; ++ unsigned short prg; ++}; ++ ++ /* sample number */ ++struct sndrv_seq_ev_sample { ++ unsigned int std; ++ unsigned short bank; ++ unsigned short prg; ++}; ++ ++ /* sample cluster */ ++struct sndrv_seq_ev_cluster { ++ sndrv_seq_instr_cluster_t cluster; ++}; ++ ++ /* sample position */ ++typedef unsigned int sndrv_seq_position_t; /* playback position (in samples) * 16 */ ++ ++ /* sample stop mode */ ++enum sndrv_seq_stop_mode { ++ SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */ ++ SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */ ++ SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */ ++}; ++ ++ /* sample frequency */ ++typedef int sndrv_seq_frequency_t; /* playback frequency in HZ * 16 */ ++ ++ /* sample volume control; if any value is set to -1 == do not change */ ++struct sndrv_seq_ev_volume { ++ signed short volume; /* range: 0-16383 */ ++ signed short lr; /* left-right balance; range: 0-16383 */ ++ signed short fr; /* front-rear balance; range: 0-16383 */ ++ signed short du; /* down-up balance; range: 0-16383 */ ++}; ++ ++ /* simple loop redefinition */ ++struct sndrv_seq_ev_loop { ++ unsigned int start; /* loop start (in samples) * 16 */ ++ unsigned int end; /* loop end (in samples) * 16 */ ++}; ++ ++struct sndrv_seq_ev_sample_control { ++ unsigned char channel; ++ unsigned char unused1, unused2, unused3; /* pad */ ++ union { ++ struct sndrv_seq_ev_sample sample; ++ struct sndrv_seq_ev_cluster cluster; ++ sndrv_seq_position_t position; ++ int stop_mode; ++ sndrv_seq_frequency_t frequency; ++ struct sndrv_seq_ev_volume volume; ++ struct sndrv_seq_ev_loop loop; ++ unsigned char raw8[8]; ++ } param; ++}; ++ ++ ++ ++/* INSTR_BEGIN event */ ++struct sndrv_seq_ev_instr_begin { ++ int timeout; /* zero = forever, otherwise timeout in ms */ ++}; ++ ++struct sndrv_seq_result { ++ int event; /* processed event type */ ++ int result; ++}; ++ ++ ++struct sndrv_seq_real_time { ++ unsigned int tv_sec; /* seconds */ ++ unsigned int tv_nsec; /* nanoseconds */ ++}; ++ ++typedef unsigned int sndrv_seq_tick_time_t; /* midi ticks */ ++ ++union sndrv_seq_timestamp { ++ sndrv_seq_tick_time_t tick; ++ struct sndrv_seq_real_time time; ++}; ++ ++struct sndrv_seq_queue_skew { ++ unsigned int value; ++ unsigned int base; ++}; ++ ++ /* queue timer control */ ++struct sndrv_seq_ev_queue_control { ++ unsigned char queue; /* affected queue */ ++ unsigned char pad[3]; /* reserved */ ++ union { ++ signed int value; /* affected value (e.g. tempo) */ ++ union sndrv_seq_timestamp time; /* time */ ++ unsigned int position; /* sync position */ ++ struct sndrv_seq_queue_skew skew; ++ unsigned int d32[2]; ++ unsigned char d8[8]; ++ } param; ++}; ++ ++ /* quoted event - inside the kernel only */ ++struct sndrv_seq_ev_quote { ++ struct sndrv_seq_addr origin; /* original sender */ ++ unsigned short value; /* optional data */ ++ struct sndrv_seq_event *event; /* quoted event */ ++} __attribute__((packed)); ++ ++ ++ /* sequencer event */ ++struct sndrv_seq_event { ++ sndrv_seq_event_type_t type; /* event type */ ++ unsigned char flags; /* event flags */ ++ char tag; ++ ++ unsigned char queue; /* schedule queue */ ++ union sndrv_seq_timestamp time; /* schedule time */ ++ ++ ++ struct sndrv_seq_addr source; /* source address */ ++ struct sndrv_seq_addr dest; /* destination address */ ++ ++ union { /* event data... */ ++ struct sndrv_seq_ev_note note; ++ struct sndrv_seq_ev_ctrl control; ++ struct sndrv_seq_ev_raw8 raw8; ++ struct sndrv_seq_ev_raw32 raw32; ++ struct sndrv_seq_ev_ext ext; ++ struct sndrv_seq_ev_queue_control queue; ++ union sndrv_seq_timestamp time; ++ struct sndrv_seq_addr addr; ++ struct sndrv_seq_connect connect; ++ struct sndrv_seq_result result; ++ struct sndrv_seq_ev_instr_begin instr_begin; ++ struct sndrv_seq_ev_sample_control sample; ++ struct sndrv_seq_ev_quote quote; ++ } data; ++}; ++ ++ ++/* ++ * bounce event - stored as variable size data ++ */ ++struct sndrv_seq_event_bounce { ++ int err; ++ struct sndrv_seq_event event; ++ /* external data follows here. */ ++}; ++ ++struct sndrv_seq_system_info { ++ int queues; /* maximum queues count */ ++ int clients; /* maximum clients count */ ++ int ports; /* maximum ports per client */ ++ int channels; /* maximum channels per port */ ++ int cur_clients; /* current clients */ ++ int cur_queues; /* current queues */ ++ char reserved[24]; ++}; ++ ++struct sndrv_seq_running_info { ++ unsigned char client; /* client id */ ++ unsigned char big_endian; /* 1 = big-endian */ ++ unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */ ++ unsigned char pad; /* reserved */ ++ unsigned char reserved[12]; ++}; ++ ++enum sndrv_seq_client_type { ++ NO_CLIENT = 0, ++ USER_CLIENT = 1, ++ KERNEL_CLIENT = 2 ++}; ++ ++struct sndrv_seq_client_info { ++ int client; /* client number to inquire */ ++ int type; /* client type */ ++ char name[64]; /* client name */ ++ unsigned int filter; /* filter flags */ ++ unsigned char multicast_filter[8]; /* multicast filter bitmap */ ++ unsigned char event_filter[32]; /* event filter bitmap */ ++ int num_ports; /* RO: number of ports */ ++ int event_lost; /* number of lost events */ ++ char reserved[64]; /* for future use */ ++}; ++ ++struct sndrv_seq_client_pool { ++ int client; /* client number to inquire */ ++ int output_pool; /* outgoing (write) pool size */ ++ int input_pool; /* incoming (read) pool size */ ++ int output_room; /* minimum free pool size for select/blocking mode */ ++ int output_free; /* unused size */ ++ int input_free; /* unused size */ ++ char reserved[64]; ++}; ++ ++struct sndrv_seq_remove_events { ++ unsigned int remove_mode; /* Flags that determine what gets removed */ ++ ++ union sndrv_seq_timestamp time; ++ ++ unsigned char queue; /* Queue for REMOVE_DEST */ ++ struct sndrv_seq_addr dest; /* Address for REMOVE_DEST */ ++ unsigned char channel; /* Channel for REMOVE_DEST */ ++ ++ int type; /* For REMOVE_EVENT_TYPE */ ++ char tag; /* Tag for REMOVE_TAG */ ++ ++ int reserved[10]; /* To allow for future binary compatibility */ ++ ++}; ++ ++struct sndrv_seq_port_info { ++ struct sndrv_seq_addr addr; /* client/port numbers */ ++ char name[64]; /* port name */ ++ ++ unsigned int capability; /* port capability bits */ ++ unsigned int type; /* port type bits */ ++ int midi_channels; /* channels per MIDI port */ ++ int midi_voices; /* voices per MIDI port */ ++ int synth_voices; /* voices per SYNTH port */ ++ ++ int read_use; /* R/O: subscribers for output (from this port) */ ++ int write_use; /* R/O: subscribers for input (to this port) */ ++ ++ void *kernel; /* reserved for kernel use (must be NULL) */ ++ unsigned int flags; /* misc. conditioning */ ++ unsigned char time_queue; /* queue # for timestamping */ ++ char reserved[59]; /* for future use */ ++}; ++ ++struct sndrv_seq_queue_info { ++ int queue; /* queue id */ ++ ++ /* ++ * security settings, only owner of this queue can start/stop timer ++ * etc. if the queue is locked for other clients ++ */ ++ int owner; /* client id for owner of the queue */ ++ int locked:1; /* timing queue locked for other queues */ ++ char name[64]; /* name of this queue */ ++ unsigned int flags; /* flags */ ++ char reserved[60]; /* for future use */ ++ ++}; ++ ++struct sndrv_seq_queue_status { ++ int queue; /* queue id */ ++ int events; /* read-only - queue size */ ++ sndrv_seq_tick_time_t tick; /* current tick */ ++ struct sndrv_seq_real_time time; /* current time */ ++ int running; /* running state of queue */ ++ int flags; /* various flags */ ++ char reserved[64]; /* for the future */ ++}; ++ ++struct sndrv_seq_queue_tempo { ++ int queue; /* sequencer queue */ ++ unsigned int tempo; /* current tempo, us/tick */ ++ int ppq; /* time resolution, ticks/quarter */ ++ unsigned int skew_value; /* queue skew */ ++ unsigned int skew_base; /* queue skew base */ ++ char reserved[24]; /* for the future */ ++}; ++ ++struct sndrv_timer_id { ++ int dev_class; ++ int dev_sclass; ++ int card; ++ int device; ++ int subdevice; ++}; ++ ++struct sndrv_seq_queue_timer { ++ int queue; /* sequencer queue */ ++ int type; /* source timer type */ ++ union { ++ struct { ++ struct sndrv_timer_id id; /* ALSA's timer ID */ ++ unsigned int resolution; /* resolution in Hz */ ++ } alsa; ++ } u; ++ char reserved[64]; /* for the future use */ ++}; ++ ++struct sndrv_seq_queue_client { ++ int queue; /* sequencer queue */ ++ int client; /* sequencer client */ ++ int used; /* queue is used with this client ++ (must be set for accepting events) */ ++ /* per client watermarks */ ++ char reserved[64]; /* for future use */ ++}; ++ ++struct sndrv_seq_port_subscribe { ++ struct sndrv_seq_addr sender; /* sender address */ ++ struct sndrv_seq_addr dest; /* destination address */ ++ unsigned int voices; /* number of voices to be allocated (0 = don't care) */ ++ unsigned int flags; /* modes */ ++ unsigned char queue; /* input time-stamp queue (optional) */ ++ unsigned char pad[3]; /* reserved */ ++ char reserved[64]; ++}; ++ ++struct sndrv_seq_query_subs { ++ struct sndrv_seq_addr root; /* client/port id to be searched */ ++ int type; /* READ or WRITE */ ++ int index; /* 0..N-1 */ ++ int num_subs; /* R/O: number of subscriptions on this port */ ++ struct sndrv_seq_addr addr; /* R/O: result */ ++ unsigned char queue; /* R/O: result */ ++ unsigned int flags; /* R/O: result */ ++ char reserved[64]; /* for future use */ ++}; ++ ++/* size of ROM/RAM */ ++typedef unsigned int sndrv_seq_instr_size_t; ++ ++struct sndrv_seq_instr_info { ++ int result; /* operation result */ ++ unsigned int formats[8]; /* bitmap of supported formats */ ++ int ram_count; /* count of RAM banks */ ++ sndrv_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */ ++ int rom_count; /* count of ROM banks */ ++ sndrv_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */ ++ char reserved[128]; ++}; ++ ++struct sndrv_seq_instr_status { ++ int result; /* operation result */ ++ sndrv_seq_instr_size_t free_ram[16]; /* free RAM in banks */ ++ int instrument_count; /* count of downloaded instruments */ ++ char reserved[128]; ++}; ++ ++struct sndrv_seq_instr_format_info { ++ char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */ ++ unsigned int len; /* max data length (without this structure) */ ++}; ++ ++struct sndrv_seq_instr_format_info_result { ++ int result; /* operation result */ ++ char format[16]; /* format identifier */ ++ unsigned int len; /* filled data length (without this structure) */ ++}; ++ ++struct sndrv_seq_instr_data { ++ char name[32]; /* instrument name */ ++ char reserved[16]; /* for the future use */ ++ int type; /* instrument type */ ++ union { ++ char format[16]; /* format identifier */ ++ struct sndrv_seq_instr alias; ++ } data; ++}; ++ ++struct sndrv_seq_instr_header { ++ union { ++ struct sndrv_seq_instr instr; ++ sndrv_seq_instr_cluster_t cluster; ++ } id; /* instrument identifier */ ++ unsigned int cmd; /* get/put/free command */ ++ unsigned int flags; /* query flags (only for get) */ ++ unsigned int len; /* real instrument data length (without header) */ ++ int result; /* operation result */ ++ char reserved[16]; /* for the future */ ++ struct sndrv_seq_instr_data data; /* instrument data (for put/get result) */ ++}; ++ ++struct sndrv_seq_instr_cluster_set { ++ sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ ++ char name[32]; /* cluster name */ ++ int priority; /* cluster priority */ ++ char reserved[64]; /* for the future use */ ++}; ++ ++struct sndrv_seq_instr_cluster_get { ++ sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ ++ char name[32]; /* cluster name */ ++ int priority; /* cluster priority */ ++ char reserved[64]; /* for the future use */ ++}; ++ ++typedef struct snd_dm_fm_info { ++ unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */ ++ unsigned char rhythm; /* percussion mode flag */ ++} snd_dm_fm_info_t; ++ ++typedef struct snd_dm_fm_voice { ++ unsigned char op; /* operator cell (0 or 1) */ ++ unsigned char voice; /* FM voice (0 to 17) */ ++ ++ unsigned char am; /* amplitude modulation */ ++ unsigned char vibrato; /* vibrato effect */ ++ unsigned char do_sustain; /* sustain phase */ ++ unsigned char kbd_scale; /* keyboard scaling */ ++ unsigned char harmonic; /* 4 bits: harmonic and multiplier */ ++ unsigned char scale_level; /* 2 bits: decrease output freq rises */ ++ unsigned char volume; /* 6 bits: volume */ ++ ++ unsigned char attack; /* 4 bits: attack rate */ ++ unsigned char decay; /* 4 bits: decay rate */ ++ unsigned char sustain; /* 4 bits: sustain level */ ++ unsigned char release; /* 4 bits: release rate */ ++ ++ unsigned char feedback; /* 3 bits: feedback for op0 */ ++ unsigned char connection; /* 0 for serial, 1 for parallel */ ++ unsigned char left; /* stereo left */ ++ unsigned char right; /* stereo right */ ++ unsigned char waveform; /* 3 bits: waveform shape */ ++} snd_dm_fm_voice_t; ++ ++typedef struct snd_dm_fm_note { ++ unsigned char voice; /* 0-17 voice channel */ ++ unsigned char octave; /* 3 bits: what octave to play */ ++ unsigned int fnum; /* 10 bits: frequency number */ ++ unsigned char key_on; /* set for active, clear for silent */ ++} snd_dm_fm_note_t; ++ ++typedef struct snd_dm_fm_params { ++ unsigned char am_depth; /* amplitude modulation depth (1=hi) */ ++ unsigned char vib_depth; /* vibrato depth (1=hi) */ ++ unsigned char kbd_split; /* keyboard split */ ++ unsigned char rhythm; /* percussion mode select */ ++ ++ /* This block is the percussion instrument data */ ++ unsigned char bass; ++ unsigned char snare; ++ unsigned char tomtom; ++ unsigned char cymbal; ++ unsigned char hihat; ++} snd_dm_fm_params_t; ++ ++#include ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++#define SNDRV_LITTLE_ENDIAN ++#elif __BYTE_ORDER == __BIG_ENDIAN ++#define SNDRV_BIG_ENDIAN ++#else ++#error "Unsupported endian..." ++#endif ++ ++#include ++#include ++ ++struct sndrv_aes_iec958 { ++ unsigned char status[24]; /* AES/IEC958 channel status bits */ ++ unsigned char subcode[147]; /* AES/IEC958 subcode bits */ ++ unsigned char pad; /* nothing */ ++ unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */ ++}; ++ ++enum sndrv_hwdep_iface { ++ SNDRV_HWDEP_IFACE_OPL2 = 0, ++ SNDRV_HWDEP_IFACE_OPL3, ++ SNDRV_HWDEP_IFACE_OPL4, ++ SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */ ++ SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */ ++ SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */ ++ SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */ ++ SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */ ++ SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */ ++ SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */ ++ SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */ ++ SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */ ++ SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */ ++ SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */ ++ SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ ++ SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */ ++ ++ /* Don't forget to change the following: */ ++ SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC ++}; ++ ++struct sndrv_hwdep_info { ++ unsigned int device; /* WR: device number */ ++ int card; /* R: card number */ ++ unsigned char id[64]; /* ID (user selectable) */ ++ unsigned char name[80]; /* hwdep name */ ++ int iface; /* hwdep interface */ ++ unsigned char reserved[64]; /* reserved for future */ ++}; ++ ++/* generic DSP loader */ ++struct sndrv_hwdep_dsp_status { ++ unsigned int version; /* R: driver-specific version */ ++ unsigned char id[32]; /* R: driver-specific ID string */ ++ unsigned int num_dsps; /* R: number of DSP images to transfer */ ++ unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */ ++ unsigned int chip_ready; /* R: 1 = initialization finished */ ++ unsigned char reserved[16]; /* reserved for future use */ ++}; ++ ++struct sndrv_hwdep_dsp_image { ++ unsigned int index; /* W: DSP index */ ++ unsigned char name[64]; /* W: ID (e.g. file name) */ ++ unsigned char *image; /* W: binary image */ ++ size_t length; /* W: size of image in bytes */ ++ unsigned long driver_data; /* W: driver-specific data */ ++}; ++ ++typedef unsigned long sndrv_pcm_uframes_t; ++typedef long sndrv_pcm_sframes_t; ++ ++enum sndrv_pcm_class { ++ SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ ++ SNDRV_PCM_CLASS_MULTI, /* multichannel device */ ++ SNDRV_PCM_CLASS_MODEM, /* software modem class */ ++ SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */ ++ /* Don't forget to change the following: */ ++ SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, ++}; ++ ++enum sndrv_pcm_subclass { ++ SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */ ++ SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ ++ /* Don't forget to change the following: */ ++ SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, ++}; ++ ++enum sndrv_pcm_stream { ++ SNDRV_PCM_STREAM_PLAYBACK = 0, ++ SNDRV_PCM_STREAM_CAPTURE, ++ SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, ++}; ++ ++enum sndrv_pcm_access { ++ SNDRV_PCM_ACCESS_MMAP_INTERLEAVED = 0, /* interleaved mmap */ ++ SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED, /* noninterleaved mmap */ ++ SNDRV_PCM_ACCESS_MMAP_COMPLEX, /* complex mmap */ ++ SNDRV_PCM_ACCESS_RW_INTERLEAVED, /* readi/writei */ ++ SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, /* readn/writen */ ++ SNDRV_PCM_ACCESS_LAST = SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, ++}; ++ ++enum sndrv_pcm_format { ++ SNDRV_PCM_FORMAT_S8 = 0, ++ SNDRV_PCM_FORMAT_U8, ++ SNDRV_PCM_FORMAT_S16_LE, ++ SNDRV_PCM_FORMAT_S16_BE, ++ SNDRV_PCM_FORMAT_U16_LE, ++ SNDRV_PCM_FORMAT_U16_BE, ++ SNDRV_PCM_FORMAT_S24_LE, /* low three bytes */ ++ SNDRV_PCM_FORMAT_S24_BE, /* low three bytes */ ++ SNDRV_PCM_FORMAT_U24_LE, /* low three bytes */ ++ SNDRV_PCM_FORMAT_U24_BE, /* low three bytes */ ++ SNDRV_PCM_FORMAT_S32_LE, ++ SNDRV_PCM_FORMAT_S32_BE, ++ SNDRV_PCM_FORMAT_U32_LE, ++ SNDRV_PCM_FORMAT_U32_BE, ++ SNDRV_PCM_FORMAT_FLOAT_LE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ ++ SNDRV_PCM_FORMAT_FLOAT_BE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ ++ SNDRV_PCM_FORMAT_FLOAT64_LE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ ++ SNDRV_PCM_FORMAT_FLOAT64_BE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ ++ SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, /* IEC-958 subframe, Little Endian */ ++ SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, /* IEC-958 subframe, Big Endian */ ++ SNDRV_PCM_FORMAT_MU_LAW, ++ SNDRV_PCM_FORMAT_A_LAW, ++ SNDRV_PCM_FORMAT_IMA_ADPCM, ++ SNDRV_PCM_FORMAT_MPEG, ++ SNDRV_PCM_FORMAT_GSM, ++ SNDRV_PCM_FORMAT_SPECIAL = 31, ++ SNDRV_PCM_FORMAT_S24_3LE = 32, /* in three bytes */ ++ SNDRV_PCM_FORMAT_S24_3BE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_U24_3LE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_U24_3BE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_S20_3LE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_S20_3BE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_U20_3LE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_U20_3BE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_S18_3LE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_S18_3BE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_U18_3LE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_U18_3BE, /* in three bytes */ ++ SNDRV_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_U18_3BE, ++ ++#ifdef SNDRV_LITTLE_ENDIAN ++ SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_LE, ++ SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_LE, ++ SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_LE, ++ SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_LE, ++ SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_LE, ++ SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_LE, ++ SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_LE, ++ SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_LE, ++ SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, ++#endif ++#ifdef SNDRV_BIG_ENDIAN ++ SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_BE, ++ SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_BE, ++ SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_BE, ++ SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_BE, ++ SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_BE, ++ SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_BE, ++ SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_BE, ++ SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_BE, ++ SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, ++#endif ++}; ++ ++enum sndrv_pcm_subformat { ++ SNDRV_PCM_SUBFORMAT_STD = 0, ++ SNDRV_PCM_SUBFORMAT_LAST = SNDRV_PCM_SUBFORMAT_STD, ++}; ++ ++enum sndrv_pcm_state { ++ SNDRV_PCM_STATE_OPEN = 0, /* stream is open */ ++ SNDRV_PCM_STATE_SETUP, /* stream has a setup */ ++ SNDRV_PCM_STATE_PREPARED, /* stream is ready to start */ ++ SNDRV_PCM_STATE_RUNNING, /* stream is running */ ++ SNDRV_PCM_STATE_XRUN, /* stream reached an xrun */ ++ SNDRV_PCM_STATE_DRAINING, /* stream is draining */ ++ SNDRV_PCM_STATE_PAUSED, /* stream is paused */ ++ SNDRV_PCM_STATE_SUSPENDED, /* hardware is suspended */ ++ SNDRV_PCM_STATE_DISCONNECTED, /* hardware is disconnected */ ++ SNDRV_PCM_STATE_LAST = SNDRV_PCM_STATE_DISCONNECTED, ++}; ++ ++enum { ++ SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, ++ SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000, ++ SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, ++}; ++ ++union sndrv_pcm_sync_id { ++ unsigned char id[16]; ++ unsigned short id16[8]; ++ unsigned int id32[4]; ++}; ++ ++struct sndrv_pcm_info { ++ unsigned int device; /* RO/WR (control): device number */ ++ unsigned int subdevice; /* RO/WR (control): subdevice number */ ++ int stream; /* RO/WR (control): stream number */ ++ int card; /* R: card number */ ++ unsigned char id[64]; /* ID (user selectable) */ ++ unsigned char name[80]; /* name of this device */ ++ unsigned char subname[32]; /* subdevice name */ ++ int dev_class; /* SNDRV_PCM_CLASS_* */ ++ int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ ++ unsigned int subdevices_count; ++ unsigned int subdevices_avail; ++ union sndrv_pcm_sync_id sync; /* hardware synchronization ID */ ++ unsigned char reserved[64]; /* reserved for future... */ ++}; ++ ++enum sndrv_pcm_hw_param { ++ SNDRV_PCM_HW_PARAM_ACCESS = 0, /* Access type */ ++ SNDRV_PCM_HW_PARAM_FIRST_MASK = SNDRV_PCM_HW_PARAM_ACCESS, ++ SNDRV_PCM_HW_PARAM_FORMAT, /* Format */ ++ SNDRV_PCM_HW_PARAM_SUBFORMAT, /* Subformat */ ++ SNDRV_PCM_HW_PARAM_LAST_MASK = SNDRV_PCM_HW_PARAM_SUBFORMAT, ++ ++ SNDRV_PCM_HW_PARAM_SAMPLE_BITS = 8, /* Bits per sample */ ++ SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = SNDRV_PCM_HW_PARAM_SAMPLE_BITS, ++ SNDRV_PCM_HW_PARAM_FRAME_BITS, /* Bits per frame */ ++ SNDRV_PCM_HW_PARAM_CHANNELS, /* Channels */ ++ SNDRV_PCM_HW_PARAM_RATE, /* Approx rate */ ++ SNDRV_PCM_HW_PARAM_PERIOD_TIME, /* Approx distance between interrupts ++ in us */ ++ SNDRV_PCM_HW_PARAM_PERIOD_SIZE, /* Approx frames between interrupts */ ++ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, /* Approx bytes between interrupts */ ++ SNDRV_PCM_HW_PARAM_PERIODS, /* Approx interrupts per buffer */ ++ SNDRV_PCM_HW_PARAM_BUFFER_TIME, /* Approx duration of buffer in us */ ++ SNDRV_PCM_HW_PARAM_BUFFER_SIZE, /* Size of buffer in frames */ ++ SNDRV_PCM_HW_PARAM_BUFFER_BYTES, /* Size of buffer in bytes */ ++ SNDRV_PCM_HW_PARAM_TICK_TIME, /* Approx tick duration in us */ ++ SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME ++}; ++ ++struct sndrv_interval { ++ unsigned int min, max; ++ unsigned int openmin:1, ++ openmax:1, ++ integer:1, ++ empty:1; ++}; ++ ++struct sndrv_mask { ++ u_int32_t bits[(SNDRV_MASK_MAX+31)/32]; ++}; ++ ++struct sndrv_pcm_hw_params { ++ unsigned int flags; ++ struct sndrv_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - ++ SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; ++ struct sndrv_mask mres[5]; /* reserved masks */ ++ struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - ++ SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; ++ struct sndrv_interval ires[9]; /* reserved intervals */ ++ unsigned int rmask; /* W: requested masks */ ++ unsigned int cmask; /* R: changed masks */ ++ unsigned int info; /* R: Info flags for returned setup */ ++ unsigned int msbits; /* R: used most significant bits */ ++ unsigned int rate_num; /* R: rate numerator */ ++ unsigned int rate_den; /* R: rate denominator */ ++ sndrv_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ ++ unsigned char reserved[64]; /* reserved for future */ ++}; ++ ++enum sndrv_pcm_tstamp { ++ SNDRV_PCM_TSTAMP_NONE = 0, ++ SNDRV_PCM_TSTAMP_MMAP, ++ SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, ++}; ++ ++struct sndrv_pcm_sw_params { ++ int tstamp_mode; /* timestamp mode */ ++ unsigned int period_step; ++ unsigned int sleep_min; /* min ticks to sleep */ ++ sndrv_pcm_uframes_t avail_min; /* min avail frames for wakeup */ ++ sndrv_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ ++ sndrv_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ ++ sndrv_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ ++ sndrv_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ ++ sndrv_pcm_uframes_t silence_size; /* silence block size */ ++ sndrv_pcm_uframes_t boundary; /* pointers wrap point */ ++ unsigned char reserved[64]; /* reserved for future */ ++}; ++ ++struct sndrv_pcm_channel_info { ++ unsigned int channel; ++ long int offset; /* mmap offset */ ++ unsigned int first; /* offset to first sample in bits */ ++ unsigned int step; /* samples distance in bits */ ++}; ++ ++struct sndrv_pcm_status { ++ int state; /* stream state */ ++ struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ ++ struct timespec tstamp; /* reference timestamp */ ++ sndrv_pcm_uframes_t appl_ptr; /* appl ptr */ ++ sndrv_pcm_uframes_t hw_ptr; /* hw ptr */ ++ sndrv_pcm_sframes_t delay; /* current delay in frames */ ++ sndrv_pcm_uframes_t avail; /* number of frames available */ ++ sndrv_pcm_uframes_t avail_max; /* max frames available on hw since last status */ ++ sndrv_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ ++ int suspended_state; /* suspended stream state */ ++ unsigned char reserved[60]; /* must be filled with zero */ ++}; ++ ++struct sndrv_pcm_mmap_status { ++ int state; /* RO: state - SNDRV_PCM_STATE_XXXX */ ++ int pad1; /* Needed for 64 bit alignment */ ++ sndrv_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ ++ struct timespec tstamp; /* Timestamp */ ++ int suspended_state; /* RO: suspended stream state */ ++}; ++ ++struct sndrv_pcm_mmap_control { ++ sndrv_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ ++ sndrv_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ ++}; ++ ++struct sndrv_pcm_sync_ptr { ++ unsigned int flags; ++ union { ++ struct sndrv_pcm_mmap_status status; ++ unsigned char reserved[64]; ++ } s; ++ union { ++ struct sndrv_pcm_mmap_control control; ++ unsigned char reserved[64]; ++ } c; ++}; ++ ++struct sndrv_xferi { ++ sndrv_pcm_sframes_t result; ++ void *buf; ++ sndrv_pcm_uframes_t frames; ++}; ++ ++struct sndrv_xfern { ++ sndrv_pcm_sframes_t result; ++ void **bufs; ++ sndrv_pcm_uframes_t frames; ++}; ++ ++enum sndrv_rawmidi_stream { ++ SNDRV_RAWMIDI_STREAM_OUTPUT = 0, ++ SNDRV_RAWMIDI_STREAM_INPUT, ++ SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, ++}; ++ ++struct sndrv_rawmidi_info { ++ unsigned int device; /* RO/WR (control): device number */ ++ unsigned int subdevice; /* RO/WR (control): subdevice number */ ++ int stream; /* WR: stream */ ++ int card; /* R: card number */ ++ unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ ++ unsigned char id[64]; /* ID (user selectable) */ ++ unsigned char name[80]; /* name of device */ ++ unsigned char subname[32]; /* name of active or selected subdevice */ ++ unsigned int subdevices_count; ++ unsigned int subdevices_avail; ++ unsigned char reserved[64]; /* reserved for future use */ ++}; ++ ++struct sndrv_rawmidi_params { ++ int stream; ++ size_t buffer_size; /* queue size in bytes */ ++ size_t avail_min; /* minimum avail bytes for wakeup */ ++ unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */ ++ unsigned char reserved[16]; /* reserved for future use */ ++}; ++ ++struct sndrv_rawmidi_status { ++ int stream; ++ struct timespec tstamp; /* Timestamp */ ++ size_t avail; /* available bytes */ ++ size_t xruns; /* count of overruns since last status (in bytes) */ ++ unsigned char reserved[16]; /* reserved for future use */ ++}; ++ ++enum sndrv_timer_class { ++ SNDRV_TIMER_CLASS_NONE = -1, ++ SNDRV_TIMER_CLASS_SLAVE = 0, ++ SNDRV_TIMER_CLASS_GLOBAL, ++ SNDRV_TIMER_CLASS_CARD, ++ SNDRV_TIMER_CLASS_PCM, ++ SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM, ++}; ++ ++/* slave timer classes */ ++enum sndrv_timer_slave_class { ++ SNDRV_TIMER_SCLASS_NONE = 0, ++ SNDRV_TIMER_SCLASS_APPLICATION, ++ SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ ++ SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */ ++ SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER, ++}; ++ ++struct sndrv_timer_ginfo { ++ struct sndrv_timer_id tid; /* requested timer ID */ ++ unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ ++ int card; /* card number */ ++ unsigned char id[64]; /* timer identification */ ++ unsigned char name[80]; /* timer name */ ++ unsigned long reserved0; /* reserved for future use */ ++ unsigned long resolution; /* average period resolution in ns */ ++ unsigned long resolution_min; /* minimal period resolution in ns */ ++ unsigned long resolution_max; /* maximal period resolution in ns */ ++ unsigned int clients; /* active timer clients */ ++ unsigned char reserved[32]; ++}; ++ ++struct sndrv_timer_gparams { ++ struct sndrv_timer_id tid; /* requested timer ID */ ++ unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ ++ unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ ++ unsigned char reserved[32]; ++}; ++ ++struct sndrv_timer_gstatus { ++ struct sndrv_timer_id tid; /* requested timer ID */ ++ unsigned long resolution; /* current period resolution in ns */ ++ unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ ++ unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ ++ unsigned char reserved[32]; ++}; ++ ++struct sndrv_timer_select { ++ struct sndrv_timer_id id; /* bind to timer ID */ ++ unsigned char reserved[32]; /* reserved */ ++}; ++ ++struct sndrv_timer_info { ++ unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ ++ int card; /* card number */ ++ unsigned char id[64]; /* timer identificator */ ++ unsigned char name[80]; /* timer name */ ++ unsigned long reserved0; /* reserved for future use */ ++ unsigned long resolution; /* average period resolution in ns */ ++ unsigned char reserved[64]; /* reserved */ ++}; ++ ++struct sndrv_timer_params { ++ unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ ++ unsigned int ticks; /* requested resolution in ticks */ ++ unsigned int queue_size; /* total size of queue (32-1024) */ ++ unsigned int reserved0; /* reserved, was: failure locations */ ++ unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */ ++ unsigned char reserved[60]; /* reserved */ ++}; ++ ++struct sndrv_timer_status { ++ struct timespec tstamp; /* Timestamp - last update */ ++ unsigned int resolution; /* current period resolution in ns */ ++ unsigned int lost; /* counter of master tick lost */ ++ unsigned int overrun; /* count of read queue overruns */ ++ unsigned int queue; /* used queue size */ ++ unsigned char reserved[64]; /* reserved */ ++}; ++ ++struct sndrv_timer_read { ++ unsigned int resolution; ++ unsigned int ticks; ++}; ++ ++enum sndrv_timer_event { ++ SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ ++ SNDRV_TIMER_EVENT_TICK, /* val = ticks */ ++ SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ ++ SNDRV_TIMER_EVENT_STOP, /* val = 0 */ ++ SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */ ++ SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */ ++ SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */ ++ SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */ ++ SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */ ++ /* master timer events for slave timer instances */ ++ SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10, ++ SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10, ++ SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10, ++ SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10, ++ SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10, ++ SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, ++}; ++ ++struct sndrv_timer_tread { ++ int event; ++ struct timespec tstamp; ++ unsigned int val; ++}; ++ ++struct sndrv_ctl_card_info { ++ int card; /* card number */ ++ int pad; /* reserved for future (was type) */ ++ unsigned char id[16]; /* ID of card (user selectable) */ ++ unsigned char driver[16]; /* Driver name */ ++ unsigned char name[32]; /* Short name of soundcard */ ++ unsigned char longname[80]; /* name + info text about soundcard */ ++ unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */ ++ unsigned char mixername[80]; /* visual mixer identification */ ++ unsigned char components[80]; /* card components / fine identification, delimited with one space (AC97 etc..) */ ++ unsigned char reserved[48]; /* reserved for future */ ++}; ++ ++enum sndrv_ctl_elem_type { ++ SNDRV_CTL_ELEM_TYPE_NONE = 0, /* invalid */ ++ SNDRV_CTL_ELEM_TYPE_BOOLEAN, /* boolean type */ ++ SNDRV_CTL_ELEM_TYPE_INTEGER, /* integer type */ ++ SNDRV_CTL_ELEM_TYPE_ENUMERATED, /* enumerated type */ ++ SNDRV_CTL_ELEM_TYPE_BYTES, /* byte array */ ++ SNDRV_CTL_ELEM_TYPE_IEC958, /* IEC958 (S/PDIF) setup */ ++ SNDRV_CTL_ELEM_TYPE_INTEGER64, /* 64-bit integer type */ ++ SNDRV_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_INTEGER64, ++}; ++ ++enum sndrv_ctl_elem_iface { ++ SNDRV_CTL_ELEM_IFACE_CARD = 0, /* global control */ ++ SNDRV_CTL_ELEM_IFACE_HWDEP, /* hardware dependent device */ ++ SNDRV_CTL_ELEM_IFACE_MIXER, /* virtual mixer device */ ++ SNDRV_CTL_ELEM_IFACE_PCM, /* PCM device */ ++ SNDRV_CTL_ELEM_IFACE_RAWMIDI, /* RawMidi device */ ++ SNDRV_CTL_ELEM_IFACE_TIMER, /* timer device */ ++ SNDRV_CTL_ELEM_IFACE_SEQUENCER, /* sequencer client */ ++ SNDRV_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_SEQUENCER, ++}; ++ ++struct sndrv_ctl_elem_id { ++ unsigned int numid; /* numeric identifier, zero = invalid */ ++ int iface; /* interface identifier */ ++ unsigned int device; /* device/client number */ ++ unsigned int subdevice; /* subdevice (substream) number */ ++ unsigned char name[44]; /* ASCII name of item */ ++ unsigned int index; /* index of item */ ++}; ++ ++struct sndrv_ctl_elem_list { ++ unsigned int offset; /* W: first element ID to get */ ++ unsigned int space; /* W: count of element IDs to get */ ++ unsigned int used; /* R: count of element IDs set */ ++ unsigned int count; /* R: count of all elements */ ++ struct sndrv_ctl_elem_id *pids; /* R: IDs */ ++ unsigned char reserved[50]; ++}; ++ ++struct sndrv_ctl_elem_info { ++ struct sndrv_ctl_elem_id id; /* W: element ID */ ++ int type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ ++ unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ ++ unsigned int count; /* count of values */ ++ pid_t owner; /* owner's PID of this control */ ++ union { ++ struct { ++ long min; /* R: minimum value */ ++ long max; /* R: maximum value */ ++ long step; /* R: step (0 variable) */ ++ } integer; ++ struct { ++ long long min; /* R: minimum value */ ++ long long max; /* R: maximum value */ ++ long long step; /* R: step (0 variable) */ ++ } integer64; ++ struct { ++ unsigned int items; /* R: number of items */ ++ unsigned int item; /* W: item number */ ++ char name[64]; /* R: value name */ ++ } enumerated; ++ unsigned char reserved[128]; ++ } value; ++ union { ++ unsigned short d[4]; /* dimensions */ ++ unsigned short *d_ptr; /* indirect */ ++ } dimen; ++ unsigned char reserved[64-4*sizeof(unsigned short)]; ++}; ++ ++struct sndrv_ctl_elem_value { ++ struct sndrv_ctl_elem_id id; /* W: element ID */ ++ unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ ++ union { ++ union { ++ long value[128]; ++ long *value_ptr; ++ } integer; ++ union { ++ long long value[64]; ++ long long *value_ptr; ++ } integer64; ++ union { ++ unsigned int item[128]; ++ unsigned int *item_ptr; ++ } enumerated; ++ union { ++ unsigned char data[512]; ++ unsigned char *data_ptr; ++ } bytes; ++ struct sndrv_aes_iec958 iec958; ++ } value; /* RO */ ++ struct timespec tstamp; ++ unsigned char reserved[128-sizeof(struct timespec)]; ++}; ++ ++struct sndrv_ctl_tlv { ++ unsigned int numid; /* control element numeric identification */ ++ unsigned int length; /* in bytes aligned to 4 */ ++ unsigned int tlv[0]; /* first TLV */ ++}; ++ ++enum sndrv_ctl_event_type { ++ SNDRV_CTL_EVENT_ELEM = 0, ++ SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM, ++}; ++ ++struct sndrv_ctl_event { ++ int type; /* event type - SNDRV_CTL_EVENT_* */ ++ union { ++ struct { ++ unsigned int mask; ++ struct sndrv_ctl_elem_id id; ++ } elem; ++ unsigned char data8[60]; ++ } data; ++}; ++ ++struct sndrv_xferv { ++ const struct iovec *vector; ++ unsigned long count; ++}; ++ ++typedef struct { ++ unsigned int internal_tram_size; /* in samples */ ++ unsigned int external_tram_size; /* in samples */ ++ char fxbus_names[16][32]; /* names of FXBUSes */ ++ char extin_names[16][32]; /* names of external inputs */ ++ char extout_names[32][32]; /* names of external outputs */ ++ unsigned int gpr_controls; /* count of GPR controls */ ++} emu10k1_fx8010_info_t; ++ ++enum emu10k1_ctl_elem_iface { ++ EMU10K1_CTL_ELEM_IFACE_MIXER = 2, /* virtual mixer device */ ++ EMU10K1_CTL_ELEM_IFACE_PCM = 3, /* PCM device */ ++}; ++ ++typedef struct { ++ unsigned int pad; /* don't use */ ++ int iface; /* interface identifier */ ++ unsigned int device; /* device/client number */ ++ unsigned int subdevice; /* subdevice (substream) number */ ++ unsigned char name[44]; /* ASCII name of item */ ++ unsigned int index; /* index of item */ ++} emu10k1_ctl_elem_id_t; ++ ++typedef struct { ++ emu10k1_ctl_elem_id_t id; /* full control ID definition */ ++ unsigned int vcount; /* visible count */ ++ unsigned int count; /* count of GPR (1..16) */ ++ unsigned short gpr[32]; /* GPR number(s) */ ++ unsigned int value[32]; /* initial values */ ++ unsigned int min; /* minimum range */ ++ unsigned int max; /* maximum range */ ++ unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ ++ unsigned int *tlv; ++} emu10k1_fx8010_control_gpr_t; ++ ++typedef struct { ++ char name[128]; ++ ++ unsigned long gpr_valid[0x200/(sizeof(unsigned long)*8)]; /* bitmask of valid initializers */ ++ uint32_t *gpr_map; /* initializers */ ++ ++ unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ ++ emu10k1_fx8010_control_gpr_t *gpr_add_controls; /* GPR controls to add/replace */ ++ ++ unsigned int gpr_del_control_count; /* count of GPR controls to remove */ ++ emu10k1_ctl_elem_id_t *gpr_del_controls; /* IDs of GPR controls to remove */ ++ ++ unsigned int gpr_list_control_count; /* count of GPR controls to list */ ++ unsigned int gpr_list_control_total; /* total count of GPR controls */ ++ emu10k1_fx8010_control_gpr_t *gpr_list_controls; /* listed GPR controls */ ++ ++ unsigned long tram_valid[0x100/(sizeof(unsigned long)*8)]; /* bitmask of valid initializers */ ++ uint32_t *tram_data_map; /* data initializers */ ++ uint32_t *tram_addr_map; /* map initializers */ ++ ++ unsigned long code_valid[1024/(sizeof(unsigned long)*8)]; /* bitmask of valid instructions */ ++ uint32_t *code; /* one instruction - 64 bits */ ++} emu10k1_fx8010_code_t; ++ ++typedef struct { ++ unsigned int address; /* 31.bit == 1 -> external TRAM */ ++ unsigned int size; /* size in samples (4 bytes) */ ++ unsigned int *samples; /* pointer to samples (20-bit) */ ++ /* NULL->clear memory */ ++} emu10k1_fx8010_tram_t; ++ ++typedef struct { ++ unsigned int substream; /* substream number */ ++ unsigned int res1; /* reserved */ ++ unsigned int channels; /* 16-bit channels count, zero = remove this substream */ ++ unsigned int tram_start; /* ring buffer position in TRAM (in samples) */ ++ unsigned int buffer_size; /* count of buffered samples */ ++ unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */ ++ unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */ ++ unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */ ++ unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */ ++ unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ ++ unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ ++ unsigned char pad; /* reserved */ ++ unsigned char etram[32]; /* external TRAM address & data (one per channel) */ ++ unsigned int res2; /* reserved */ ++} emu10k1_fx8010_pcm_t; ++ ++typedef enum { ++ Digiface, ++ Multiface, ++ H9652, ++ H9632, ++ Undefined, ++} HDSP_IO_Type; ++ ++typedef struct _snd_hdsp_peak_rms hdsp_peak_rms_t; ++ ++struct _snd_hdsp_peak_rms { ++ uint32_t input_peaks[26]; ++ uint32_t playback_peaks[26]; ++ uint32_t output_peaks[28]; ++ uint64_t input_rms[26]; ++ uint64_t playback_rms[26]; ++ /* These are only used for H96xx cards */ ++ uint64_t output_rms[26]; ++}; ++ ++typedef struct _snd_hdsp_config_info hdsp_config_info_t; ++ ++struct _snd_hdsp_config_info { ++ unsigned char pref_sync_ref; ++ unsigned char wordclock_sync_check; ++ unsigned char spdif_sync_check; ++ unsigned char adatsync_sync_check; ++ unsigned char adat_sync_check[3]; ++ unsigned char spdif_in; ++ unsigned char spdif_out; ++ unsigned char spdif_professional; ++ unsigned char spdif_emphasis; ++ unsigned char spdif_nonaudio; ++ unsigned int spdif_sample_rate; ++ unsigned int system_sample_rate; ++ unsigned int autosync_sample_rate; ++ unsigned char system_clock_mode; ++ unsigned char clock_source; ++ unsigned char autosync_ref; ++ unsigned char line_out; ++ unsigned char passthru; ++ unsigned char da_gain; ++ unsigned char ad_gain; ++ unsigned char phone_gain; ++ unsigned char xlr_breakout_cable; ++ unsigned char analog_extension_board; ++}; ++ ++typedef struct _snd_hdsp_firmware hdsp_firmware_t; ++ ++struct _snd_hdsp_firmware { ++ void *firmware_data; /* 24413 x 4 bytes */ ++}; ++ ++typedef struct _snd_hdsp_version hdsp_version_t; ++ ++struct _snd_hdsp_version { ++ HDSP_IO_Type io_type; ++ unsigned short firmware_rev; ++}; ++ ++typedef struct _snd_hdsp_mixer hdsp_mixer_t; ++ ++struct _snd_hdsp_mixer { ++ unsigned short matrix[HDSP_MATRIX_MIXER_SIZE]; ++}; ++ ++typedef struct _snd_hdsp_9632_aeb hdsp_9632_aeb_t; ++ ++struct _snd_hdsp_9632_aeb { ++ int aebi; ++ int aebo; ++}; ++ ++typedef struct snd_sb_csp_mc_header { ++ char codec_name[16]; /* id name of codec */ ++ unsigned short func_req; /* requested function */ ++} snd_sb_csp_mc_header_t; ++ ++typedef struct snd_sb_csp_microcode { ++ snd_sb_csp_mc_header_t info; ++ unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE]; ++} snd_sb_csp_microcode_t; ++ ++typedef struct snd_sb_csp_start { ++ int sample_width; /* sample width, look above */ ++ int channels; /* channels, look above */ ++} snd_sb_csp_start_t; ++ ++typedef struct snd_sb_csp_info { ++ char codec_name[16]; /* id name of codec */ ++ unsigned short func_nr; /* function number */ ++ unsigned int acc_format; /* accepted PCM formats */ ++ unsigned short acc_channels; /* accepted channels */ ++ unsigned short acc_width; /* accepted sample width */ ++ unsigned short acc_rates; /* accepted sample rates */ ++ unsigned short csp_mode; /* CSP mode, see above */ ++ unsigned short run_channels; /* current channels */ ++ unsigned short run_width; /* current sample width */ ++ unsigned short version; /* version id: 0x10 - 0x1f */ ++ unsigned short state; /* state bits */ ++} snd_sb_csp_info_t; ++ ++struct sscape_bootblock ++{ ++ unsigned char code[256]; ++ unsigned version; ++}; ++ ++struct sscape_microcode ++{ ++ unsigned char *code; ++}; +diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h +index a98cbf7..8644f87 100644 +--- a/linux-user/syscall_defs.h ++++ b/linux-user/syscall_defs.h +@@ -2425,3 +2425,5 @@ struct target_ucred { + uint32_t uid; + uint32_t gid; + }; ++ ++#include "ioctls_alsa_structs.h" +diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h +index 44b6a58..7897e37 100644 +--- a/linux-user/syscall_types.h ++++ b/linux-user/syscall_types.h +@@ -83,6 +83,11 @@ STRUCT(buffmem_desc, + STRUCT(mixer_info, + MK_ARRAY(TYPE_CHAR, 16), MK_ARRAY(TYPE_CHAR, 32), TYPE_INT, MK_ARRAY(TYPE_INT, 10)) + ++/* FIXME: including these on x86 / x86_64 breaks qemu-i386 */ ++#ifdef __powerpc__ ++#include "syscall_types_alsa.h" ++#endif ++ + /* loop device ioctls */ + STRUCT(loop_info, + TYPE_INT, /* lo_number */ +diff --git a/linux-user/syscall_types_alsa.h b/linux-user/syscall_types_alsa.h +new file mode 100644 +index 0000000..72622ae +--- /dev/null ++++ b/linux-user/syscall_types_alsa.h +@@ -0,0 +1,1336 @@ ++/* ++ * Advanced Linux Sound Architecture ++ * ++ * This program is free software, you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY, without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * aTYPE_LONG, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ */ ++ ++STRUCT (sndrv_pcm_sframes, TYPE_LONG) ++STRUCT (sndrv_seq_event_type, TYPE_CHAR) ++STRUCT (sndrv_seq_instr_cluster, TYPE_INT) ++STRUCT (sndrv_seq_position, TYPE_INT) ++STRUCT (sndrv_seq_frequency, TYPE_INT) ++STRUCT (sndrv_seq_tick_time, TYPE_INT) ++STRUCT (sndrv_seq_instr_size, TYPE_INT) ++STRUCT (sndrv_pcm_uframes, TYPE_ULONG) ++ ++ ++STRUCT (timespec, ++ TYPE_LONG, ++ TYPE_LONG ++ ) ++ ++STRUCT( fm_operator, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT(fm_instrument, ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ TYPE_CHAR, /* instrument type */ ++ ++ MK_ARRAY(MK_STRUCT(STRUCT_fm_operator), 4), ++ MK_ARRAY(TYPE_CHAR, 2), ++ ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( fm_xoperator, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( fm_xinstrument, ++ TYPE_INT, /* structure type */ ++ ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ TYPE_CHAR, /* instrument type */ ++ ++ MK_ARRAY(MK_STRUCT(STRUCT_fm_xoperator), 4), /* fm operators */ ++ MK_ARRAY(TYPE_CHAR, 2), ++ ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( gf1_wave, ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ TYPE_INT, /* wave format */ ++ ++ TYPE_INT, /* some other ID for this instrument */ ++ TYPE_INT, /* begin of waveform in onboard memory */ ++ TYPE_PTRVOID, /* poTYPE_INTer to waveform in system memory */ ++ ++ TYPE_INT, /* size of waveform in samples */ ++ TYPE_INT, /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_SHORT, /* loop repeat - 0 = forever */ ++ ++ TYPE_CHAR, /* GF1 patch flags */ ++ TYPE_CHAR, ++ TYPE_INT, /* sample rate in Hz */ ++ TYPE_INT, /* low frequency range */ ++ TYPE_INT, /* high frequency range */ ++ TYPE_INT, /* root frequency range */ ++ TYPE_SHORT, ++ TYPE_CHAR, ++ MK_ARRAY(TYPE_CHAR, 6), ++ MK_ARRAY(TYPE_CHAR, 6), ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_SHORT, ++ TYPE_SHORT, /* 0-2048 or 0-2 */ ++ ++ TYPE_PTRVOID ++) ++ ++STRUCT(gf1_instrument, ++ TYPE_SHORT, ++ TYPE_SHORT, /* 0 - none, 1-65535 */ ++ ++ TYPE_CHAR, /* effect 1 */ ++ TYPE_CHAR, /* 0-127 */ ++ TYPE_CHAR, /* effect 2 */ ++ TYPE_CHAR, /* 0-127 */ ++ ++ TYPE_PTRVOID /* first waveform */ ++) ++ ++STRUCT( gf1_xwave, ++ TYPE_INT, /* structure type */ ++ ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ TYPE_INT, /* wave format */ ++ ++ TYPE_INT, /* size of waveform in samples */ ++ TYPE_INT, /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_SHORT, /* loop repeat - 0 = forever */ ++ ++ TYPE_CHAR, /* GF1 patch flags */ ++ TYPE_CHAR, ++ TYPE_INT, /* sample rate in Hz */ ++ TYPE_INT, /* low frequency range */ ++ TYPE_INT, /* high frequency range */ ++ TYPE_INT, /* root frequency range */ ++ TYPE_SHORT, ++ TYPE_CHAR, ++ MK_ARRAY(TYPE_CHAR, 6), ++ MK_ARRAY(TYPE_CHAR, 6), ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_SHORT, ++ TYPE_SHORT /* 0-2048 or 0-2 */ ++) ++ ++STRUCT( gf1_xinstrument, ++ TYPE_INT, ++ ++ TYPE_SHORT, ++ TYPE_SHORT, /* 0 - none, 1-65535 */ ++ ++ TYPE_CHAR, /* effect 1 */ ++ TYPE_CHAR, /* 0-127 */ ++ TYPE_CHAR, /* effect 2 */ ++ TYPE_CHAR /* 0-127 */ ++) ++ ++STRUCT( gf1_info, ++ TYPE_CHAR, /* supported wave flags */ ++ MK_ARRAY(TYPE_CHAR, 3), ++ TYPE_INT, /* supported features */ ++ TYPE_INT, /* maximum 8-bit wave length */ ++ TYPE_INT /* maximum 16-bit wave length */ ++) ++ ++STRUCT( iwffff_wave, ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ TYPE_INT, /* wave format */ ++ ++ TYPE_INT, /* some other ID for this wave */ ++ TYPE_INT, /* begin of waveform in onboard memory */ ++ TYPE_PTRVOID, /* poTYPE_INTer to waveform in system memory */ ++ ++ TYPE_INT, /* size of waveform in samples */ ++ TYPE_INT, /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_SHORT, /* loop repeat - 0 = forever */ ++ TYPE_INT, /* sample ratio (44100 * 1024 / rate) */ ++ TYPE_CHAR, /* 0 - 127 (no corresponding midi controller) */ ++ TYPE_CHAR, /* lower frequency range for this waveform */ ++ TYPE_CHAR, /* higher frequency range for this waveform */ ++ TYPE_CHAR, ++ ++ TYPE_PTRVOID ++) ++ ++STRUCT( iwffff_lfo, ++ TYPE_SHORT, /* (0-2047) 0.01Hz - 21.5Hz */ ++ TYPE_SHORT, /* volume +- (0-255) 0.48675dB/step */ ++ TYPE_SHORT, /* 0 - 950 deciseconds */ ++ TYPE_CHAR, /* see to IWFFFF_LFO_SHAPE_XXXX */ ++ TYPE_CHAR /* 0 - 255 deciseconds */ ++) ++ ++STRUCT( iwffff_env_point, ++ TYPE_SHORT, ++ TYPE_SHORT ++) ++ ++STRUCT( iwffff_env_record, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_PTRVOID ++) ++ ++STRUCT( iwffff_env, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_PTRVOID // MK_STRUCT(STRUCT_iwffff_env_record) ++) ++ ++STRUCT( iwffff_layer, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, /* range for layer based */ ++ TYPE_CHAR, /* on either velocity or frequency */ ++ TYPE_CHAR, /* pan offset from CC1 (0 left - 127 right) */ ++ TYPE_CHAR, /* position based on frequency (0-127) */ ++ TYPE_CHAR, /* 0-127 (no corresponding midi controller) */ ++ MK_STRUCT(STRUCT_iwffff_lfo), /* tremolo effect */ ++ MK_STRUCT(STRUCT_iwffff_lfo), /* vibrato effect */ ++ TYPE_SHORT, /* 0-2048, 1024 is equal to semitone scaling */ ++ TYPE_CHAR, /* center for keyboard frequency scaling */ ++ TYPE_CHAR, ++ MK_STRUCT(STRUCT_iwffff_env), /* pitch envelope */ ++ MK_STRUCT(STRUCT_iwffff_env), /* volume envelope */ ++ ++ TYPE_PTRVOID, // iwffff_wave_t *wave, ++ TYPE_PTRVOID // MK_STRUCT(STRUCT_iwffff_layer) ++) ++ ++STRUCT(iwffff_instrument, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, /* 0 - none, 1-65535 */ ++ ++ TYPE_CHAR, /* effect 1 */ ++ TYPE_CHAR, /* 0-127 */ ++ TYPE_CHAR, /* effect 2 */ ++ TYPE_CHAR, /* 0-127 */ ++ ++ TYPE_PTRVOID // iwffff_layer_t *layer, /* first layer */ ++) ++ ++STRUCT( iwffff_xwave, ++ TYPE_INT, /* structure type */ ++ ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ ++ TYPE_INT, /* wave format */ ++ TYPE_INT, /* offset to ROM (address) */ ++ ++ TYPE_INT, /* size of waveform in samples */ ++ TYPE_INT, /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_SHORT, /* loop repeat - 0 = forever */ ++ TYPE_INT, /* sample ratio (44100 * 1024 / rate) */ ++ TYPE_CHAR, /* 0 - 127 (no corresponding midi controller) */ ++ TYPE_CHAR, /* lower frequency range for this waveform */ ++ TYPE_CHAR, /* higher frequency range for this waveform */ ++ TYPE_CHAR ++) ++ ++STRUCT( iwffff_xlfo, ++ TYPE_SHORT, /* (0-2047) 0.01Hz - 21.5Hz */ ++ TYPE_SHORT, /* volume +- (0-255) 0.48675dB/step */ ++ TYPE_SHORT, /* 0 - 950 deciseconds */ ++ TYPE_CHAR, /* see to ULTRA_IW_LFO_SHAPE_XXXX */ ++ TYPE_CHAR /* 0 - 255 deciseconds */ ++) ++ ++STRUCT( iwffff_xenv_point, ++ TYPE_SHORT, ++ TYPE_SHORT ++) ++ ++STRUCT( iwffff_xenv_record, ++ TYPE_INT, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( iwffff_xenv, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( iwffff_xlayer, ++ TYPE_INT, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, /* range for layer based */ ++ TYPE_CHAR, /* on either velocity or frequency */ ++ TYPE_CHAR, /* pan offset from CC1 (0 left - 127 right) */ ++ TYPE_CHAR, /* position based on frequency (0-127) */ ++ TYPE_CHAR, /* 0-127 (no corresponding midi controller) */ ++ MK_STRUCT(STRUCT_iwffff_xlfo), /* tremolo effect */ ++ MK_STRUCT(STRUCT_iwffff_xlfo), /* vibrato effect */ ++ TYPE_SHORT, /* 0-2048, 1024 is equal to semitone scaling */ ++ TYPE_CHAR, /* center for keyboard frequency scaling */ ++ TYPE_CHAR, ++ MK_STRUCT(STRUCT_iwffff_xenv), /* pitch envelope */ ++ MK_STRUCT(STRUCT_iwffff_xenv) /* volume envelope */ ++) ++ ++STRUCT( iwffff_xinstrument, ++ TYPE_INT, ++ ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_SHORT, /* 0 - none, 1-65535 */ ++ ++ TYPE_CHAR, /* effect 1 */ ++ TYPE_CHAR, /* 0-127 */ ++ TYPE_CHAR, /* effect 2 */ ++ TYPE_CHAR /* 0-127 */ ++) ++ ++STRUCT(iwffff_rom_header, ++ MK_ARRAY(TYPE_CHAR, 8), ++ TYPE_CHAR, ++ TYPE_CHAR, ++ MK_ARRAY(TYPE_CHAR, 16), ++ MK_ARRAY(TYPE_CHAR, 10), ++ TYPE_SHORT, ++ TYPE_SHORT, ++ TYPE_INT, ++ MK_ARRAY(TYPE_CHAR, 128), ++ MK_ARRAY(TYPE_CHAR, 64), ++ MK_ARRAY(TYPE_CHAR, 128) ++) ++ ++STRUCT( iwffff_info, ++ TYPE_INT, /* supported format bits */ ++ TYPE_INT, /* supported effects (1 << IWFFFF_EFFECT*) */ ++ TYPE_INT, /* LFO effects */ ++ TYPE_INT, /* maximum 8-bit wave length */ ++ TYPE_INT /* maximum 16-bit wave length */ ++) ++ ++STRUCT( simple_instrument_info, ++ TYPE_INT, /* supported format bits */ ++ TYPE_INT, /* supported effects (1 << SIMPLE_EFFECT_*) */ ++ TYPE_INT, /* maximum 8-bit wave length */ ++ TYPE_INT /* maximum 16-bit wave length */ ++) ++ ++STRUCT(simple_instrument, ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ TYPE_INT, /* wave format */ ++ ++ TYPE_INT, /* some other ID for this instrument */ ++ TYPE_INT, /* begin of waveform in onboard memory */ ++ TYPE_PTRVOID, /* poTYPE_INTer to waveform in system memory */ ++ ++ TYPE_INT, /* size of waveform in samples */ ++ TYPE_INT, /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* loop end offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_SHORT, /* loop repeat - 0 = forever */ ++ ++ TYPE_CHAR, /* effect 1 */ ++ TYPE_CHAR, /* 0-127 */ ++ TYPE_CHAR, /* effect 2 */ ++ TYPE_CHAR /* 0-127 */ ++) ++ ++STRUCT( simple_xinstrument, ++ TYPE_INT, ++ ++ MK_ARRAY(TYPE_INT, 4), /* share id - zero = no sharing */ ++ TYPE_INT, /* wave format */ ++ ++ TYPE_INT, /* size of waveform in samples */ ++ TYPE_INT, /* start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_INT, /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ ++ TYPE_SHORT, /* loop repeat - 0 = forever */ ++ ++ TYPE_CHAR, /* effect 1 */ ++ TYPE_CHAR, /* 0-127 */ ++ TYPE_CHAR, /* effect 2 */ ++ TYPE_CHAR /* 0-127 */ ++) ++ ++/** event address */ ++STRUCT( sndrv_seq_addr, ++ TYPE_CHAR, /**< Client number: 0..255, 255 = broadcast to all clients */ ++ TYPE_CHAR /**< Port within client: 0..255, 255 = broadcast to all ports */ ++) ++ ++/** port connection */ ++STRUCT( sndrv_seq_connect, ++ MK_STRUCT(STRUCT_sndrv_seq_addr), ++ MK_STRUCT(STRUCT_sndrv_seq_addr) ++) ++ ++STRUCT( sndrv_seq_ev_note, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, /* only for SNDRV_SEQ_EVENT_NOTE */ ++ TYPE_INT /* only for SNDRV_SEQ_EVENT_NOTE */ ++) ++ ++ /* controller event */ ++STRUCT( sndrv_seq_ev_ctrl, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, /* pad */ ++ TYPE_INT, ++ TYPE_INT ++) ++ ++ /* generic set of bytes (12x8 bit) */ ++STRUCT( sndrv_seq_ev_raw8, ++ MK_ARRAY(TYPE_CHAR, 12) /* 8 bit value */ ++) ++ ++ /* generic set of TYPE_INTegers (3x32 bit) */ ++STRUCT( sndrv_seq_ev_raw32, ++ MK_ARRAY(TYPE_INT, 3) /* 32 bit value */ ++) ++ ++ /* external stored data */ ++STRUCT( sndrv_seq_ev_ext, ++ TYPE_INT, /* length of data */ ++ TYPE_PTRVOID /* poTYPE_INTer to data (note: maybe 64-bit) */ ++) ++ ++/* Instrument type */ ++STRUCT( sndrv_seq_instr, ++ TYPE_INT, ++ TYPE_INT, /* the upper byte means a private instrument (owner - client #) */ ++ TYPE_SHORT, ++ TYPE_SHORT ++) ++ ++ /* sample number */ ++STRUCT( sndrv_seq_ev_sample, ++ TYPE_INT, ++ TYPE_SHORT, ++ TYPE_SHORT ++) ++ ++ /* sample cluster */ ++STRUCT( sndrv_seq_ev_cluster, ++ TYPE_INT ++) ++ ++ /* sample volume control, if any value is set to -1 == do not change */ ++STRUCT( sndrv_seq_ev_volume, ++ TYPE_SHORT, /* range: 0-16383 */ ++ TYPE_SHORT, /* left-right balance, range: 0-16383 */ ++ TYPE_SHORT, /* front-rear balance, range: 0-16383 */ ++ TYPE_SHORT /* down-up balance, range: 0-16383 */ ++) ++ ++ /* simple loop redefinition */ ++STRUCT( sndrv_seq_ev_loop, ++ TYPE_INT, /* loop start (in samples) * 16 */ ++ TYPE_INT /* loop end (in samples) * 16 */ ++) ++ ++STRUCT( sndrv_seq_ev_sample_control, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, /* pad */ ++ MK_ARRAY(TYPE_INT, 2) ++) ++ ++ ++ ++/* INSTR_BEGIN event */ ++STRUCT( sndrv_seq_ev_instr_begin, ++ TYPE_INT ++) ++ ++STRUCT( sndrv_seq_result, ++ TYPE_INT, ++ TYPE_INT ++) ++ ++ ++STRUCT( sndrv_seq_real_time, ++ TYPE_INT, ++ TYPE_INT ++) ++ ++STRUCT( sndrv_seq_queue_skew, ++ TYPE_INT, ++ TYPE_INT ++) ++ ++ /* queue timer control */ ++STRUCT( sndrv_seq_ev_queue_control, ++ TYPE_CHAR, /* affected queue */ ++ MK_ARRAY(TYPE_CHAR, 3), /* reserved */ ++ MK_ARRAY(TYPE_INT, 2) ++) ++ ++ /* quoted event - inside the kernel only */ ++STRUCT( sndrv_seq_ev_quote, ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* original sender */ ++ TYPE_SHORT, /* optional data */ ++ MK_STRUCT(STRUCT_sndrv_seq_event) /* quoted event */ ++) ++ ++ ++ /* sequencer event */ ++STRUCT( sndrv_seq_event, ++ TYPE_CHAR, /* event type */ ++ TYPE_CHAR, /* event flags */ ++ TYPE_CHAR, ++ ++ TYPE_CHAR, /* schedule queue */ ++ MK_STRUCT(STRUCT_sndrv_seq_real_time), /* schedule time */ ++ ++ ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* source address */ ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* destination address */ ++ ++ MK_ARRAY(TYPE_INT,3) ++) ++ ++ ++/* ++ * bounce event - stored as variable size data ++ */ ++STRUCT( sndrv_seq_event_bounce, ++ TYPE_INT, ++ MK_STRUCT(STRUCT_sndrv_seq_event) ++ /* external data follows here. */ ++) ++ ++STRUCT( sndrv_seq_system_info, ++ TYPE_INT, /* maximum queues count */ ++ TYPE_INT, /* maximum clients count */ ++ TYPE_INT, /* maximum ports per client */ ++ TYPE_INT, /* maximum channels per port */ ++ TYPE_INT, /* current clients */ ++ TYPE_INT, /* current queues */ ++ MK_ARRAY(TYPE_CHAR, 24) ++) ++ ++STRUCT( sndrv_seq_running_info, ++ TYPE_CHAR, /* client id */ ++ TYPE_CHAR, /* 1 = big-endian */ ++ TYPE_CHAR, ++ TYPE_CHAR, /* reserved */ ++ MK_ARRAY(TYPE_CHAR, 12) ++) ++ ++STRUCT( sndrv_seq_client_info, ++ TYPE_INT, /* client number to inquire */ ++ TYPE_INT, /* client type */ ++ MK_ARRAY(TYPE_CHAR, 64), /* client name */ ++ TYPE_INT, /* filter flags */ ++ MK_ARRAY(TYPE_CHAR, 8), /* multicast filter bitmap */ ++ MK_ARRAY(TYPE_CHAR, 32), /* event filter bitmap */ ++ TYPE_INT, /* RO: number of ports */ ++ TYPE_INT, /* number of lost events */ ++ MK_ARRAY(TYPE_CHAR, 64) /* for future use */ ++) ++ ++STRUCT( sndrv_seq_client_pool, ++ TYPE_INT, /* client number to inquire */ ++ TYPE_INT, /* outgoing (write) pool size */ ++ TYPE_INT, /* incoming (read) pool size */ ++ TYPE_INT, /* minimum free pool size for select/blocking mode */ ++ TYPE_INT, /* unused size */ ++ TYPE_INT, /* unused size */ ++ MK_ARRAY(TYPE_CHAR, 64) ++) ++ ++STRUCT( sndrv_seq_remove_events, ++ TYPE_INT, /* Flags that determine what gets removed */ ++ ++ MK_STRUCT(STRUCT_sndrv_seq_real_time), ++ ++ TYPE_CHAR, /* Queue for REMOVE_DEST */ ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* Address for REMOVE_DEST */ ++ TYPE_CHAR, /* Channel for REMOVE_DEST */ ++ ++ TYPE_INT, /* For REMOVE_EVENT_TYPE */ ++ TYPE_CHAR, /* Tag for REMOVE_TAG */ ++ ++ MK_ARRAY(TYPE_INT, 10) /* To allow for future binary compatibility */ ++ ++) ++ ++STRUCT( sndrv_seq_port_info, ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* client/port numbers */ ++ MK_ARRAY(TYPE_CHAR, 64), /* port name */ ++ ++ TYPE_INT, /* port capability bits */ ++ TYPE_INT, /* port type bits */ ++ TYPE_INT, /* channels per MIDI port */ ++ TYPE_INT, /* voices per MIDI port */ ++ TYPE_INT, /* voices per SYNTH port */ ++ ++ TYPE_INT, /* R/O: subscribers for output (from this port) */ ++ TYPE_INT, /* R/O: subscribers for input (to this port) */ ++ ++ TYPE_PTRVOID, /* reserved for kernel use (must be NULL) */ ++ TYPE_INT, /* misc. conditioning */ ++ TYPE_CHAR, /* queue # for timestamping */ ++ MK_ARRAY(TYPE_CHAR, 59) /* for future use */ ++) ++ ++STRUCT( sndrv_seq_queue_info, ++ TYPE_INT, /* queue id */ ++ ++ /* ++ * security settings, only owner of this queue can start/stop timer ++ * etc. if the queue is locked for other clients ++ */ ++ TYPE_INT, /* client id for owner of the queue */ ++ TYPE_INT, /* timing queue locked for other queues */ ++ MK_ARRAY(TYPE_CHAR, 64), /* name of this queue */ ++ TYPE_INT, /* flags */ ++ MK_ARRAY(TYPE_CHAR, 60) /* for future use */ ++ ++) ++ ++STRUCT( sndrv_seq_queue_status, ++ TYPE_INT, /* queue id */ ++ TYPE_INT, /* read-only - queue size */ ++ TYPE_INT, /* current tick */ ++ MK_STRUCT(STRUCT_sndrv_seq_real_time), /* current time */ ++ TYPE_INT, /* running state of queue */ ++ TYPE_INT, /* various flags */ ++ MK_ARRAY(TYPE_CHAR, 64) /* for the future */ ++) ++ ++STRUCT( sndrv_seq_queue_tempo, ++ TYPE_INT, /* sequencer queue */ ++ TYPE_INT, ++ TYPE_INT, ++ TYPE_INT, /* queue skew */ ++ TYPE_INT, /* queue skew base */ ++ MK_ARRAY(TYPE_CHAR, 24) /* for the future */ ++) ++ ++STRUCT( sndrv_timer_id, ++ TYPE_INT, ++ TYPE_INT, ++ TYPE_INT, ++ TYPE_INT, ++ TYPE_INT ++) ++ ++STRUCT( sndrv_seq_queue_timer, ++ TYPE_INT, /* sequencer queue */ ++ TYPE_INT, /* source timer type */ ++ MK_STRUCT(STRUCT_sndrv_timer_id), /* ALSA's timer ID */ ++ TYPE_INT, /* resolution in Hz */ ++ MK_ARRAY(TYPE_CHAR, 64) /* for the future use */ ++) ++ ++STRUCT( sndrv_seq_queue_client, ++ TYPE_INT, /* sequencer queue */ ++ TYPE_INT, /* sequencer client */ ++ TYPE_INT, /* queue is used with this client ++ (must be set for accepting events) */ ++ /* per client watermarks */ ++ MK_ARRAY(TYPE_CHAR, 64) /* for future use */ ++) ++ ++STRUCT( sndrv_seq_port_subscribe, ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* sender address */ ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* destination address */ ++ TYPE_INT, /* number of voices to be allocated (0 = don't care) */ ++ TYPE_INT, /* modes */ ++ TYPE_CHAR, /* input time-stamp queue (optional) */ ++ MK_ARRAY(TYPE_CHAR, 3), /* reserved */ ++ MK_ARRAY(TYPE_CHAR, 64) ++) ++ ++STRUCT( sndrv_seq_query_subs, ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* client/port id to be searched */ ++ TYPE_INT, /* READ or WRITE */ ++ TYPE_INT, /* 0..N-1 */ ++ TYPE_INT, /* R/O: number of subscriptions on this port */ ++ MK_STRUCT(STRUCT_sndrv_seq_addr), /* R/O: result */ ++ TYPE_CHAR, /* R/O: result */ ++ TYPE_INT, /* R/O: result */ ++ MK_ARRAY(TYPE_CHAR, 64) /* for future use */ ++) ++ ++STRUCT( sndrv_seq_instr_info, ++ TYPE_INT, /* operation result */ ++ MK_ARRAY(TYPE_INT, 8), /* bitmap of supported formats */ ++ TYPE_INT, /* count of RAM banks */ ++ MK_ARRAY(TYPE_INT, 16), /* size of RAM banks */ ++ TYPE_INT, /* count of ROM banks */ ++ MK_ARRAY(TYPE_INT, 8), /* size of ROM banks */ ++ MK_ARRAY(TYPE_CHAR, 128) ++) ++ ++STRUCT( sndrv_seq_instr_status, ++ TYPE_INT, /* operation result */ ++ MK_ARRAY(TYPE_INT, 16), /* free RAM in banks */ ++ TYPE_INT, /* count of downloaded instruments */ ++ MK_ARRAY(TYPE_CHAR, 128) ++) ++ ++STRUCT( sndrv_seq_instr_format_info, ++ MK_ARRAY(TYPE_CHAR, 16), /* format identifier - SNDRV_SEQ_INSTR_ID_* */ ++ TYPE_INT /* max data length (without this structure) */ ++) ++ ++STRUCT( sndrv_seq_instr_format_info_result, ++ TYPE_INT, /* operation result */ ++ MK_ARRAY(TYPE_CHAR, 16), /* format identifier */ ++ TYPE_INT /* filled data length (without this structure) */ ++) ++ ++STRUCT( sndrv_seq_instr_data, ++ MK_ARRAY(TYPE_CHAR, 32), /* instrument name */ ++ MK_ARRAY(TYPE_CHAR, 16), /* for the future use */ ++ TYPE_INT, /* instrument type */ ++ MK_STRUCT(STRUCT_sndrv_seq_instr), ++ MK_ARRAY(TYPE_CHAR, 4) /* fillup */ ++) ++ ++STRUCT( sndrv_seq_instr_header, ++ MK_STRUCT(STRUCT_sndrv_seq_instr), ++ TYPE_INT, /* get/put/free command */ ++ TYPE_INT, /* query flags (only for get) */ ++ TYPE_INT, /* real instrument data length (without header) */ ++ TYPE_INT, /* operation result */ ++ MK_ARRAY(TYPE_CHAR, 16), /* for the future */ ++ MK_STRUCT(STRUCT_sndrv_seq_instr_data) /* instrument data (for put/get result) */ ++) ++ ++STRUCT( sndrv_seq_instr_cluster_set, ++ TYPE_INT, /* cluster identifier */ ++ MK_ARRAY(TYPE_CHAR, 32), /* cluster name */ ++ TYPE_INT, /* cluster priority */ ++ MK_ARRAY(TYPE_CHAR, 64) /* for the future use */ ++) ++ ++STRUCT( sndrv_seq_instr_cluster_get, ++ TYPE_INT, /* cluster identifier */ ++ MK_ARRAY(TYPE_CHAR, 32), /* cluster name */ ++ TYPE_INT, /* cluster priority */ ++ MK_ARRAY(TYPE_CHAR, 64) /* for the future use */ ++) ++ ++STRUCT( snd_dm_fm_info, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( snd_dm_fm_voice, ++ TYPE_CHAR, /* operator cell (0 or 1) */ ++ TYPE_CHAR, /* FM voice (0 to 17) */ ++ ++ TYPE_CHAR, /* amplitude modulation */ ++ TYPE_CHAR, /* vibrato effect */ ++ TYPE_CHAR, /* sustain phase */ ++ TYPE_CHAR, /* keyboard scaling */ ++ TYPE_CHAR, /* 4 bits: harmonic and multiplier */ ++ TYPE_CHAR, /* 2 bits: decrease output freq rises */ ++ TYPE_CHAR, /* 6 bits: volume */ ++ ++ TYPE_CHAR, /* 4 bits: attack rate */ ++ TYPE_CHAR, /* 4 bits: decay rate */ ++ TYPE_CHAR, /* 4 bits: sustain level */ ++ TYPE_CHAR, /* 4 bits: release rate */ ++ ++ TYPE_CHAR, /* 3 bits: feedback for op0 */ ++ TYPE_CHAR, ++ TYPE_CHAR, /* stereo left */ ++ TYPE_CHAR, /* stereo right */ ++ TYPE_CHAR /* 3 bits: waveform shape */ ++) ++ ++STRUCT( snd_dm_fm_note, ++ TYPE_CHAR, /* 0-17 voice channel */ ++ TYPE_CHAR, /* 3 bits: what octave to play */ ++ TYPE_INT, /* 10 bits: frequency number */ ++ TYPE_CHAR ++) ++ ++STRUCT( snd_dm_fm_params, ++ TYPE_CHAR, /* amplitude modulation depth (1=hi) */ ++ TYPE_CHAR, /* vibrato depth (1=hi) */ ++ TYPE_CHAR, /* keyboard split */ ++ TYPE_CHAR, /* percussion mode select */ ++ ++ /* This block is the percussion instrument data */ ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( sndrv_aes_iec958, ++ MK_ARRAY(TYPE_CHAR, 24), /* AES/IEC958 channel status bits */ ++ MK_ARRAY(TYPE_CHAR, 147), /* AES/IEC958 subcode bits */ ++ TYPE_CHAR, /* nothing */ ++ MK_ARRAY(TYPE_CHAR, 4) /* AES/IEC958 subframe bits */ ++) ++ ++STRUCT( sndrv_hwdep_info, ++ TYPE_INT, /* WR: device number */ ++ TYPE_INT, /* R: card number */ ++ MK_ARRAY(TYPE_CHAR, 64), /* ID (user selectable) */ ++ MK_ARRAY(TYPE_CHAR, 80), /* hwdep name */ ++ TYPE_INT, /* hwdep interface */ ++ MK_ARRAY(TYPE_CHAR, 64) /* reserved for future */ ++) ++ ++/* generic DSP loader */ ++STRUCT( sndrv_hwdep_dsp_status, ++ TYPE_INT, /* R: driver-specific version */ ++ MK_ARRAY(TYPE_CHAR, 32), /* R: driver-specific ID string */ ++ TYPE_INT, /* R: number of DSP images to transfer */ ++ TYPE_INT, /* R: bit flags indicating the loaded DSPs */ ++ TYPE_INT, /* R: 1 = initialization finished */ ++ MK_ARRAY(TYPE_CHAR, 16) /* reserved for future use */ ++) ++ ++STRUCT( sndrv_hwdep_dsp_image, ++ TYPE_INT, /* W: DSP index */ ++ MK_ARRAY(TYPE_CHAR, 64), /* W: ID (e.g. file name) */ ++ TYPE_CHAR, /* W: binary image */ ++ TYPE_LONG, /* W: size of image in bytes */ ++ TYPE_LONG /* W: driver-specific data */ ++) ++ ++STRUCT( sndrv_pcm_info, ++ TYPE_INT, /* RO/WR (control): device number */ ++ TYPE_INT, /* RO/WR (control): subdevice number */ ++ TYPE_INT, /* RO/WR (control): stream number */ ++ TYPE_INT, /* R: card number */ ++ MK_ARRAY(TYPE_CHAR, 64), /* ID (user selectable) */ ++ MK_ARRAY(TYPE_CHAR, 80), /* name of this device */ ++ MK_ARRAY(TYPE_CHAR, 32), /* subdevice name */ ++ TYPE_INT, /* SNDRV_PCM_CLASS_* */ ++ TYPE_INT, /* SNDRV_PCM_SUBCLASS_* */ ++ TYPE_INT, ++ TYPE_INT, ++ MK_ARRAY(TYPE_INT, 4), ++ ++ MK_ARRAY(TYPE_CHAR, 64) /* reserved for future... */ ++) ++ ++STRUCT( sndrv_interval, ++ TYPE_INT, ++ TYPE_INT, ++ TYPE_INTBITFIELD ++) ++ ++STRUCT( sndrv_mask, ++ MK_ARRAY(TYPE_INT, (SNDRV_MASK_MAX+31)/32) ++) ++ ++STRUCT( sndrv_pcm_hw_params, ++ TYPE_INT, ++ MK_ARRAY(MK_STRUCT(STRUCT_sndrv_mask),SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1), ++ MK_ARRAY(MK_STRUCT(STRUCT_sndrv_mask), 5), /* reserved masks */ ++ MK_ARRAY(MK_STRUCT(STRUCT_sndrv_interval), SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1), ++ MK_ARRAY(MK_STRUCT(STRUCT_sndrv_interval), 9), /* reserved intervals */ ++ TYPE_INT, /* W: requested masks */ ++ TYPE_INT, /* R: changed masks */ ++ TYPE_INT, /* R: Info flags for returned setup */ ++ TYPE_INT, /* R: used most significant bits */ ++ TYPE_INT, /* R: rate numerator */ ++ TYPE_INT, /* R: rate denominator */ ++ TYPE_LONG, /* R: chip FIFO size in frames */ ++ MK_ARRAY(TYPE_CHAR, 64) /* reserved for future */ ++) ++ ++STRUCT( sndrv_pcm_sw_params, ++ TYPE_INT, /* timestamp mode */ ++ TYPE_INT, ++ TYPE_INT, /* min ticks to sleep */ ++ TYPE_LONG, /* min avail frames for wakeup */ ++ TYPE_LONG, /* xfer size need to be a multiple */ ++ TYPE_LONG, /* min hw_avail frames for automatic start */ ++ TYPE_LONG, /* min avail frames for automatic stop */ ++ TYPE_LONG, /* min distance from noise for silence filling */ ++ TYPE_LONG, /* silence block size */ ++ TYPE_LONG, /* poTYPE_INTers wrap point */ ++ MK_ARRAY(TYPE_CHAR, 64) /* reserved for future */ ++) ++ ++STRUCT( sndrv_pcm_channel_info, ++ TYPE_INT, ++ TYPE_LONG, /* mmap offset (FIXME) */ ++ TYPE_INT, /* offset to first sample in bits */ ++ TYPE_INT /* samples distance in bits */ ++) ++ ++ ++STRUCT( sndrv_pcm_status, ++ TYPE_INT, /* stream state */ ++ MK_STRUCT(STRUCT_timespec), /* time when stream was started/stopped/paused */ ++ MK_STRUCT(STRUCT_timespec), /* reference timestamp */ ++ TYPE_LONG, /* appl ptr */ ++ TYPE_LONG, /* hw ptr */ ++ TYPE_LONG, /* current delay in frames */ ++ TYPE_LONG, /* number of frames available */ ++ TYPE_LONG, /* max frames available on hw since last status */ ++ TYPE_LONG, /* count of ADC (capture) overrange detections from last status */ ++ TYPE_INT, /* suspended stream state */ ++ MK_ARRAY(TYPE_CHAR, 60) /* must be filled with zero */ ++) ++ ++STRUCT( sndrv_pcm_mmap_status, ++ TYPE_INT, /* RO: state - SNDRV_PCM_STATE_XXXX */ ++ TYPE_INT, /* Needed for 64 bit alignment */ ++ TYPE_LONG, /* RO: hw ptr (0...boundary-1) */ ++ MK_STRUCT(STRUCT_timespec), /* Timestamp */ ++ TYPE_INT /* RO: suspended stream state */ ++) ++ ++STRUCT( sndrv_pcm_mmap_control, ++ TYPE_LONG, /* RW: appl ptr (0...boundary-1) */ ++ TYPE_LONG /* RW: min available frames for wakeup */ ++) ++ ++STRUCT( sndrv_pcm_sync_ptr, ++ TYPE_INT, ++ // FIXME: does not work with 64-bit target ++ MK_STRUCT(STRUCT_sndrv_pcm_mmap_status), // 28 bytes on 32-bit target ++ MK_ARRAY(TYPE_CHAR, 64 - 24), // so we pad to 64 bytes (was a union) ++ ++ MK_STRUCT(STRUCT_sndrv_pcm_mmap_control), // 8 bytes on 32-bit target ++ MK_ARRAY(TYPE_CHAR, 64 - 8) // so we pad to 64 bytes (was a union)) ++) ++ ++STRUCT( sndrv_xferi, ++ TYPE_LONG, ++ TYPE_PTRVOID, ++ TYPE_LONG ++) ++ ++STRUCT( sndrv_xfern, ++ TYPE_LONG, ++ TYPE_PTRVOID, ++ TYPE_LONG ++) ++ ++STRUCT( sndrv_rawmidi_info, ++ TYPE_INT, /* RO/WR (control): device number */ ++ TYPE_INT, /* RO/WR (control): subdevice number */ ++ TYPE_INT, /* WR: stream */ ++ TYPE_INT, /* R: card number */ ++ TYPE_INT, /* SNDRV_RAWMIDI_INFO_XXXX */ ++ MK_ARRAY(TYPE_CHAR, 64), /* ID (user selectable) */ ++ MK_ARRAY(TYPE_CHAR, 80), /* name of device */ ++ MK_ARRAY(TYPE_CHAR, 32), /* name of active or selected subdevice */ ++ TYPE_INT, ++ TYPE_INT, ++ MK_ARRAY(TYPE_CHAR, 64) /* reserved for future use */ ++) ++ ++STRUCT( sndrv_rawmidi_params, ++ TYPE_INT, ++ TYPE_LONG, /* queue size in bytes */ ++ TYPE_LONG, /* minimum avail bytes for wakeup */ ++ TYPE_INT, /* do not send active sensing byte in close() */ ++ MK_ARRAY(TYPE_CHAR, 16) /* reserved for future use */ ++) ++ ++STRUCT( sndrv_rawmidi_status, ++ TYPE_INT, ++ MK_STRUCT(STRUCT_timespec), /* Timestamp */ ++ TYPE_LONG, /* available bytes */ ++ TYPE_LONG, /* count of overruns since last status (in bytes) */ ++ MK_ARRAY(TYPE_CHAR, 16) /* reserved for future use */ ++) ++ ++STRUCT( sndrv_timer_ginfo, ++ MK_STRUCT(STRUCT_sndrv_timer_id), /* requested timer ID */ ++ TYPE_INT, /* timer flags - SNDRV_TIMER_FLG_* */ ++ TYPE_INT, /* card number */ ++ MK_ARRAY(TYPE_CHAR, 64), /* timer identification */ ++ MK_ARRAY(TYPE_CHAR, 80), /* timer name */ ++ TYPE_LONG, /* reserved for future use */ ++ TYPE_LONG, /* average period resolution in ns */ ++ TYPE_LONG, /* minimal period resolution in ns */ ++ TYPE_LONG, /* maximal period resolution in ns */ ++ TYPE_INT, /* active timer clients */ ++ MK_ARRAY(TYPE_CHAR, 32) ++) ++ ++STRUCT( sndrv_timer_gparams, ++ MK_STRUCT(STRUCT_sndrv_timer_id), /* requested timer ID */ ++ TYPE_LONG, /* requested precise period duration (in seconds) - numerator */ ++ TYPE_LONG, /* requested precise period duration (in seconds) - denominator */ ++ MK_ARRAY(TYPE_CHAR, 32) ++) ++ ++STRUCT( sndrv_timer_gstatus, ++ MK_STRUCT(STRUCT_sndrv_timer_id), /* requested timer ID */ ++ TYPE_LONG, /* current period resolution in ns */ ++ TYPE_LONG, /* precise current period resolution (in seconds) - numerator */ ++ TYPE_LONG, /* precise current period resolution (in seconds) - denominator */ ++ MK_ARRAY(TYPE_CHAR, 32) ++) ++ ++STRUCT( sndrv_timer_select, ++ MK_STRUCT(STRUCT_sndrv_timer_id), /* bind to timer ID */ ++ MK_ARRAY(TYPE_CHAR, 32) /* reserved */ ++) ++ ++STRUCT( sndrv_timer_info, ++ TYPE_INT, /* timer flags - SNDRV_TIMER_FLG_* */ ++ TYPE_INT, /* card number */ ++ MK_ARRAY(TYPE_CHAR, 64), /* timer identificator */ ++ MK_ARRAY(TYPE_CHAR, 80), /* timer name */ ++ TYPE_LONG, /* reserved for future use */ ++ TYPE_LONG, /* average period resolution in ns */ ++ MK_ARRAY(TYPE_CHAR, 64) /* reserved */ ++) ++ ++STRUCT( sndrv_timer_params, ++ TYPE_INT, /* flags - SNDRV_MIXER_PSFLG_* */ ++ TYPE_INT, /* requested resolution in ticks */ ++ TYPE_INT, /* total size of queue (32-1024) */ ++ TYPE_INT, ++ TYPE_INT, /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */ ++ MK_ARRAY(TYPE_CHAR, 60) /* reserved */ ++) ++ ++STRUCT( sndrv_timer_status, ++ MK_STRUCT(STRUCT_timespec), /* Timestamp - last update */ ++ TYPE_INT, /* current period resolution in ns */ ++ TYPE_INT, /* counter of master tick lost */ ++ TYPE_INT, /* count of read queue overruns */ ++ TYPE_INT, /* used queue size */ ++ MK_ARRAY(TYPE_CHAR, 64) /* reserved */ ++) ++ ++STRUCT( sndrv_timer_read, ++ TYPE_INT, ++ TYPE_INT ++) ++ ++STRUCT( sndrv_timer_tread, ++ TYPE_INT, ++ MK_STRUCT(STRUCT_timespec), ++ TYPE_INT ++) ++ ++STRUCT( sndrv_ctl_card_info, ++ TYPE_INT, /* card number */ ++ TYPE_INT, /* reserved for future (was type) */ ++ MK_ARRAY(TYPE_CHAR, 16), /* ID of card (user selectable) */ ++ MK_ARRAY(TYPE_CHAR, 16), /* Driver name */ ++ MK_ARRAY(TYPE_CHAR, 32), /* Short name of soundcard */ ++ MK_ARRAY(TYPE_CHAR, 80), /* name + info text about soundcard */ ++ MK_ARRAY(TYPE_CHAR, 16), /* reserved for future (was ID of mixer) */ ++ MK_ARRAY(TYPE_CHAR, 80), /* visual mixer identification */ ++ MK_ARRAY(TYPE_CHAR, 80), /* card components / fine identification, delimited with one space (AC97 etc..) */ ++ MK_ARRAY(TYPE_CHAR, 48) /* reserved for future */ ++) ++ ++STRUCT( sndrv_ctl_elem_id, ++ TYPE_INT, ++ TYPE_INT, /* interface identifier */ ++ TYPE_INT, /* device/client number */ ++ TYPE_INT, /* subdevice (substream) number */ ++ MK_ARRAY(TYPE_CHAR, 44), /* ASCII name of item */ ++ TYPE_INT /* index of item */ ++) ++ ++STRUCT( sndrv_ctl_elem_list, ++ TYPE_INT, /* W: first element ID to get */ ++ TYPE_INT, /* W: count of element IDs to get */ ++ TYPE_INT, /* R: count of element IDs set */ ++ TYPE_INT, /* R: count of all elements */ ++ MK_STRUCT(STRUCT_sndrv_ctl_elem_id), /* R: IDs */ ++ MK_ARRAY(TYPE_CHAR, 50) ++) ++ ++STRUCT( sndrv_ctl_elem_info, ++ MK_STRUCT(STRUCT_sndrv_ctl_elem_id), /* W: element ID */ ++ TYPE_INT, /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ ++ TYPE_INT, /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ ++ TYPE_INT, /* count of values */ ++ TYPE_INT, /* owner's PID of this control */ ++ MK_ARRAY(TYPE_CHAR, 128), // FIXME: prone to break (was union) ++ MK_ARRAY(TYPE_SHORT, 4), /* dimensions */ ++ MK_ARRAY(TYPE_CHAR, 64-4*sizeof(unsigned short)) ++) ++ ++STRUCT( sndrv_ctl_elem_value, ++ MK_STRUCT(STRUCT_sndrv_ctl_elem_id), /* W: element ID */ ++ TYPE_INT, /* W: use indirect pointer (xxx_ptr member) */ ++ MK_ARRAY(TYPE_INT, 128), ++ MK_STRUCT(STRUCT_timespec), ++ MK_ARRAY(TYPE_CHAR, 128-sizeof(struct timespec)) // FIXME: breaks on 64-bit host ++) ++ ++STRUCT( sndrv_ctl_tlv, ++ TYPE_INT, /* control element numeric identification */ ++ TYPE_INT, /* in bytes aligned to 4 */ ++ MK_ARRAY(TYPE_INT, 0) /* first TLV */ // FIXME: what is this supposed to become? ++) ++ ++STRUCT( sndrv_ctl_event, ++ TYPE_INT, /* event type - SNDRV_CTL_EVENT_* */ ++ TYPE_INT, ++ MK_STRUCT(STRUCT_sndrv_ctl_elem_id) // 64 bytes ++) ++ ++STRUCT( iovec, ++ TYPE_PTRVOID, ++ TYPE_LONG ++ ) ++ ++ ++STRUCT( sndrv_xferv, ++ MK_STRUCT(STRUCT_iovec), ++ TYPE_LONG ++) ++ ++STRUCT(emu10k1_fx8010_info, ++ TYPE_INT, /* in samples */ ++ TYPE_INT, /* in samples */ ++ MK_ARRAY(MK_ARRAY(TYPE_CHAR, 32), 16), /* names of FXBUSes */ ++ MK_ARRAY(MK_ARRAY(TYPE_CHAR, 32), 16), /* names of external inputs */ ++ MK_ARRAY(MK_ARRAY(TYPE_CHAR, 32), 32), /* names of external outputs */ ++ TYPE_INT /* count of GPR controls */ ++) ++ ++STRUCT(emu10k1_ctl_elem_id, ++ TYPE_INT, /* don't use */ ++ TYPE_INT, /* interface identifier */ ++ TYPE_INT, /* device/client number */ ++ TYPE_INT, /* subdevice (substream) number */ ++ MK_ARRAY(TYPE_CHAR, 44), /* ASCII name of item */ ++ TYPE_INT /* index of item */ ++) ++ ++STRUCT(emu10k1_fx8010_control_gpr, ++ MK_STRUCT(STRUCT_emu10k1_ctl_elem_id), /* full control ID definition */ ++ TYPE_INT, /* visible count */ ++ TYPE_INT, /* count of GPR (1..16) */ ++ MK_ARRAY(TYPE_SHORT, 32), /* GPR number(s) */ ++ MK_ARRAY(TYPE_INT, 32), /* initial values */ ++ TYPE_INT, /* minimum range */ ++ TYPE_INT, /* maximum range */ ++ TYPE_INT, /* translation type (EMU10K1_GPR_TRANSLATION*) */ ++ TYPE_INT ++) ++ ++#ifndef TARGET_LONG_SIZE ++#define TARGET_LONG_SIZE 4 ++#endif ++ ++STRUCT(emu10k1_fx8010_code, ++ MK_ARRAY(TYPE_CHAR, 128), ++ ++ MK_ARRAY(TYPE_LONG, 0x200/(TARGET_LONG_SIZE*8)), /* bitmask of valid initializers */ ++ TYPE_PTRVOID, /* initializers */ ++ ++ TYPE_INT, /* count of GPR controls to add/replace */ ++ MK_STRUCT(STRUCT_emu10k1_fx8010_control_gpr), /* GPR controls to add/replace */ ++ ++ TYPE_INT, /* count of GPR controls to remove */ ++ MK_STRUCT(STRUCT_emu10k1_ctl_elem_id), /* IDs of GPR controls to remove */ ++ ++ TYPE_INT, /* count of GPR controls to list */ ++ TYPE_INT, /* total count of GPR controls */ ++ MK_STRUCT(STRUCT_emu10k1_fx8010_control_gpr), /* listed GPR controls */ ++ ++ MK_ARRAY(TYPE_LONG, 0x100/(TARGET_LONG_SIZE*8)), /* bitmask of valid initializers */ ++ TYPE_PTRVOID, /* data initializers */ ++ TYPE_PTRVOID, /* map initializers */ ++ ++ MK_ARRAY(TYPE_LONG, 1024/(TARGET_LONG_SIZE*8)), /* bitmask of valid instructions */ ++ TYPE_PTRVOID /* one instruction - 64 bits */ ++) ++ ++STRUCT(emu10k1_fx8010_tram, ++ TYPE_INT, /* 31.bit == 1 -> external TRAM */ ++ TYPE_INT, /* size in samples (4 bytes) */ ++ TYPE_INT /* pointer to samples (20-bit) */ ++ /* NULL->clear memory */ ++) ++ ++STRUCT(emu10k1_fx8010_pcm, ++ TYPE_INT, /* substream number */ ++ TYPE_INT, /* reserved */ ++ TYPE_INT, ++ TYPE_INT, /* ring buffer position in TRAM (in samples) */ ++ TYPE_INT, /* count of buffered samples */ ++ TYPE_SHORT, /* GPR containing size of ringbuffer in samples (host) */ ++ TYPE_SHORT, ++ TYPE_SHORT, /* GPR containing count of samples between two TYPE_INTerrupts (host) */ ++ TYPE_SHORT, ++ TYPE_SHORT, /* GPR containing trigger (activate) information (host) */ ++ TYPE_SHORT, /* GPR containing info if PCM is running (FX8010) */ ++ TYPE_CHAR, /* reserved */ ++ MK_ARRAY(TYPE_CHAR, 32), /* external TRAM address & data (one per channel) */ ++ TYPE_INT /* reserved */ ++) ++ ++STRUCT( hdsp_peak_rms, ++ MK_ARRAY(TYPE_INT, 26), ++ MK_ARRAY(TYPE_INT, 26), ++ MK_ARRAY(TYPE_INT, 28), ++ MK_ARRAY(TYPE_LONGLONG, 26), ++ MK_ARRAY(TYPE_LONGLONG, 26), ++ /* These are only used for H96xx cards */ ++ MK_ARRAY(TYPE_LONGLONG, 26) ++) ++ ++STRUCT( hdsp_config_info, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ MK_ARRAY(TYPE_CHAR, 3), ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_INT, ++ TYPE_INT, ++ TYPE_INT, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR, ++ TYPE_CHAR ++) ++ ++STRUCT( hdsp_firmware, ++ TYPE_PTRVOID /* 24413 x 4 bytes */ ++) ++ ++STRUCT( hdsp_version, ++ TYPE_INT, ++ TYPE_SHORT ++) ++ ++STRUCT( hdsp_mixer, ++ MK_ARRAY(TYPE_SHORT, HDSP_MATRIX_MIXER_SIZE) ++) ++ ++STRUCT( hdsp_9632_aeb, ++ TYPE_INT, ++ TYPE_INT ++) ++ ++STRUCT( snd_sb_csp_mc_header, ++ MK_ARRAY(TYPE_CHAR, 16), /* id name of codec */ ++ TYPE_SHORT /* requested function */ ++) ++ ++STRUCT( snd_sb_csp_microcode, ++ MK_STRUCT(STRUCT_snd_sb_csp_mc_header), ++ MK_ARRAY(TYPE_CHAR, SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE) ++) ++ ++STRUCT( snd_sb_csp_start, ++ TYPE_INT, ++ TYPE_INT ++) ++ ++STRUCT( snd_sb_csp_info, ++ MK_ARRAY(TYPE_CHAR, 16), /* id name of codec */ ++ TYPE_SHORT, /* function number */ ++ TYPE_INT, /* accepted PCM formats */ ++ TYPE_SHORT, /* accepted channels */ ++ TYPE_SHORT, /* accepted sample width */ ++ TYPE_SHORT, /* accepted sample rates */ ++ TYPE_SHORT, ++ TYPE_SHORT, /* current channels */ ++ TYPE_SHORT, /* current sample width */ ++ TYPE_SHORT, /* version id: 0x10 - 0x1f */ ++ TYPE_SHORT /* state bits */ ++) ++ ++STRUCT( sscape_bootblock, ++ MK_ARRAY(TYPE_CHAR, 256), ++ TYPE_INT ++) ++ ++STRUCT( sscape_microcode, ++ TYPE_PTRVOID ++) diff --git a/packaging/0007-qemu-cvs-alsa_mmap.patch.patch b/packaging/0007-qemu-cvs-alsa_mmap.patch.patch new file mode 100644 index 0000000..852b317 --- /dev/null +++ b/packaging/0007-qemu-cvs-alsa_mmap.patch.patch @@ -0,0 +1,45 @@ +From 75938d42711c299d319a16d54942a439ef2abac4 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 14 Apr 2009 16:24:15 +0200 +Subject: [PATCH] qemu-cvs-alsa_mmap + +Hack to prevent ALSA from using mmap() interface to simplify emulation. + +Signed-off-by: Alexander Graf +Signed-off-by: Ulrich Hecht +--- + 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 b412e3f..46523de 100644 +--- a/linux-user/mmap.c ++++ b/linux-user/mmap.c +@@ -377,6 +377,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) +@@ -411,6 +414,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; diff --git a/packaging/0008-qemu-cvs-gettimeofday.patch.patch b/packaging/0008-qemu-cvs-gettimeofday.patch.patch new file mode 100644 index 0000000..a037494 --- /dev/null +++ b/packaging/0008-qemu-cvs-gettimeofday.patch.patch @@ -0,0 +1,23 @@ +From e21969aab220744e0412c51a46e685d593dde832 Mon Sep 17 00:00:00 2001 +From: Ulrich Hecht +Date: Tue, 14 Apr 2009 16:25:41 +0200 +Subject: [PATCH] qemu-cvs-gettimeofday + +No clue what this is for. +--- + linux-user/syscall.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 10ea39f..fbdba83 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -6237,6 +6237,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + case TARGET_NR_gettimeofday: + { + struct timeval tv; ++ if(copy_from_user_timeval(&tv, arg1)) ++ goto efault; + ret = get_errno(gettimeofday(&tv, NULL)); + if (!is_error(ret)) { + if (copy_to_user_timeval(arg1, &tv)) diff --git a/packaging/0009-qemu-cvs-ioctl_debug.patch.patch b/packaging/0009-qemu-cvs-ioctl_debug.patch.patch new file mode 100644 index 0000000..668293c --- /dev/null +++ b/packaging/0009-qemu-cvs-ioctl_debug.patch.patch @@ -0,0 +1,31 @@ +From a28ad521ee4977748b405b7fbad25f686728d78a Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 14 Apr 2009 16:26:33 +0200 +Subject: [PATCH] qemu-cvs-ioctl_debug + +Extends unsupported ioctl debug output. + +Signed-off-by: Alexander Graf +Signed-off-by: Ulrich Hecht +--- + linux-user/syscall.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index fbdba83..6bfe718 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -3657,7 +3657,12 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg) + ie = ioctl_entries; + for(;;) { + if (ie->target_cmd == 0) { +- gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd); ++ int i; ++ gemu_log("Unsupported ioctl: cmd=0x%04lx (%x)\n", (unsigned long)cmd, (unsigned int)(cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT); ++ for (i = 0; ioctl_entries[i].target_cmd; i++) { ++ if ((ioctl_entries[i].target_cmd & ~(TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) == (cmd & ~(TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT))) ++ gemu_log("%p\t->\t%s (%x)\n", (void *)(unsigned long)ioctl_entries[i].host_cmd, ioctl_entries[i].name, (ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT); ++ } + return -TARGET_ENOSYS; + } + if (ie->target_cmd == cmd) diff --git a/packaging/0010-qemu-cvs-ioctl_nodirection.patch.patch b/packaging/0010-qemu-cvs-ioctl_nodirection.patch.patch new file mode 100644 index 0000000..78a85f3 --- /dev/null +++ b/packaging/0010-qemu-cvs-ioctl_nodirection.patch.patch @@ -0,0 +1,40 @@ +From 7732c5e1c49ffe35d73eed9a23a3b6fa603d8573 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 14 Apr 2009 16:27:36 +0200 +Subject: [PATCH] qemu-cvs-ioctl_nodirection + +the direction given in the ioctl should be correct so we can assume the +communication is uni-directional. The alsa developers did not like this +concept though and declared ioctls IOC_R and IOC_W even though they were +IOC_RW. + +Signed-off-by: Alexander Graf +Signed-off-by: Ulrich Hecht +--- + linux-user/syscall.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 6bfe718..46fc3df 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -3691,6 +3691,11 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg) + arg_type++; + target_size = thunk_type_size(arg_type, 0); + switch(ie->access) { ++ /* FIXME: actually the direction given in the ioctl should be ++ * correct so we can assume the communication is uni-directional. ++ * The alsa developers did not like this concept though and ++ * declared ioctls IOC_R and IOC_W even though they were IOC_RW.*/ ++/* + case IOC_R: + ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp)); + if (!is_error(ret)) { +@@ -3709,6 +3714,7 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg) + unlock_user(argptr, arg, 0); + ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp)); + break; ++*/ + default: + case IOC_RW: + argptr = lock_user(VERIFY_READ, arg, target_size, 1); diff --git a/packaging/0011-block-vmdk-Support-creation-of-SCSI.patch b/packaging/0011-block-vmdk-Support-creation-of-SCSI.patch new file mode 100644 index 0000000..4f7d8a1 --- /dev/null +++ b/packaging/0011-block-vmdk-Support-creation-of-SCSI.patch @@ -0,0 +1,131 @@ +From c6a8d6d888cacb6e480539f0b2ffbac84d937845 Mon Sep 17 00:00:00 2001 +From: Ulrich Hecht +Date: Tue, 14 Apr 2009 16:37:42 +0200 +Subject: [PATCH] block/vmdk: Support creation of SCSI VMDK images in qemu-img +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Ulrich Hecht +[AF: Changed BLOCK_FLAG_SCSI from 8 to 16 for v1.2] +Signed-off-by: Andreas Färber +--- + block.c | 5 ++++- + block/vmdk.c | 12 ++++++++++-- + block_int.h | 2 ++ + qemu-img.c | 8 +++++++- + 4 files changed, 23 insertions(+), 4 deletions(-) + +diff --git a/block.c b/block.c +index 470bdcc..b27622b 100644 +--- a/block.c ++++ b/block.c +@@ -3902,7 +3902,7 @@ int bdrv_img_create(const char *filename, const char *fmt, + char *options, uint64_t img_size, int flags) + { + QEMUOptionParameter *param = NULL, *create_options = NULL; +- QEMUOptionParameter *backing_fmt, *backing_file, *size; ++ QEMUOptionParameter *backing_fmt, *backing_file, *size, *scsi; + BlockDriverState *bs = NULL; + BlockDriver *drv, *proto_drv; + BlockDriver *backing_drv = NULL; +@@ -4017,6 +4017,9 @@ int bdrv_img_create(const char *filename, const char *fmt, + + printf("Formatting '%s', fmt=%s ", filename, fmt); + print_option_parameters(param); ++ scsi = get_option_parameter(param, BLOCK_OPT_SCSI); ++ if (scsi && scsi->value.n) ++ printf(", SCSI"); + puts(""); + + ret = bdrv_create(drv, filename, param); +diff --git a/block/vmdk.c b/block/vmdk.c +index bba4c61..7db59b0 100644 +--- a/block/vmdk.c ++++ b/block/vmdk.c +@@ -1432,7 +1432,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options) + "ddb.geometry.cylinders = \"%" PRId64 "\"\n" + "ddb.geometry.heads = \"16\"\n" + "ddb.geometry.sectors = \"63\"\n" +- "ddb.adapterType = \"ide\"\n"; ++ "ddb.adapterType = \"%s\"\n"; + + if (filename_decompose(filename, path, prefix, postfix, PATH_MAX)) { + return -EINVAL; +@@ -1447,6 +1447,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options) + flags |= options->value.n ? BLOCK_FLAG_COMPAT6 : 0; + } else if (!strcmp(options->name, BLOCK_OPT_SUBFMT)) { + fmt = options->value.s; ++ } else if (!strcmp(options->name, BLOCK_OPT_SCSI)) { ++ flags |= options->value.n ? BLOCK_FLAG_SCSI: 0; + } + options++; + } +@@ -1537,7 +1539,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options) + parent_desc_line, + ext_desc_lines, + (flags & BLOCK_FLAG_COMPAT6 ? 6 : 4), +- total_size / (int64_t)(63 * 16 * 512)); ++ total_size / (int64_t)(63 * 16 * 512), ++ flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide"); + if (split || flat) { + fd = qemu_open(filename, + O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_LARGEFILE, +@@ -1638,6 +1641,11 @@ static QEMUOptionParameter vmdk_create_options[] = { + "VMDK flat extent format, can be one of " + "{monolithicSparse (default) | monolithicFlat | twoGbMaxExtentSparse | twoGbMaxExtentFlat | streamOptimized} " + }, ++ { ++ .name = BLOCK_OPT_SCSI, ++ .type = OPT_FLAG, ++ .help = "SCSI image" ++ }, + { NULL } + }; + +diff --git a/block_int.h b/block_int.h +index 4452f6f..92a75c8 100644 +--- a/block_int.h ++++ b/block_int.h +@@ -35,6 +35,7 @@ + #define BLOCK_FLAG_ENCRYPT 1 + #define BLOCK_FLAG_COMPAT6 4 + #define BLOCK_FLAG_LAZY_REFCOUNTS 8 ++#define BLOCK_FLAG_SCSI 16 + + #define BLOCK_IO_LIMIT_READ 0 + #define BLOCK_IO_LIMIT_WRITE 1 +@@ -46,6 +47,7 @@ + #define BLOCK_OPT_SIZE "size" + #define BLOCK_OPT_ENCRYPT "encryption" + #define BLOCK_OPT_COMPAT6 "compat6" ++#define BLOCK_OPT_SCSI "scsi" + #define BLOCK_OPT_BACKING_FILE "backing_file" + #define BLOCK_OPT_BACKING_FMT "backing_fmt" + #define BLOCK_OPT_CLUSTER_SIZE "cluster_size" +diff --git a/qemu-img.c b/qemu-img.c +index b41e670..e34d88a 100644 +--- a/qemu-img.c ++++ b/qemu-img.c +@@ -665,7 +665,7 @@ static int img_convert(int argc, char **argv) + const uint8_t *buf1; + BlockDriverInfo bdi; + QEMUOptionParameter *param = NULL, *create_options = NULL; +- QEMUOptionParameter *out_baseimg_param; ++ QEMUOptionParameter *out_baseimg_param, *scsi; + char *options = NULL; + const char *snapshot_name = NULL; + float local_progress; +@@ -858,6 +858,12 @@ static int img_convert(int argc, char **argv) + } + } + ++ if ((scsi = get_option_parameter(param, BLOCK_OPT_SCSI)) && scsi->value.n && strcmp(drv->format_name, "vmdk")) { ++ error_report("SCSI devices not supported for this file format"); ++ ret = -1; ++ goto out; ++ } ++ + /* Create the new image */ + ret = bdrv_create(drv, out_filename, param); + if (ret < 0) { diff --git a/packaging/0012-configure-Enable-mipsn32-linux-user.patch b/packaging/0012-configure-Enable-mipsn32-linux-user.patch new file mode 100644 index 0000000..5cdfa1c --- /dev/null +++ b/packaging/0012-configure-Enable-mipsn32-linux-user.patch @@ -0,0 +1,29 @@ +From c70851ae29a0c9c6671c1c0c813e043d6468f3b2 Mon Sep 17 00:00:00 2001 +From: Ulrich Hecht +Date: Wed, 25 Aug 2010 14:23:43 +0200 +Subject: [PATCH] configure: Enable mipsn32*-linux-user builds +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Ulrich Hecht +[AF: Merged default-configs upstream] +[AF: Merged with new or32-linux-user for v1.2] +Signed-off-by: Andreas Färber +--- + configure | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/configure b/configure +index d97fd81..ebf7a6b 100755 +--- a/configure ++++ b/configure +@@ -997,6 +997,8 @@ microblaze-linux-user \ + microblazeel-linux-user \ + mips-linux-user \ + mipsel-linux-user \ ++mipsn32-linux-user \ ++mipsn32el-linux-user \ + or32-linux-user \ + ppc-linux-user \ + ppc64-linux-user \ diff --git a/packaging/0013-linux-user-add-binfmt-wrapper-for-a.patch b/packaging/0013-linux-user-add-binfmt-wrapper-for-a.patch new file mode 100644 index 0000000..a1849dd --- /dev/null +++ b/packaging/0013-linux-user-add-binfmt-wrapper-for-a.patch @@ -0,0 +1,199 @@ +From b7af750752167f3288ff3c8c94f6228964a37b26 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Fri, 30 Sep 2011 19:40:36 +0200 +Subject: [PATCH] linux-user: add binfmt wrapper for argv[0] handling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When using qemu's linux-user binaries through binfmt, argv[0] gets lost +along the execution because qemu only gets passed in the full file name +to the executable while argv[0] can be something completely different. + +This breaks in some subtile situations, such as the grep and make test +suites. + +This patch adds a wrapper binary called qemu-$TARGET-binfmt that can be +used with binfmt's P flag which passes the full path _and_ argv[0] to +the binfmt handler. + +The binary would be smart enough to be versatile and only exist in the +system once, creating the qemu binary path names from its own argv[0]. +However, this seemed like it didn't fit the make system too well, so +we're currently creating a new binary for each target archictecture. + +CC: Reinhard Max +Signed-off-by: Alexander Graf +[AF: Rebased onto new Makefile infrastructure] +Signed-off-by: Andreas Färber +--- + Makefile.target | 12 ++++++++++++ + linux-user/Makefile.objs | 2 ++ + linux-user/binfmt.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + scripts/qemu-binfmt-conf.sh | 34 +++++++++++++++++----------------- + 4 files changed, 73 insertions(+), 17 deletions(-) + create mode 100644 linux-user/binfmt.c + +diff --git a/Makefile.target b/Makefile.target +index 7892a8d..e802f3f 100644 +--- a/Makefile.target ++++ b/Makefile.target +@@ -34,6 +34,10 @@ PROGS+=$(QEMU_PROGW) + endif + STPFILES= + ++ifdef CONFIG_LINUX_USER ++PROGS+=$(QEMU_PROG)-binfmt ++endif ++ + ifndef CONFIG_HAIKU + LIBS+=-lm + endif +@@ -98,6 +102,8 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user + obj-y += linux-user/ + obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y) + ++obj-binfmt-y += linux-user/ ++ + endif #CONFIG_LINUX_USER + + ######################################################### +@@ -155,6 +161,9 @@ GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h + endif # CONFIG_SOFTMMU + + nested-vars += obj-y ++ifdef CONFIG_LINUX_USER ++nested-vars += obj-binfmt-y ++endif + + # This resolves all nested paths, so it must come last + include $(SRC_PATH)/Makefile.objs +@@ -183,6 +192,9 @@ $(QEMU_PROG): $(all-obj-y) + $(call LINK,$^) + endif + ++$(QEMU_PROG)-binfmt: $(obj-binfmt-y) ++ $(call LINK,$^) ++ + gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh + $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") + +diff --git a/linux-user/Makefile.objs b/linux-user/Makefile.objs +index 5899d72..18212a2 100644 +--- a/linux-user/Makefile.objs ++++ b/linux-user/Makefile.objs +@@ -5,3 +5,5 @@ obj-$(TARGET_HAS_BFLT) += flatload.o + obj-$(TARGET_I386) += vm86.o + obj-$(TARGET_ARM) += arm/nwfpe/ + obj-$(TARGET_M68K) += m68k-sim.o ++ ++obj-binfmt-y = binfmt.o +diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c +new file mode 100644 +index 0000000..cd1f513 +--- /dev/null ++++ b/linux-user/binfmt.c +@@ -0,0 +1,42 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++int main(int argc, char **argv, char **envp) ++{ ++ char *binfmt; ++ char **new_argv; ++ ++ /* ++ * Check if our file name ends with -binfmt ++ */ ++ binfmt = argv[0] + strlen(argv[0]) - strlen("-binfmt"); ++ if (strcmp(binfmt, "-binfmt")) { ++ fprintf(stderr, "%s: Invalid executable name\n", argv[0]); ++ exit(1); ++ } ++ if (argc < 3) { ++ fprintf(stderr, "%s: Please use me through binfmt with P flag\n", ++ argv[0]); ++ exit(1); ++ } ++ ++ binfmt[0] = '\0'; ++ /* Now argv[0] is the real qemu binary name */ ++ ++ new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv)); ++ if (argc > 3) { ++ memcpy(&new_argv[4], &argv[3], (argc - 3) * sizeof(*new_argv)); ++ } ++ new_argv[0] = argv[0]; ++ new_argv[1] = (char *)"-0"; ++ new_argv[2] = argv[2]; ++ new_argv[3] = argv[1]; ++ new_argv[argc + 1] = NULL; ++ ++ return execve(new_argv[0], new_argv, envp); ++} +diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh +index dc652f0..37d03f3 100644 +--- a/scripts/qemu-binfmt-conf.sh ++++ b/scripts/qemu-binfmt-conf.sh +@@ -34,39 +34,39 @@ esac + + # register the interpreter for each cpu except for the native one + if [ $cpu != "i386" ] ; then +- echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register +- echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register ++ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "alpha" ] ; then +- echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register ++ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "arm" ] ; then +- echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register +- echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register ++ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "sparc" ] ; then +- echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register ++ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "ppc" ] ; then +- echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register ++ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "m68k" ] ; then + echo 'Please check cpu value and header information for m68k!' +- echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register ++ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "mips" ] ; then + # FIXME: We could use the other endianness on a MIPS host. +- echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register +- echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register +- echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:' > /proc/sys/fs/binfmt_misc/register +- echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register +- echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register +- echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register ++ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "sh" ] ; then +- echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register +- echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register ++ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P' > /proc/sys/fs/binfmt_misc/register ++ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi + if [ $cpu != "s390x" ] ; then +- echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x:' > /proc/sys/fs/binfmt_misc/register ++ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x-binfmt:P' > /proc/sys/fs/binfmt_misc/register + fi diff --git a/packaging/0014-linux-user-Ignore-timer_create-sysc.patch b/packaging/0014-linux-user-Ignore-timer_create-sysc.patch new file mode 100644 index 0000000..108737b --- /dev/null +++ b/packaging/0014-linux-user-Ignore-timer_create-sysc.patch @@ -0,0 +1,29 @@ +From af1996be2ec3451ba2a50e079328916a5f4f2db0 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Sun, 11 Dec 2011 01:19:24 +0100 +Subject: [PATCH] linux-user: Ignore timer_create syscall + +We don't implement the timer_create syscall, but shouting out loud +about it breaks some %check tests in OBS, so better ignore it silently. + +Signed-off-by: Alexander Graf +--- + linux-user/syscall.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 46fc3df..0da4cce 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -8555,6 +8555,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + break; + #endif + ++#if defined(TARGET_NR_timer_create) ++ case TARGET_NR_timer_create: ++ goto unimplemented_nowarn; ++#endif ++ + #if defined(TARGET_NR_tkill) && defined(__NR_tkill) + case TARGET_NR_tkill: + ret = get_errno(sys_tkill((int)arg1, target_to_host_signal(arg2))); diff --git a/packaging/0015-linux-user-be-silent-about-capget-f.patch b/packaging/0015-linux-user-be-silent-about-capget-f.patch new file mode 100644 index 0000000..cb3bd90 --- /dev/null +++ b/packaging/0015-linux-user-be-silent-about-capget-f.patch @@ -0,0 +1,27 @@ +From f8f3c9eae7186bd49662efda635be42186d19f0e Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Sun, 11 Dec 2011 01:21:51 +0100 +Subject: [PATCH] linux-user: be silent about capget failures + +Complaining about capget doesn't buy us anything, but makes %check +fail in certain builds. So better not complain about its missing +implementation and go on with life :) + +Signed-off-by: Alexander Graf +--- + linux-user/syscall.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 0da4cce..46331c7 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -7536,7 +7536,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + unlock_user(p, arg1, ret); + break; + case TARGET_NR_capget: +- goto unimplemented; ++ goto unimplemented_nowarn; + case TARGET_NR_capset: + goto unimplemented; + case TARGET_NR_sigaltstack: diff --git a/packaging/0016-PPC-KVM-Disable-mmu-notifier-check..patch b/packaging/0016-PPC-KVM-Disable-mmu-notifier-check..patch new file mode 100644 index 0000000..3bc73a4 --- /dev/null +++ b/packaging/0016-PPC-KVM-Disable-mmu-notifier-check..patch @@ -0,0 +1,31 @@ +From ce883e32df0e52395c5df74364e424c255657a64 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Fri, 6 Jan 2012 01:05:55 +0100 +Subject: [PATCH] PPC: KVM: Disable mmu notifier check + +When using hugetlbfs (which is required for HV mode KVM on 970), we +check for MMU notifiers that on 970 can not be implemented properly. + +So disable the check for mmu notifiers on PowerPC guests, making +KVM guests work there, even if possibly racy in some odd circumstances. +--- + exec.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/exec.c b/exec.c +index 9cbdc35..baa495f 100644 +--- a/exec.c ++++ b/exec.c +@@ -2392,10 +2392,12 @@ static void *file_ram_alloc(RAMBlock *block, + return NULL; + } + ++#ifndef TARGET_PPC + if (kvm_enabled() && !kvm_has_sync_mmu()) { + fprintf(stderr, "host lacks kvm mmu notifiers, -mem-path unsupported\n"); + return NULL; + } ++#endif + + if (asprintf(&filename, "%s/qemu_back_mem.XXXXXX", path) == -1) { + return NULL; diff --git a/packaging/0017-linux-user-fix-segfault-deadlock.pa.patch b/packaging/0017-linux-user-fix-segfault-deadlock.pa.patch new file mode 100644 index 0000000..969d0fe --- /dev/null +++ b/packaging/0017-linux-user-fix-segfault-deadlock.pa.patch @@ -0,0 +1,64 @@ +From 76d1a76b0286e02aa575faad3556f73481ade1b2 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Fri, 13 Jan 2012 17:05:41 +0100 +Subject: [PATCH] linux-user: fix segfault deadlock + +When entering the guest we take a lock to ensure that nobody else messes +with our TB chaining while we're doing it. If we get a segfault inside that +code, we manage to work on, but will not unlock the lock. + +This patch forces unlocking of that lock in the segv handler. I'm not sure +this is the right approach though. Maybe we should rather make sure we don't +segfault in the code? I would greatly appreciate someone more intelligible +than me to look at this :). + +Example code to trigger this is at: http://csgraf.de/tmp/conftest.c + +Reported-by: Fabio Erculiani +Signed-off-by: Alexander Graf +--- + qemu-lock.h | 10 ++++++++++ + user-exec.c | 4 ++++ + 2 files changed, 14 insertions(+), 0 deletions(-) + +diff --git a/qemu-lock.h b/qemu-lock.h +index a72edda..e460e12 100644 +--- a/qemu-lock.h ++++ b/qemu-lock.h +@@ -24,6 +24,12 @@ + #include + #define spin_lock pthread_mutex_lock + #define spin_unlock pthread_mutex_unlock ++static inline void spin_unlock_safe(pthread_mutex_t *lock) ++{ ++ /* unlocking an unlocked mutex results in undefined behavior */ ++ pthread_mutex_trylock(lock); ++ pthread_mutex_unlock(lock); ++} + #define spinlock_t pthread_mutex_t + #define SPIN_LOCK_UNLOCKED PTHREAD_MUTEX_INITIALIZER + +@@ -46,4 +52,8 @@ static inline void spin_unlock(spinlock_t *lock) + { + } + ++static inline void spin_unlock_safe(spinlock_t *lock) ++{ ++} ++ + #endif +diff --git a/user-exec.c b/user-exec.c +index b9ea9dd..5a04218 100644 +--- a/user-exec.c ++++ b/user-exec.c +@@ -102,6 +102,10 @@ static inline int handle_cpu_signal(uintptr_t pc, unsigned long address, + qemu_printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", + pc, address, is_write, *(unsigned long *)old_set); + #endif ++ ++ /* Maybe we're still holding the TB fiddling lock? */ ++ spin_unlock_safe(&tb_lock); ++ + /* XXX: locking issue */ + if (is_write && h2g_valid(address) + && page_unprotect(h2g(address), pc, puc)) { diff --git a/packaging/0018-linux-user-binfmt-support-host-bina.patch b/packaging/0018-linux-user-binfmt-support-host-bina.patch new file mode 100644 index 0000000..745e7c7 --- /dev/null +++ b/packaging/0018-linux-user-binfmt-support-host-bina.patch @@ -0,0 +1,56 @@ +From 0ab4e7c155b5b5bc60fab22581480f50b100c6d7 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Thu, 2 Feb 2012 18:02:33 +0100 +Subject: [PATCH] linux-user: binfmt: support host binaries + +When we have a working host binary equivalent for the guest binary we're +trying to run, let's just use that instead as it will be a lot faster. + +Signed-off-by: Alexander Graf +--- + linux-user/binfmt.c | 25 +++++++++++++++++++++++++ + 1 files changed, 25 insertions(+), 0 deletions(-) + +diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c +index cd1f513..87dc4c6 100644 +--- a/linux-user/binfmt.c ++++ b/linux-user/binfmt.c +@@ -5,6 +5,9 @@ + #include + #include + ++#ifdef __x86_64__ ++#define ARCH_NAME "x86_64" ++#endif + + int main(int argc, char **argv, char **envp) + { +@@ -28,6 +31,28 @@ int main(int argc, char **argv, char **envp) + binfmt[0] = '\0'; + /* Now argv[0] is the real qemu binary name */ + ++#ifdef ARCH_NAME ++ { ++ char *hostbin; ++ char *guestarch; ++ ++ guestarch = strrchr(argv[0], '-') ; ++ if (!guestarch) { ++ goto skip; ++ } ++ guestarch++; ++ asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]); ++ if (!access(hostbin, X_OK)) { ++ /* ++ * We found a host binary replacement for the non-host binary. Let's ++ * use that instead! ++ */ ++ return execve(hostbin, &argv[2], envp); ++ } ++ } ++skip: ++#endif ++ + new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv)); + if (argc > 3) { + memcpy(&new_argv[4], &argv[3], (argc - 3) * sizeof(*new_argv)); diff --git a/packaging/0019-linux-user-arm-no-tb_flush-on-reset.patch b/packaging/0019-linux-user-arm-no-tb_flush-on-reset.patch new file mode 100644 index 0000000..22549ae --- /dev/null +++ b/packaging/0019-linux-user-arm-no-tb_flush-on-reset.patch @@ -0,0 +1,31 @@ +From 3003a3645ad1ab3b81fe3cc33020edbc3c4d04c4 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 29 May 2012 15:30:01 +0200 +Subject: [PATCH] linux-user: arm: no tb_flush on reset + +When running automoc4 as linux-user guest program, it segfaults right after +it creates a thread. Bisecting pointed to commit a84fac1426 which introduces +tb_flush on reset. + +So something in our thread creation is broken. But for now, let's revert the +change to at least get a working build again. +--- + target-arm/cpu.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/target-arm/cpu.c b/target-arm/cpu.c +index b00f5fa..740dbc3 100644 +--- a/target-arm/cpu.c ++++ b/target-arm/cpu.c +@@ -124,7 +124,11 @@ static void arm_cpu_reset(CPUState *s) + * bake assumptions about into translated code, so we need to + * tb_flush(). + */ ++#if !defined(CONFIG_USER_ONLY) ++ /* XXX hack alert! automoc4 segaults after spawning a new thread with this ++ flush enabled */ + tb_flush(env); ++#endif + } + + static inline void set_feature(CPUARMState *env, int feature) diff --git a/packaging/0020-linux-user-fix-multi-threaded-proc-.patch b/packaging/0020-linux-user-fix-multi-threaded-proc-.patch new file mode 100644 index 0000000..4615dce --- /dev/null +++ b/packaging/0020-linux-user-fix-multi-threaded-proc-.patch @@ -0,0 +1,32 @@ +From bd56605435341c14ff8fb6194961f3ab7d00cc79 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Wed, 30 May 2012 14:40:47 +0200 +Subject: [PATCH] linux-user: fix multi-threaded /proc/self/maps + +When reading our faked /proc/self/maps from a secondary thread, +we get an invalid stack entry. This is because ts->stack_base is not +initialized in non-primary threads. + +However, ts->info is, and the stack layout information we're looking +for is there too. So let's use that one instead! + +Signed-off-by: Alexander Graf +--- + linux-user/syscall.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 46331c7..946f5fb 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -4975,8 +4975,8 @@ static int open_self_maps(void *cpu_env, int fd) + #if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32) + dprintf(fd, "%08llx-%08llx rw-p %08llx 00:00 0 [stack]\n", + (unsigned long long)ts->info->stack_limit, +- (unsigned long long)(ts->stack_base + (TARGET_PAGE_SIZE - 1)) +- & TARGET_PAGE_MASK, ++ (unsigned long long)(ts->info->start_stack + ++ (TARGET_PAGE_SIZE - 1)) & TARGET_PAGE_MASK, + (unsigned long long)0); + #endif + diff --git a/packaging/0021-use-libexecdir-instead-of-ignoring-.patch b/packaging/0021-use-libexecdir-instead-of-ignoring-.patch new file mode 100644 index 0000000..8fdaf3b --- /dev/null +++ b/packaging/0021-use-libexecdir-instead-of-ignoring-.patch @@ -0,0 +1,83 @@ +From 50cab0124e30c58c786c181b8b1909c659a7d458 Mon Sep 17 00:00:00 2001 +From: Michael Tokarev +Date: Thu, 7 Jun 2012 01:11:00 +0400 +Subject: [PATCH] use --libexecdir instead of ignoring it first and + reinventing it later +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit 7b93fadf3a38d1ed65ea5536a52efc2772c6e3b8 "Add basic version +of bridge helper" put the bridge helper executable into a fixed +${prefix}/libexec/ location, instead of using ${libexecdir} for +this. At the same time, --libexecdir is being happily ignored +by ./configure. Even more, the same patch sets unused $libexecdir +variable in the generated config-host.mak, and uses fixed string +(\${prefix}/libexecdir) for the bridge helper binary. + +Fix this braindamage by introducing $libexecdir variable, using +it for the bridge helper binary, and recognizing --libexecdir. + +This patch is applicable to stable-1.1. + +Signed-off-by: Michael Tokarev +Signed-off-by: Andreas Färber +--- + configure | 10 +++++++--- + 1 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/configure b/configure +index ebf7a6b..e39635c 100755 +--- a/configure ++++ b/configure +@@ -183,6 +183,7 @@ datadir="\${prefix}/share" + qemu_docdir="\${prefix}/share/doc/qemu" + bindir="\${prefix}/bin" + libdir="\${prefix}/lib" ++libexecdir="\${prefix}/libexec" + includedir="\${prefix}/include" + sysconfdir="\${prefix}/etc" + confsuffix="/qemu" +@@ -633,6 +634,8 @@ for opt do + ;; + --libdir=*) libdir="$optarg" + ;; ++ --libexecdir=*) libexecdir="$optarg" ++ ;; + --includedir=*) includedir="$optarg" + ;; + --datadir=*) datadir="$optarg" +@@ -643,7 +646,7 @@ for opt do + ;; + --sysconfdir=*) sysconfdir="$optarg" + ;; +- --sbindir=*|--libexecdir=*|--sharedstatedir=*|--localstatedir=*|\ ++ --sbindir=*|--sharedstatedir=*|--localstatedir=*|\ + --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ + --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) + # These switches are silently ignored, for compatibility with +@@ -3082,6 +3085,7 @@ echo "Install prefix $prefix" + echo "BIOS directory `eval echo $qemu_datadir`" + echo "binary directory `eval echo $bindir`" + echo "library directory `eval echo $libdir`" ++echo "libexec directory `eval echo $libexecdir`" + echo "include directory `eval echo $includedir`" + echo "config directory `eval echo $sysconfdir`" + if test "$mingw32" = "no" ; then +@@ -3185,14 +3189,14 @@ echo all: >> $config_host_mak + echo "prefix=$prefix" >> $config_host_mak + echo "bindir=$bindir" >> $config_host_mak + echo "libdir=$libdir" >> $config_host_mak ++echo "libexecdir=$libexecdir" >> $config_host_mak + echo "includedir=$includedir" >> $config_host_mak + echo "mandir=$mandir" >> $config_host_mak + echo "sysconfdir=$sysconfdir" >> $config_host_mak + echo "qemu_confdir=$qemu_confdir" >> $config_host_mak + echo "qemu_datadir=$qemu_datadir" >> $config_host_mak + echo "qemu_docdir=$qemu_docdir" >> $config_host_mak +-echo "libexecdir=\${prefix}/libexec" >> $config_host_mak +-echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak ++echo "CONFIG_QEMU_HELPERDIR=\"$libexecdir\"" >> $config_host_mak + + echo "ARCH=$ARCH" >> $config_host_mak + if test "$debug_tcg" = "yes" ; then diff --git a/packaging/0022-linux-user-Ignore-broken-loop-ioctl.patch b/packaging/0022-linux-user-Ignore-broken-loop-ioctl.patch new file mode 100644 index 0000000..de246e3 --- /dev/null +++ b/packaging/0022-linux-user-Ignore-broken-loop-ioctl.patch @@ -0,0 +1,72 @@ +From 220524131e4a49e2605d1f32eef7856e87f9e6ca Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 12 Jun 2012 04:41:10 +0200 +Subject: [PATCH] linux-user: Ignore broken loop ioctl + +During invocations of losetup, we run into an ioctl that doesn't +exist. However, because of that we output an error, which then +screws up the kiwi logic around that call. + +So let's silently ignore that bogus ioctl. + +Signed-off-by: Alexander Graf +--- + linux-user/ioctls.h | 1 + + linux-user/linux_loop.h | 1 + + linux-user/syscall.c | 7 +++++++ + linux-user/syscall_defs.h | 1 + + 4 files changed, 10 insertions(+), 0 deletions(-) + +diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h +index 6af0cb7..bb76c56 100644 +--- a/linux-user/ioctls.h ++++ b/linux-user/ioctls.h +@@ -328,6 +328,7 @@ + IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64))) + IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64))) + IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT) ++ IOCTL_SPECIAL(LOOP_BOGUS_CMD, 0, do_ioctl_fail, TYPE_INT) + + IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop))) + IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget))) +diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h +index 8974caa..810ae61 100644 +--- a/linux-user/linux_loop.h ++++ b/linux-user/linux_loop.h +@@ -91,5 +91,6 @@ struct loop_info64 { + #define LOOP_SET_STATUS64 0x4C04 + #define LOOP_GET_STATUS64 0x4C05 + #define LOOP_CHANGE_FD 0x4C06 ++#define LOOP_BOGUS_CMD 0x4C82 + + #endif +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 946f5fb..ed87c54 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -3634,6 +3634,13 @@ out: + return ret; + } + ++static abi_long do_ioctl_fail(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, ++ abi_long cmd, abi_long arg) ++{ ++ /* Fail silently */ ++ return -EINVAL; ++} ++ + static IOCTLEntry ioctl_entries[] = { + #define IOCTL(cmd, access, ...) \ + { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } }, +diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h +index 8644f87..d708131 100644 +--- a/linux-user/syscall_defs.h ++++ b/linux-user/syscall_defs.h +@@ -1016,6 +1016,7 @@ struct target_pollfd { + #define TARGET_LOOP_SET_STATUS64 0x4C04 + #define TARGET_LOOP_GET_STATUS64 0x4C05 + #define TARGET_LOOP_CHANGE_FD 0x4C06 ++#define TARGET_LOOP_BOGUS_CMD 0x4C82 + + /* fb ioctls */ + #define TARGET_FBIOGET_VSCREENINFO 0x4600 diff --git a/packaging/0023-linux-user-fix-segmentation-fault-p.patch b/packaging/0023-linux-user-fix-segmentation-fault-p.patch new file mode 100644 index 0000000..a130318 --- /dev/null +++ b/packaging/0023-linux-user-fix-segmentation-fault-p.patch @@ -0,0 +1,41 @@ +From 15d8143262362abfe31588500946d49eb27f9d99 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Mon, 25 Jun 2012 19:02:32 +0200 +Subject: [PATCH] linux-user: fix segmentation fault passing with g2h(x) != x +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When forwarding a segmentation fault into the guest process, we were passing +the host's address directly into the guest process's signal descriptor. + +That obviously confused the guest process, since it didn't know what to make +of the (usually 32-bit truncated) address. Passing in g2h(address) makes the +guest process a lot happier. + +This fixes java running in arm-linux-user for me. + +Signed-off-by: Alexander Graf +[AF: Rebased onto AREG0 fix for v1.2, squashed fixup by agraf] +Signed-off-by: Andreas Färber +--- + user-exec.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/user-exec.c b/user-exec.c +index 5a04218..bc3eef9 100644 +--- a/user-exec.c ++++ b/user-exec.c +@@ -112,6 +112,12 @@ static inline int handle_cpu_signal(uintptr_t pc, unsigned long address, + return 1; + } + ++ if (RESERVED_VA) { ++ /* Convert forcefully to guest address space, invalid addresses ++ are still valid segv ones */ ++ address = address - GUEST_BASE; ++ } ++ + /* see if it is an MMU fault */ + ret = cpu_handle_mmu_fault(cpu_single_env, address, is_write, + MMU_USER_IDX); diff --git a/packaging/0024-linux-user-lock-tcg.patch.patch b/packaging/0024-linux-user-lock-tcg.patch.patch new file mode 100644 index 0000000..b5bf942 --- /dev/null +++ b/packaging/0024-linux-user-lock-tcg.patch.patch @@ -0,0 +1,154 @@ +From 7b0143c4d7b4db4d0abe3965a4005aea661adaf2 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Thu, 5 Jul 2012 17:31:39 +0200 +Subject: [PATCH] linux-user: lock tcg + +The tcg code generator is not thread safe. Lock its generation between +different threads. + +Signed-off-by: Alexander Graf +--- + linux-user/mmap.c | 3 +++ + tcg/tcg.c | 36 ++++++++++++++++++++++++++++++++++-- + tcg/tcg.h | 6 ++++++ + 3 files changed, 43 insertions(+), 2 deletions(-) + +diff --git a/linux-user/mmap.c b/linux-user/mmap.c +index 46523de..59718b5 100644 +--- a/linux-user/mmap.c ++++ b/linux-user/mmap.c +@@ -30,6 +30,7 @@ + + #include "qemu.h" + #include "qemu-common.h" ++#include "tcg.h" + + //#define DEBUG_MMAP + +@@ -41,6 +42,7 @@ void mmap_lock(void) + { + if (mmap_lock_count++ == 0) { + pthread_mutex_lock(&mmap_mutex); ++ tcg_lock(); + } + } + +@@ -48,6 +50,7 @@ void mmap_unlock(void) + { + if (--mmap_lock_count == 0) { + pthread_mutex_unlock(&mmap_mutex); ++ tcg_unlock(); + } + } + +diff --git a/tcg/tcg.c b/tcg/tcg.c +index 8386b70..b067fc1 100644 +--- a/tcg/tcg.c ++++ b/tcg/tcg.c +@@ -40,6 +40,8 @@ + #include "cache-utils.h" + #include "host-utils.h" + #include "qemu-timer.h" ++#include "config-host.h" ++#include "qemu-thread.h" + + /* Note: the long term plan is to reduce the dependancies on the QEMU + CPU definitions. Currently they are used for qemu_ld/st +@@ -105,6 +107,29 @@ static TCGRegSet tcg_target_call_clobber_regs; + uint16_t *gen_opc_ptr; + TCGArg *gen_opparam_ptr; + ++#ifdef CONFIG_USER_ONLY ++static __thread int tcg_lock_count; ++#endif ++void tcg_lock(void) ++{ ++#ifdef CONFIG_USER_ONLY ++ TCGContext *s = &tcg_ctx; ++ if (tcg_lock_count++ == 0) { ++ qemu_mutex_lock(&s->lock); ++ } ++#endif ++} ++ ++void tcg_unlock(void) ++{ ++#ifdef CONFIG_USER_ONLY ++ TCGContext *s = &tcg_ctx; ++ if (--tcg_lock_count == 0) { ++ qemu_mutex_unlock(&s->lock); ++ } ++#endif ++} ++ + static inline void tcg_out8(TCGContext *s, uint8_t v) + { + *s->code_ptr++ = v; +@@ -245,7 +270,8 @@ void tcg_context_init(TCGContext *s) + memset(s, 0, sizeof(*s)); + s->temps = s->static_temps; + s->nb_globals = 0; +- ++ qemu_mutex_init(&s->lock); ++ + /* Count total number of arguments and allocate the corresponding + space */ + total_args = 0; +@@ -2188,11 +2214,13 @@ int tcg_gen_code(TCGContext *s, uint8_t *gen_code_buf) + } + #endif + ++ tcg_lock(); + tcg_gen_code_common(s, gen_code_buf, -1); + + /* flush instruction cache */ + flush_icache_range((tcg_target_ulong)gen_code_buf, + (tcg_target_ulong)s->code_ptr); ++ tcg_unlock(); + + return s->code_ptr - gen_code_buf; + } +@@ -2203,7 +2231,11 @@ int tcg_gen_code(TCGContext *s, uint8_t *gen_code_buf) + Return -1 if not found. */ + int tcg_gen_code_search_pc(TCGContext *s, uint8_t *gen_code_buf, long offset) + { +- return tcg_gen_code_common(s, gen_code_buf, offset); ++ int r; ++ tcg_lock(); ++ r = tcg_gen_code_common(s, gen_code_buf, offset); ++ tcg_unlock(); ++ return r; + } + + #ifdef CONFIG_PROFILER +diff --git a/tcg/tcg.h b/tcg/tcg.h +index d710694..9902ee6 100644 +--- a/tcg/tcg.h ++++ b/tcg/tcg.h +@@ -46,6 +46,8 @@ typedef uint64_t tcg_target_ulong; + #error unsupported + #endif + ++#include "config-host.h" ++#include "qemu-thread.h" + #include "tcg-target.h" + #include "tcg-runtime.h" + +@@ -389,6 +391,7 @@ struct TCGContext { + #ifdef CONFIG_DEBUG_TCG + int temps_in_use; + #endif ++ QemuMutex lock; + }; + + extern TCGContext tcg_ctx; +@@ -568,6 +571,9 @@ void tcg_gen_shifti_i64(TCGv_i64 ret, TCGv_i64 arg1, + TCGArg *tcg_optimize(TCGContext *s, uint16_t *tcg_opc_ptr, TCGArg *args, + TCGOpDef *tcg_op_def); + ++extern void tcg_lock(void); ++extern void tcg_unlock(void); ++ + /* only used for debugging purposes */ + void tcg_register_helper(void *func, const char *name); + const char *tcg_helper_get_name(TCGContext *s, void *func); diff --git a/packaging/0025-linux-user-Run-multi-threaded-code-.patch b/packaging/0025-linux-user-Run-multi-threaded-code-.patch new file mode 100644 index 0000000..93ce632 --- /dev/null +++ b/packaging/0025-linux-user-Run-multi-threaded-code-.patch @@ -0,0 +1,40 @@ +From 04335a4529058c0a9a5821807291ef731716d222 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 10 Jul 2012 20:40:55 +0200 +Subject: [PATCH] linux-user: Run multi-threaded code on a single core + +Running multi-threaded code can easily expose some of the fundamental +breakages in QEMU's design. It's just not a well supported scenario. + +So if we pin the whole process to a single host CPU, we guarantee that +we will never have concurrent memory access actually happen. We can still +get scheduled away at any time, so it's no complete guarantee, but apparently +it reduces the odds well enough to get my test cases to pass. + +This gets Java 1.7 working for me again on my test box. + +Signed-off-by: Alexander Graf +--- + linux-user/syscall.c | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index ed87c54..9f689da 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -4352,6 +4352,15 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, + if (nptl_flags & CLONE_SETTLS) + cpu_set_tls (new_env, newtls); + ++ /* agraf: Pin ourselves to a single CPU when running multi-threaded. ++ This turned out to improve stability for me. */ ++ { ++ cpu_set_t mask; ++ CPU_ZERO(&mask); ++ CPU_SET(0, &mask); ++ sched_setaffinity(0, sizeof(mask), &mask); ++ } ++ + /* Grab a mutex so that thread setup appears atomic. */ + pthread_mutex_lock(&clone_lock); + diff --git a/packaging/0026-linux-user-lock-tb-flushing-too.pat.patch b/packaging/0026-linux-user-lock-tb-flushing-too.pat.patch new file mode 100644 index 0000000..0e8ee3c --- /dev/null +++ b/packaging/0026-linux-user-lock-tb-flushing-too.pat.patch @@ -0,0 +1,125 @@ +From 65070d242a976097ec3b3b7ee788a1d36fab9c79 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Wed, 11 Jul 2012 16:47:42 +0200 +Subject: [PATCH] linux-user: lock tb flushing too + +Signed-off-by: Alexander Graf +--- + exec.c | 33 ++++++++++++++++++++++++++------- + 1 files changed, 26 insertions(+), 7 deletions(-) + +diff --git a/exec.c b/exec.c +index baa495f..aae9462 100644 +--- a/exec.c ++++ b/exec.c +@@ -722,17 +722,22 @@ static TranslationBlock *tb_alloc(target_ulong pc) + { + TranslationBlock *tb; + ++ tcg_lock(); + if (nb_tbs >= code_gen_max_blocks || +- (code_gen_ptr - code_gen_buffer) >= code_gen_buffer_max_size) ++ (code_gen_ptr - code_gen_buffer) >= code_gen_buffer_max_size) { ++ tcg_unlock(); + return NULL; ++ } + tb = &tbs[nb_tbs++]; + tb->pc = pc; + tb->cflags = 0; ++ tcg_unlock(); + return tb; + } + + void tb_free(TranslationBlock *tb) + { ++ tcg_lock(); + /* In practice this is mostly used for single use temporary TB + Ignore the hard cases and just back up if this TB happens to + be the last one generated. */ +@@ -740,6 +745,7 @@ void tb_free(TranslationBlock *tb) + code_gen_ptr = tb->tc_ptr; + nb_tbs--; + } ++ tcg_unlock(); + } + + static inline void invalidate_page_bitmap(PageDesc *p) +@@ -793,6 +799,7 @@ void tb_flush(CPUArchState *env1) + nb_tbs, nb_tbs > 0 ? + ((unsigned long)(code_gen_ptr - code_gen_buffer)) / nb_tbs : 0); + #endif ++ tcg_lock(); + if ((unsigned long)(code_gen_ptr - code_gen_buffer) > code_gen_buffer_size) + cpu_abort(env1, "Internal error: code buffer overflow\n"); + +@@ -809,6 +816,7 @@ void tb_flush(CPUArchState *env1) + /* XXX: flush processor icache at this point if cache flush is + expensive */ + tb_flush_count++; ++ tcg_unlock(); + } + + #ifdef DEBUG_TB_CHECK +@@ -1108,9 +1116,12 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end, + int current_flags = 0; + #endif /* TARGET_HAS_PRECISE_SMC */ + ++ tcg_lock(); + p = page_find(start >> TARGET_PAGE_BITS); +- if (!p) ++ if (!p) { ++ tcg_unlock(); + return; ++ } + if (!p->code_bitmap && + ++p->code_write_count >= SMC_BITMAP_USE_THRESHOLD && + is_cpu_write_access) { +@@ -1194,6 +1205,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end, + cpu_resume_from_signal(env, NULL); + } + #endif ++ tcg_unlock(); + } + + /* len must be <= 8 and start must be a multiple of len */ +@@ -1389,12 +1401,16 @@ TranslationBlock *tb_find_pc(uintptr_t tc_ptr) + { + int m_min, m_max, m; + uintptr_t v; +- TranslationBlock *tb; ++ TranslationBlock *tb, *r; + +- if (nb_tbs <= 0) ++ tcg_lock(); ++ if (nb_tbs <= 0) { ++ tcg_unlock(); + return NULL; ++ } + if (tc_ptr < (uintptr_t)code_gen_buffer || + tc_ptr >= (uintptr_t)code_gen_ptr) { ++ tcg_unlock(); + return NULL; + } + /* binary search (cf Knuth) */ +@@ -1404,15 +1420,18 @@ TranslationBlock *tb_find_pc(uintptr_t tc_ptr) + m = (m_min + m_max) >> 1; + tb = &tbs[m]; + v = (uintptr_t)tb->tc_ptr; +- if (v == tc_ptr) ++ if (v == tc_ptr) { ++ tcg_unlock(); + return tb; +- else if (tc_ptr < v) { ++ } else if (tc_ptr < v) { + m_max = m - 1; + } else { + m_min = m + 1; + } + } +- return &tbs[m_max]; ++ r = &tbs[m_max]; ++ tcg_unlock(); ++ return r; + } + + static void tb_reset_jump_recursive(TranslationBlock *tb); diff --git a/packaging/0027-linux-user-Fake-proc-cpuinfo.patch.patch b/packaging/0027-linux-user-Fake-proc-cpuinfo.patch.patch new file mode 100644 index 0000000..f8c5815 --- /dev/null +++ b/packaging/0027-linux-user-Fake-proc-cpuinfo.patch.patch @@ -0,0 +1,56 @@ +From 509cbfc6fe50080a4ee8751596c54ef28af923da Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Mon, 23 Jul 2012 10:24:14 +0200 +Subject: [PATCH] linux-user: Fake /proc/cpuinfo + +Fedora 17 for ARM reads /proc/cpuinfo and fails if it doesn't contain +ARM related contents. This patch implements a quick hack to expose real +/proc/cpuinfo data taken from a real world machine. + +The real fix would be to generate at least the flags automatically based +on the selected CPU. Please do not submit this patch upstream until this +has happened. + +Signed-off-by: Alexander Graf +--- + linux-user/syscall.c | 20 ++++++++++++++++++++ + 1 files changed, 20 insertions(+), 0 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 9f689da..fc27851 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -5035,6 +5035,25 @@ static int open_self_stat(void *cpu_env, int fd) + return 0; + } + ++static int open_cpuinfo(void *cpu_env, int fd) ++{ ++ dprintf(fd, ++"Processor : ARMv7 Processor rev 5 (v7l)\n" ++"BogoMIPS : 799.53\n" ++"Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3\n" ++"CPU implementer : 0x41\n" ++"CPU architecture: 7\n" ++"CPU variant : 0x2\n" ++"CPU part : 0xc08\n" ++"CPU revision : 5\n" ++"\n" ++"Hardware : Genesi Efika MX (Smarttop)\n" ++"Revision : 51030\n" ++"Serial : 0000000000000000\n"); ++ ++ return 0; ++} ++ + static int open_self_auxv(void *cpu_env, int fd) + { + TaskState *ts = ((CPUArchState *)cpu_env)->opaque; +@@ -5075,6 +5094,7 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode) + { "/proc/self/maps", open_self_maps }, + { "/proc/self/stat", open_self_stat }, + { "/proc/self/auxv", open_self_auxv }, ++ { "/proc/cpuinfo", open_cpuinfo }, + { NULL, NULL } + }; + diff --git a/packaging/0028-linux-user-implement-FS_IOC_GETFLAG.patch b/packaging/0028-linux-user-implement-FS_IOC_GETFLAG.patch new file mode 100644 index 0000000..ac5ecb0 --- /dev/null +++ b/packaging/0028-linux-user-implement-FS_IOC_GETFLAG.patch @@ -0,0 +1,36 @@ +From e77d8fc983222a9dec1394d864caf79f386b119a Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Mon, 20 Aug 2012 00:02:52 +0200 +Subject: [PATCH] linux-user: implement FS_IOC_GETFLAGS ioctl + +Signed-off-by: Alexander Graf +--- + linux-user/ioctls.h | 1 + + linux-user/syscall_defs.h | 2 ++ + 2 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h +index bb76c56..1b798b3 100644 +--- a/linux-user/ioctls.h ++++ b/linux-user/ioctls.h +@@ -86,6 +86,7 @@ + IOCTL_SPECIAL(FS_IOC_FIEMAP, IOC_W | IOC_R, do_ioctl_fs_ioc_fiemap, + MK_PTR(MK_STRUCT(STRUCT_fiemap))) + #endif ++ IOCTL(FS_IOC_GETFLAGS, IOC_R, MK_PTR(TYPE_INT)) + + IOCTL(SIOCATMARK, 0, TYPE_NULL) + IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry))) +diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h +index d708131..15b171f 100644 +--- a/linux-user/syscall_defs.h ++++ b/linux-user/syscall_defs.h +@@ -2344,6 +2344,8 @@ struct target_eabi_flock64 { + #define TARGET_MTIOCGET TARGET_IOR('m', 2, struct mtget) + #define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos) + ++#define TARGET_FS_IOC_GETFLAGS TARGET_IORU('f', 1) ++ + struct target_sysinfo { + abi_long uptime; /* Seconds since boot */ + abi_ulong loads[3]; /* 1, 5, and 15 minute load averages */ diff --git a/packaging/0029-linux-user-implement-FS_IOC_SETFLAG.patch b/packaging/0029-linux-user-implement-FS_IOC_SETFLAG.patch new file mode 100644 index 0000000..a5eef2b --- /dev/null +++ b/packaging/0029-linux-user-implement-FS_IOC_SETFLAG.patch @@ -0,0 +1,35 @@ +From 43841edd5e2c1bfba458b38aa2c9c47b7c9c958b Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Mon, 20 Aug 2012 00:07:13 +0200 +Subject: [PATCH] linux-user: implement FS_IOC_SETFLAGS ioctl + +Signed-off-by: Alexander Graf +--- + linux-user/ioctls.h | 1 + + linux-user/syscall_defs.h | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h +index 1b798b3..5027c74 100644 +--- a/linux-user/ioctls.h ++++ b/linux-user/ioctls.h +@@ -87,6 +87,7 @@ + MK_PTR(MK_STRUCT(STRUCT_fiemap))) + #endif + IOCTL(FS_IOC_GETFLAGS, IOC_R, MK_PTR(TYPE_INT)) ++ IOCTL(FS_IOC_SETFLAGS, IOC_W, MK_PTR(TYPE_INT)) + + IOCTL(SIOCATMARK, 0, TYPE_NULL) + IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry))) +diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h +index 15b171f..d618414 100644 +--- a/linux-user/syscall_defs.h ++++ b/linux-user/syscall_defs.h +@@ -2345,6 +2345,7 @@ struct target_eabi_flock64 { + #define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos) + + #define TARGET_FS_IOC_GETFLAGS TARGET_IORU('f', 1) ++#define TARGET_FS_IOC_SETFLAGS TARGET_IOWU('f', 2) + + struct target_sysinfo { + abi_long uptime; /* Seconds since boot */ diff --git a/packaging/0030-linux-user-fix-statfs.patch.patch b/packaging/0030-linux-user-fix-statfs.patch.patch new file mode 100644 index 0000000..c238a30 --- /dev/null +++ b/packaging/0030-linux-user-fix-statfs.patch.patch @@ -0,0 +1,48 @@ +From d26d1a74112810944a891ad905244b88aa8493f6 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 21 Aug 2012 11:16:06 +0200 +Subject: [PATCH] linux-user: fix statfs + +The statfs syscall should always memset(0) its full struct extent before +writing to it. Newer versions of the syscall use one of the reserved fields +for flags, which would otherwise get stale values from uncleaned memory. + +This fixes libarchive for me, which got confused about the return value of +pathconf("/", _PC_REC_XFER_ALIGN) otherwise, as it some times gave old pointers +as return value. + +Signed-off-by: Alexander Graf +--- + linux-user/syscall.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index fc27851..9ebc585 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -6667,6 +6667,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + __put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]); + __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); + __put_user(stfs.f_namelen, &target_stfs->f_namelen); ++ __put_user(stfs.f_frsize, &target_stfs->f_frsize); ++ __put_user(0, &target_stfs->f_spare[0]); ++ __put_user(0, &target_stfs->f_spare[1]); ++ __put_user(0, &target_stfs->f_spare[2]); ++ __put_user(0, &target_stfs->f_spare[3]); ++ __put_user(0, &target_stfs->f_spare[4]); + unlock_user_struct(target_stfs, arg2, 1); + } + break; +@@ -6695,6 +6701,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, + __put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]); + __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); + __put_user(stfs.f_namelen, &target_stfs->f_namelen); ++ __put_user(stfs.f_frsize, &target_stfs->f_frsize); ++ __put_user(0, &target_stfs->f_spare[0]); ++ __put_user(0, &target_stfs->f_spare[1]); ++ __put_user(0, &target_stfs->f_spare[2]); ++ __put_user(0, &target_stfs->f_spare[3]); ++ __put_user(0, &target_stfs->f_spare[4]); + unlock_user_struct(target_stfs, arg3, 1); + } + break; diff --git a/packaging/0031-linux-user-XXX-disable-fiemap.patch.patch b/packaging/0031-linux-user-XXX-disable-fiemap.patch.patch new file mode 100644 index 0000000..a8534ab --- /dev/null +++ b/packaging/0031-linux-user-XXX-disable-fiemap.patch.patch @@ -0,0 +1,26 @@ +From c01c98579c21974e3c5e983c0bc1426d6fdccdce Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 21 Aug 2012 14:20:40 +0200 +Subject: [PATCH] linux-user: XXX disable fiemap + +agraf: fiemap breaks in libarchive. Disable it for now. +--- + linux-user/syscall.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 9ebc585..f9e7f33 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -3252,6 +3252,11 @@ static abi_long do_ioctl_fs_ioc_fiemap(const IOCTLEntry *ie, uint8_t *buf_temp, + uint32_t outbufsz; + int free_fm = 0; + ++ if (1) { ++ /* XXX agraf: fiemap breaks for me */ ++ return -TARGET_EINVAL; ++ } ++ + assert(arg_type[0] == TYPE_PTR); + assert(ie->access == IOC_RW); + arg_type++; diff --git a/packaging/0032-slirp-nooutgoing.patch.patch b/packaging/0032-slirp-nooutgoing.patch.patch new file mode 100644 index 0000000..69c634f --- /dev/null +++ b/packaging/0032-slirp-nooutgoing.patch.patch @@ -0,0 +1,135 @@ +From 512ceb1779ce40a1f2a91fad147210bfa5996512 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20F=C3=A4rber?= +Date: Wed, 29 Aug 2012 18:42:56 +0200 +Subject: [PATCH] slirp: -nooutgoing + +TBD (from SUSE Studio team) +--- + qemu-options.hx | 10 ++++++++++ + slirp/socket.c | 8 ++++++++ + slirp/tcp_subr.c | 16 ++++++++++++++++ + vl.c | 9 +++++++++ + 4 files changed, 43 insertions(+), 0 deletions(-) + +diff --git a/qemu-options.hx b/qemu-options.hx +index af614bf..1368b2e 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -2328,6 +2328,16 @@ Store the QEMU process PID in @var{file}. It is useful if you launch QEMU + from a script. + ETEXI + ++DEF("nooutgoing", HAS_ARG, QEMU_OPTION_nooutgoing, \ ++ "-nooutgoing \n" \ ++ " incoming traffic only from IP, no outgoing\n", \ ++ QEMU_ARCH_ALL) ++STEXI ++@item -nooutgoing ++Forbid userspace networking to make outgoing connections. Only accept incoming ++connections from ip address IP. ++ETEXI ++ + DEF("singlestep", 0, QEMU_OPTION_singlestep, \ + "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) + STEXI +diff --git a/slirp/socket.c b/slirp/socket.c +index 77b0c98..94dcd9a 100644 +--- a/slirp/socket.c ++++ b/slirp/socket.c +@@ -531,6 +531,8 @@ sorecvfrom(struct socket *so) + } /* if ping packet */ + } + ++extern int slirp_nooutgoing; ++ + /* + * sendto() a socket + */ +@@ -561,6 +563,12 @@ sosendto(struct socket *so, struct mbuf *m) + + DEBUG_MISC((dfd, " sendto()ing, addr.sin_port=%d, addr.sin_addr.s_addr=%.16s\n", ntohs(addr.sin_port), inet_ntoa(addr.sin_addr))); + ++ /* Only allow DNS requests */ ++ if (slirp_nooutgoing && ntohs(addr.sin_port) != 53) { ++ errno = EHOSTUNREACH; ++ return -1; ++ } ++ + /* Don't care what port we get */ + ret = sendto(so->s, m->m_data, m->m_len, 0, + (struct sockaddr *)&addr, sizeof (struct sockaddr)); +diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c +index 025b374..dee23a0 100644 +--- a/slirp/tcp_subr.c ++++ b/slirp/tcp_subr.c +@@ -324,6 +324,9 @@ tcp_sockclosed(struct tcpcb *tp) + * nonblocking. Connect returns after the SYN is sent, and does + * not wait for ACK+SYN. + */ ++ ++extern int slirp_nooutgoing; ++ + int tcp_fconnect(struct socket *so) + { + Slirp *slirp = so->slirp; +@@ -332,6 +335,11 @@ int tcp_fconnect(struct socket *so) + DEBUG_CALL("tcp_fconnect"); + DEBUG_ARG("so = %lx", (long )so); + ++ if (slirp_nooutgoing) { ++ errno = EHOSTUNREACH; ++ return -1; ++ } ++ + if( (ret = so->s = qemu_socket(AF_INET,SOCK_STREAM,0)) >= 0) { + int opt, s=so->s; + struct sockaddr_in addr; +@@ -424,6 +432,13 @@ tcp_connect(struct socket *inso) + tcp_close(sototcpcb(so)); /* This will sofree() as well */ + return; + } ++ ++ if (slirp_nooutgoing && addr.sin_addr.s_addr != slirp_nooutgoing) { ++ tcp_close(sototcpcb(so)); /* This will sofree() as well */ ++ close(s); ++ return; ++ } ++ + socket_set_nonblock(s); + opt = 1; + setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)); +@@ -434,6 +449,7 @@ tcp_connect(struct socket *inso) + + so->so_fport = addr.sin_port; + so->so_faddr = addr.sin_addr; ++ + /* Translate connections from localhost to the real hostname */ + if (so->so_faddr.s_addr == 0 || + (so->so_faddr.s_addr & loopback_mask) == +diff --git a/vl.c b/vl.c +index fdf755f..153530b 100644 +--- a/vl.c ++++ b/vl.c +@@ -217,6 +217,7 @@ const char *vnc_display; + int acpi_enabled = 1; + int no_hpet = 0; + int fd_bootchk = 1; ++int slirp_nooutgoing = 0; + int no_reboot = 0; + int no_shutdown = 0; + int cursor_hide = 1; +@@ -2782,6 +2783,14 @@ int main(int argc, char **argv, char **envp) + case QEMU_OPTION_singlestep: + singlestep = 1; + break; ++ case QEMU_OPTION_nooutgoing: ++ slirp_nooutgoing = inet_addr(optarg); ++ if (slirp_nooutgoing == INADDR_NONE) { ++ printf("Invalid address: %s.\nOnly addresses of the format " ++ "xxx.xxx.xxx.xxx are supported.\n", optarg); ++ exit(1); ++ } ++ break; + case QEMU_OPTION_S: + autostart = 0; + break; diff --git a/packaging/0033-vnc-password-file-and-incoming-conn.patch b/packaging/0033-vnc-password-file-and-incoming-conn.patch new file mode 100644 index 0000000..9cd7494 --- /dev/null +++ b/packaging/0033-vnc-password-file-and-incoming-conn.patch @@ -0,0 +1,127 @@ +From 25c622437e7c59a99e35fe9318cb5ec11c7cff4a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20F=C3=A4rber?= +Date: Wed, 29 Aug 2012 20:06:01 +0200 +Subject: [PATCH] vnc: password-file= and incoming-connections= + +TBD (from SUSE Studio team) +--- + ui/vnc.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 71 insertions(+), 0 deletions(-) + +diff --git a/ui/vnc.c b/ui/vnc.c +index 385e345..df295a0 100644 +--- a/ui/vnc.c ++++ b/ui/vnc.c +@@ -45,6 +45,7 @@ static const struct timeval VNC_REFRESH_LOSSY = { 2, 0 }; + + static VncDisplay *vnc_display; /* needed for info vnc */ + static DisplayChangeListener *dcl; ++static int allowed_connections = 0; + + static int vnc_cursor_define(VncState *vs); + static void vnc_release_modifiers(VncState *vs); +@@ -1018,6 +1019,7 @@ static void vnc_disconnect_start(VncState *vs) + static void vnc_disconnect_finish(VncState *vs) + { + int i; ++ static int num_disconnects = 0; + + vnc_jobs_join(vs); /* Wait encoding jobs */ + +@@ -1063,6 +1065,13 @@ static void vnc_disconnect_finish(VncState *vs) + } + g_free(vs->lossy_rect); + g_free(vs); ++ ++ num_disconnects++; ++ if (allowed_connections > 0 && allowed_connections <= num_disconnects) { ++ VNC_DEBUG("Maximum number of disconnects (%d) reached:" ++ " Session terminating\n", allowed_connections); ++ exit(0); ++ } + } + + int vnc_client_io_error(VncState *vs, int ret, int last_errno) +@@ -2844,6 +2853,39 @@ char *vnc_display_local_addr(DisplayState *ds) + return vnc_socket_local_addr("%s:%s", vs->lsock); + } + ++static void read_file_password(DisplayState *ds, char *filename) ++{ ++ FILE *pfile = NULL; ++ char *passwd = NULL; ++ int start = 0, length = 0, rc = 0; ++ ++ if(strlen(filename) == 0) { ++ printf("No file supplied\n"); ++ return; ++ } ++ ++ pfile = fopen(filename, "r"); ++ if(pfile == NULL) { ++ printf("Could not read from %s\n", filename); ++ return; ++ } ++ ++ start = ftell(pfile); ++ fseek(pfile, 0L, SEEK_END); ++ length = ftell(pfile); ++ fseek(pfile, 0L, start); ++ ++ passwd = malloc(length+1); ++ rc = fread(passwd, 1, length, pfile); ++ fclose(pfile); ++ ++ if(rc == length && rc > 0) { ++ vnc_display_password(ds, passwd); ++ } ++ ++ free(passwd); ++} ++ + int vnc_display_open(DisplayState *ds, const char *display) + { + VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; +@@ -2876,6 +2918,9 @@ int vnc_display_open(DisplayState *ds, const char *display) + while ((options = strchr(options, ','))) { + options++; + if (strncmp(options, "password", 8) == 0) { ++ char *start, *end; ++ start = strchr(options, '='); ++ end = strchr(options, ','); + if (fips_get_state()) { + fprintf(stderr, + "VNC password auth disabled due to FIPS mode, " +@@ -2886,6 +2931,32 @@ int vnc_display_open(DisplayState *ds, const char *display) + return -1; + } + password = 1; /* Require password auth */ ++ if (start && (!end || (start < end))) { ++ int len = end ? end-(start+1) : strlen(start+1); ++ char *text = g_malloc(len+1); ++ strncpy(text, start+1, len); ++ text[len] = '\0'; ++ ++ if (strncmp(options, "password-file=", 14) == 0) { ++ read_file_password(ds, text); ++ } else { ++ vnc_display_password(ds, text); ++ } ++ ++ free(text); ++ } ++ } else if (strncmp(options, "allowed-connections=", 20) == 0) { ++ char *start, *end; ++ start = strchr(options, '='); ++ end = strchr(options, ','); ++ if (start && (!end || (start < end))) { ++ int len = end ? end-(start+1) : strlen(start+1); ++ char *text = g_malloc(len+1); ++ strncpy(text, start+1, len); ++ text[len] = '\0'; ++ VNC_DEBUG("Maximum number of disconnects: %s\n", text); ++ allowed_connections = atoi(text); ++ } + } else if (strncmp(options, "reverse", 7) == 0) { + reverse = 1; + } else if (strncmp(options, "no-lock-key-sync", 16) == 0) { diff --git a/packaging/bridge.conf b/packaging/bridge.conf new file mode 100644 index 0000000..d06c62a --- /dev/null +++ b/packaging/bridge.conf @@ -0,0 +1,11 @@ +# Access control file for qemu bridge helper +# Syntax consists of: +# # comment (ignored) +# allow all +# allow +# deny all +# deny +# include /path/to/additional/ACL/file +# Users are blacklisted by default and 'deny' takes precedence over 'allow'. +# Including additional ACL files allows file access permissions to be used as +# a component of the policy to allow access or deny access to specific bridges. diff --git a/packaging/qemu.spec b/packaging/qemu.spec new file mode 100644 index 0000000..2ca10ad --- /dev/null +++ b/packaging/qemu.spec @@ -0,0 +1,296 @@ +# +# spec file for package qemu +# +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: qemu +Version: 1.2.0 +Release: 0 +License: BSD-3-Clause ; GPL-2.0+ ; LGPL-2.1+ ; MIT +Summary: Universal CPU emulator +Url: http://www.qemu.org/ +Group: System/Emulators/PC +Source: %{name}-%{version}.tar.bz2 +Patch0001: 0001-Handle-CPU-interrupts-by-inline-che.patch +Patch0002: 0002-XXX-dont-dump-core-on-sigabort.patc.patch +Patch0003: 0003-XXX-work-around-SA_RESTART-race-wit.patch +Patch0004: 0004-qemu-0.9.0.cvs-binfmt.patch.patch +Patch0005: 0005-qemu-cvs-alsa_bitfield.patch.patch +Patch0006: 0006-qemu-cvs-alsa_ioctl.patch.patch +Patch0007: 0007-qemu-cvs-alsa_mmap.patch.patch +Patch0008: 0008-qemu-cvs-gettimeofday.patch.patch +Patch0009: 0009-qemu-cvs-ioctl_debug.patch.patch +Patch0010: 0010-qemu-cvs-ioctl_nodirection.patch.patch +Patch0011: 0011-block-vmdk-Support-creation-of-SCSI.patch +Patch0012: 0012-configure-Enable-mipsn32-linux-user.patch +Patch0013: 0013-linux-user-add-binfmt-wrapper-for-a.patch +Patch0014: 0014-linux-user-Ignore-timer_create-sysc.patch +Patch0015: 0015-linux-user-be-silent-about-capget-f.patch +Patch0016: 0016-PPC-KVM-Disable-mmu-notifier-check..patch +Patch0017: 0017-linux-user-fix-segfault-deadlock.pa.patch +Patch0018: 0018-linux-user-binfmt-support-host-bina.patch +Patch0019: 0019-linux-user-arm-no-tb_flush-on-reset.patch +Patch0020: 0020-linux-user-fix-multi-threaded-proc-.patch +Patch0021: 0021-use-libexecdir-instead-of-ignoring-.patch +Patch0022: 0022-linux-user-Ignore-broken-loop-ioctl.patch +Patch0023: 0023-linux-user-fix-segmentation-fault-p.patch +Patch0024: 0024-linux-user-lock-tcg.patch.patch +Patch0025: 0025-linux-user-Run-multi-threaded-code-.patch +Patch0026: 0026-linux-user-lock-tb-flushing-too.pat.patch +Patch0027: 0027-linux-user-Fake-proc-cpuinfo.patch.patch +Patch0028: 0028-linux-user-implement-FS_IOC_GETFLAG.patch +Patch0029: 0029-linux-user-implement-FS_IOC_SETFLAG.patch +Patch0030: 0030-linux-user-fix-statfs.patch.patch +Patch0031: 0031-linux-user-XXX-disable-fiemap.patch.patch +Patch0032: 0032-slirp-nooutgoing.patch.patch +Patch0033: 0033-vnc-password-file-and-incoming-conn.patch +# this is to make lint happy +Source300: rpmlintrc +Source302: bridge.conf +Source400: update_git.sh +#BuildRequires: SDL-devel +BuildRequires: bison +#BuildRequires: bluez-devel +BuildRequires: curl-devel +#BuildRequires: cyrus-sasl-devel +BuildRequires: e2fsprogs-devel +BuildRequires: gnutls-devel +#BuildRequires: libaio +#BuildRequires: libaio-devel +BuildRequires: libattr-devel +BuildRequires: libcap-devel +BuildRequires: libcap-ng-devel +BuildRequires: libjpeg8-devel +#BuildRequires: libpcap-devel +BuildRequires: libpng-devel +BuildRequires: ncurses-devel +BuildRoot: %{_tmppath}/%{name}-%{version}-build +# we must not install the qemu package when under qemu build +%if 0%{?qemu_user_space_build:1} +BuildRequires: -post-build-checks +%endif +BuildRequires: fdupes +BuildRequires: glibc-devel-static +BuildRequires: libattr-devel-static +BuildRequires: pcre-devel-static +#BuildRequires: libvdeplug3-devel +BuildRequires: pwdutils +BuildRequires: python-base +BuildRequires: zlib-devel-static +BuildRequires: pkgconfig(glib-2.0) +#BuildRequires: libfdt1-devel +BuildRequires: pkgconfig(glib-2.0)-static +Requires: /usr/sbin/groupadd +Requires: pwdutils +Requires: timezone + +%description +QEMU is an extremely well-performing CPU emulator that allows you to +choose between simulating an entire system and running userspace +binaries for different architectures under your native operating +system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well +as PC and PowerMac systems. + +%package tools +Summary: Universal CPU emulator -- Tools +Group: System/Emulators/PC +Provides: qemu:%{_libexecdir}/qemu-bridge-helper + +%description tools +QEMU is an extremely well-performing CPU emulator that allows you to +choose between simulating an entire system and running userspace +binaries for different architectures under your native operating +system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well +as PC and PowerMac systems. + +This sub-package contains various tools, including a bridge helper. + +%package guest-agent +Summary: Universal CPU emulator -- Guest agent +Group: System/Emulators/PC +Provides: qemu:%{_bindir}/qemu-ga + +%description guest-agent +QEMU is an extremely well-performing CPU emulator that allows you to +choose between simulating an entire system and running userspace +binaries for different architectures under your native operating +system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well +as PC and PowerMac systems. + +This sub-package contains the guest agent. + +%package linux-user +Summary: Universal CPU emulator -- Linux User binaries +Group: System/Emulators/PC +Provides: qemu:%{_bindir}/qemu-arm + +%description linux-user +QEMU is an extremely well-performing CPU emulator that allows you to +choose between simulating an entire system and running userspace +binaries for different architectures under your native operating +system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well +as PC and PowerMac systems. + +This sub-package contains statically linked binaries for running linux-user +emulations. This can be used together with the OBS build script to +run cross-architecture builds. + +%prep +%setup -q -n %{name}-%{version} +%patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 +%patch0005 -p1 +%patch0006 -p1 +%patch0007 -p1 +%patch0008 -p1 +%patch0009 -p1 +%patch0010 -p1 +%patch0011 -p1 +%patch0012 -p1 +%patch0013 -p1 +%patch0014 -p1 +%patch0015 -p1 +%patch0016 -p1 +%patch0017 -p1 +%patch0018 -p1 +%patch0019 -p1 +%patch0020 -p1 +%patch0021 -p1 +%patch0022 -p1 +%patch0023 -p1 +%patch0024 -p1 +%patch0025 -p1 +%patch0026 -p1 +%patch0027 -p1 +%patch0028 -p1 +%patch0029 -p1 +%patch0030 -p1 +%patch0031 -p1 +%patch0032 -p1 +%patch0033 -p1 + +%build +# build QEMU +mkdir -p dynamic +# build qemu-system +./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} \ + --libexecdir=%{_libexecdir} \ + --enable-curl \ + --enable-virtfs --disable-linux-aio \ + --extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user +make %{?_smp_mflags} V=1 +mv *-softmmu/qemu-system-* dynamic +mv qemu-io qemu-img qemu-nbd qemu-bridge-helper dynamic +#mv qemu-img.1 qemu-nbd.8 dynamic +mv qemu-ga dynamic +mv fsdev/virtfs-proxy-helper dynamic +make clean +# build userland emus +./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} \ + --libexecdir=%{_libexecdir} \ + --enable-linux-user \ + --disable-system \ + --static --disable-linux-aio \ + --extra-cflags="$QEMU_OPT_FLAGS" +make %{?_smp_mflags} V=1 + +%install +%make_install +rm -fr %{buildroot}/%{_datadir}/doc +install -m 755 dynamic/qemu-system-* %{buildroot}/%{_bindir} +install -m 755 dynamic/qemu-io %{buildroot}/%{_bindir} +install -m 755 dynamic/qemu-img %{buildroot}/%{_bindir} +install -m 755 dynamic/qemu-nbd %{buildroot}/%{_bindir} +install -m 755 dynamic/qemu-ga %{buildroot}/%{_bindir} +install -m 755 dynamic/virtfs-proxy-helper %{buildroot}/%{_bindir} +install -d -m 755 %{buildroot}/%{_sbindir} +install -m 755 scripts/qemu-binfmt-conf.sh %{buildroot}/%{_sbindir} +install -d -m 755 %{buildroot}/%{_libexecdir} +install -m 755 dynamic/qemu-bridge-helper %{buildroot}/%{_libexecdir} +install -d -m 755 %{buildroot}/%{_mandir}/man1 +install -D -m 644 %{SOURCE302} %{buildroot}/%{_sysconfdir}/qemu/bridge.conf +%ifnarch %ix86 x86_64 +ln -sf ../../../emul/ia32-linux %{buildroot}/usr/share/qemu/qemu-i386 +%endif +%ifnarch ia64 +mkdir -p %{buildroot}/emul/ia32-linux +%endif +%fdupes -s %{buildroot} + +%pre +%{_bindir}/getent group kvm >/dev/null || %{_sbindir}/groupadd -r kvm 2>/dev/null +%{_bindir}/getent group qemu >/dev/null || %{_sbindir}/groupadd -r qemu 2>/dev/null +%{_bindir}/getent passwd qemu >/dev/null || \ + %{_sbindir}/useradd -r -g qemu -G kvm -d / -s /sbin/nologin \ + -c "qemu user" qemu + +%files +%defattr(-, root, root) +%doc COPYING COPYING.LIB Changelog README TODO VERSION +%{_bindir}/qemu-system-* +%{_datadir}/%{name} +%ifnarch %ix86 x86_64 ia64 +%dir /emul/ia32-linux +%endif +%dir %{_sysconfdir}/%{name} +%config %{_sysconfdir}/%{name}/target-x86_64.conf + +%files tools +%defattr(-, root, root) +%{_bindir}/qemu-io +%{_bindir}/qemu-img +%{_bindir}/qemu-nbd +%{_bindir}/virtfs-proxy-helper +%verify(not mode) %{_libexecdir}/qemu-bridge-helper +%dir %{_sysconfdir}/%{name} +%config %{_sysconfdir}/%{name}/bridge.conf + +%files guest-agent +%defattr(-, root, root) +%attr(755,root,kvm) %{_bindir}/qemu-ga + +%files linux-user +%defattr(-, root, root) +%{_bindir}/qemu-alpha +%{_bindir}/qemu-arm +%{_bindir}/qemu-armeb +%{_bindir}/qemu-cris +%{_bindir}/qemu-i386 +%{_bindir}/qemu-m68k +%{_bindir}/qemu-microblaze +%{_bindir}/qemu-microblazeel +%{_bindir}/qemu-mips +%{_bindir}/qemu-mipsel +%{_bindir}/qemu-mipsn32 +%{_bindir}/qemu-mipsn32el +%{_bindir}/qemu-or32 +%{_bindir}/qemu-ppc64abi32 +%{_bindir}/qemu-ppc64 +%{_bindir}/qemu-ppc +%{_bindir}/qemu-s390x +%{_bindir}/qemu-sh4 +%{_bindir}/qemu-sh4eb +%{_bindir}/qemu-sparc32plus +%{_bindir}/qemu-sparc64 +%{_bindir}/qemu-sparc +%{_bindir}/qemu-unicore32 +%{_bindir}/qemu-x86_64 +%{_bindir}/qemu-*-binfmt +%{_sbindir}/qemu-binfmt-conf.sh + +%changelog -- 2.7.4