OBS User unknown 2007-11-13 20:32:02 +00:00 committed by Git OBS Bridge
parent eec0ab1f14
commit e87d1595d9
44 changed files with 999 additions and 5916 deletions

View File

@ -1,49 +0,0 @@
--- linux-user/syscall.c
+++ linux-user/syscall.c
@@ -2727,7 +2727,8 @@
case TARGET_NR_capset:
goto unimplemented;
case TARGET_NR_sigaltstack:
- goto unimplemented;
+ ret = 0; /* good enough for most purposes */
+ break;
case TARGET_NR_sendfile:
goto unimplemented;
#ifdef TARGET_NR_getpmsg
--- linux-user/signal.c
+++ linux-user/signal.c
@@ -1014,6 +1021,14 @@
return err;
}
+void* hack_stack;
+
+void hack_handler(int signum)
+{
+ fprintf(stderr,"QEMU: stack overflow, aborting\n");
+ exit(-SIGSEGV);
+}
+
static inline void *
get_sigframe(struct emulated_sigaction *ka, CPUState *regs, int framesize)
{
@@ -1026,6 +1041,19 @@
if ((ka->sa.sa_flags & SA_ONSTACK) && !sas_ss_flags(sp))
sp = current->sas_ss_sp + current->sas_ss_size;
#endif
+
+ /* EVIL HACK TIME!
+ This is supposed to prevent endless segfault loops in case of stack
+ overflows that can occur as a result of the dummy sigaltstack()
+ syscall. */
+ struct sigaction oldact;
+ struct sigaction act;
+ memset(&act,0,sizeof(struct sigaction));
+ act.sa_handler=hack_handler;
+ sigaction(SIGSEGV,&act,&oldact);
+ hack_stack = *((void**)((sp-framesize)&~7));
+ sigaction(SIGSEGV,&oldact,&act);
+
/*
* ATPCS B01 mandates 8-byte alignment
*/

View File

@ -1,6 +1,6 @@
--- linux-user/main.c
+++ linux-user/main.c
@@ -323,18 +323,54 @@
@@ -339,18 +339,54 @@
{
TaskState *ts = env->opaque;
uint32_t opcode;
@ -9,9 +9,9 @@
/* we handle the FPU emulation here, as Linux */
/* we get the opcode */
opcode = tget32(env->regs[15]);
- if (EmulateAll(opcode, &ts->fpa, env) == 0) {
+ if ((rc=EmulateAll(opcode, &ts->fpa, env)) == 0) { /* illegal instruction */
+ if ((rc=EmulateAll(opcode, &ts->fpa, env)) == 0) {
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN;

View File

@ -1,6 +1,6 @@
--- linux-user/signal.c
+++ linux-user/signal.c
@@ -341,10 +341,15 @@
@@ -364,10 +364,15 @@
k = &sigact_table[sig - 1];
handler = k->sa._sa_handler;
if (handler == TARGET_SIG_DFL) {
@ -9,8 +9,8 @@
+ return 0;
+ } else
/* default handler : ignore some signal. The other are fatal */
if (sig != TARGET_SIGCHLD &&
sig != TARGET_SIGURG &&
if (sig != TARGET_SIGCHLD &&
sig != TARGET_SIGURG &&
- sig != TARGET_SIGWINCH) {
+ sig != TARGET_SIGWINCH &&
+ sig != TARGET_SIGCONT) {

View File

@ -13,9 +13,10 @@
* gcc4 host support.
--- qemu-0.8.3/dyngen-exec.h.gcc4 2006-12-23 01:49:32.000000000 +0100
+++ qemu-0.8.3/dyngen-exec.h 2007-01-30 18:14:25.000000000 +0100
@@ -188,7 +188,12 @@ extern int printf(const char *, ...);
================================================================================
--- qemu/dyngen-exec.h
+++ qemu/dyngen-exec.h
@@ -194,7 +194,12 @@
#endif
/* force GCC to generate only one epilog at the end of the function */
@ -28,7 +29,7 @@
#ifndef OPPROTO
#define OPPROTO
@@ -238,9 +243,16 @@ extern int __op_jmp0, __op_jmp1, __op_jm
@@ -244,11 +249,18 @@
#endif
#if defined(__i386__)
@ -49,8 +50,10 @@
+#define GOTO_LABEL_PARAM(n) \
+ asm volatile ("cli;.long " ASM_NAME(__op_gen_label) #n " - 1f;1:")
#elif defined(__powerpc__)
--- qemu-0.8.3/dyngen.c.gcc4 2006-12-21 17:49:27.000000000 +0100
+++ qemu-0.8.3/dyngen.c 2007-01-30 18:11:21.000000000 +0100
#define EXIT_TB() asm volatile ("blr")
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
--- qemu/dyngen.c
+++ qemu/dyngen.c
@@ -32,6 +32,8 @@
#include "config-host.h"
@ -60,7 +63,7 @@
/* NOTE: we test CONFIG_WIN32 instead of _WIN32 to enabled cross
compilation */
#if defined(CONFIG_WIN32)
@@ -1414,6 +1416,644 @@ int arm_emit_ldr_info(const char *name,
@@ -1429,6 +1431,644 @@
#endif
@ -705,7 +708,7 @@
#define MAX_ARGS 3
/* generate op code */
@@ -1427,6 +2067,11 @@ void gen_code(const char *name, host_ulo
@@ -1442,6 +2082,11 @@
uint8_t args_present[MAX_ARGS];
const char *sym_name, *p;
EXE_RELOC *rel;
@ -717,7 +720,7 @@
/* Compute exact size excluding prologue and epilogue instructions.
* Increment start_offset to skip epilogue instructions, then compute
@@ -1437,33 +2082,12 @@ void gen_code(const char *name, host_ulo
@@ -1452,33 +2097,12 @@
p_end = p_start + size;
start_offset = offset;
#if defined(HOST_I386) || defined(HOST_X86_64)
@ -748,11 +751,11 @@
+ retpos = trace_i386_op(name, p_start, &len, &patch_bytes, exit_addrs);
copy_size = len;
}
-#endif
-#endif
#elif defined(HOST_PPC)
{
uint8_t *p;
@@ -1675,6 +2299,13 @@ void gen_code(const char *name, host_ulo
@@ -1710,6 +2334,13 @@
}
if (gen_switch == 2) {
@ -766,7 +769,7 @@
fprintf(outfile, "DEF(%s, %d, %d)\n", name + 3, nb_args, copy_size);
} else if (gen_switch == 1) {
@@ -1879,7 +2510,43 @@ void gen_code(const char *name, host_ulo
@@ -1915,7 +2546,43 @@
#error unsupport object format
#endif
}
@ -810,7 +813,7 @@
}
#elif defined(HOST_X86_64)
{
@@ -1913,6 +2580,42 @@ void gen_code(const char *name, host_ulo
@@ -1949,6 +2616,42 @@
}
}
}
@ -853,9 +856,9 @@
}
#elif defined(HOST_PPC)
{
--- qemu-0.8.3/exec-all.h.gcc4 2006-11-12 21:40:55.000000000 +0100
+++ qemu-0.8.3/exec-all.h 2007-01-30 18:11:21.000000000 +0100
@@ -326,14 +326,15 @@ do {\
--- qemu/exec-all.h
+++ qemu/exec-all.h
@@ -339,14 +339,15 @@
#elif defined(__i386__) && defined(USE_DIRECT_JUMP)
@ -873,9 +876,9 @@
"1:\n");\
} while (0)
--- qemu-0.8.3/target-i386/op.c~ 2007-02-17 17:12:48.000000000 +0100
+++ qemu-0.8.3/target-i386/op.c 2007-02-17 17:48:46.000000000 +0100
@@ -303,6 +303,7 @@
--- qemu/target-i386/op.c
+++ qemu/target-i386/op.c
@@ -290,6 +290,7 @@
EDX = (uint32_t)(res >> 32);
CC_DST = res;
CC_SRC = (res != (int32_t)res);
@ -883,7 +886,7 @@
}
void OPPROTO op_imulw_T0_T1(void)
@@ -312,6 +313,7 @@
@@ -299,6 +300,7 @@
T0 = res;
CC_DST = res;
CC_SRC = (res != (int16_t)res);
@ -891,7 +894,7 @@
}
void OPPROTO op_imull_T0_T1(void)
@@ -321,6 +323,7 @@
@@ -308,6 +310,7 @@
T0 = res;
CC_DST = res;
CC_SRC = (res != (int32_t)res);

View File

@ -1,20 +1,20 @@
--- usb-linux.c 2006-07-22 19:23:34.000000000 +0200
+++ usb-linux.c 2007-02-03 09:26:48.000000000 +0100
@@ -50,7 +50,7 @@
//#define DEBUG
--- usb-linux.c
+++ usb-linux.c
@@ -52,7 +52,7 @@
//#define DEBUG_ISOCH
//#define USE_ASYNCIO
-#define USBDEVFS_PATH "/proc/bus/usb"
+#define USBDEVFS_PATH "/dev/bus/usb"
#define PRODUCT_NAME_SZ 32
typedef struct USBHostDevice {
@@ -257,102 +257,96 @@
return (USBDevice *)dev;
#define SIG_ISOCOMPLETE (SIGRTMIN+7)
#define MAX_ENDPOINTS 16
@@ -707,102 +707,96 @@
return NULL;
}
-static int get_tag_value(char *buf, int buf_size,
- const char *str, const char *tag,
- const char *str, const char *tag,
- const char *stopchars)
-{
- const char *p;
@ -44,12 +44,13 @@
+ int bus_num, addr, speed, class_id, product_id, vendor_id;
int ret;
char product_name[512];
+ DIR* d;
+ struct dirent* de;
-
- f = fopen(USBDEVFS_PATH "/devices", "r");
- if (!f) {
- term_printf("Could not open %s\n", USBDEVFS_PATH "/devices");
+ DIR* d;
+ struct dirent* de;
+
+ d = opendir("/sys/bus/usb/devices");
+ if (!d) {
+ term_printf("Could not open /sys/bus/usb/devices\n");
@ -66,7 +67,7 @@
- if (line[0] == 'T' && line[1] == ':') {
- if (device_count && (vendor_id || product_id)) {
- /* New device. Add the previously discovered device. */
- ret = func(opaque, bus_num, addr, class_id, vendor_id,
- ret = func(opaque, bus_num, addr, class_id, vendor_id,
- product_id, product_name, speed);
- if (ret)
- goto the_end;
@ -173,16 +174,18 @@
- }
- if (device_count && (vendor_id || product_id)) {
- /* Add the last device. */
- ret = func(opaque, bus_num, addr, class_id, vendor_id,
- ret = func(opaque, bus_num, addr, class_id, vendor_id,
- product_id, product_name, speed);
- }
- the_end:
- fclose(f);
+ ret = func(opaque, bus_num, addr, class_id, vendor_id,
+ product_id, product_name, speed);
+ if (ret)
+ goto the_end;
+ }
}
the_end:
- fclose(f);
+ }
+ the_end:
+ closedir(d);
return ret;
}

View File

@ -1,8 +1,8 @@
Index: qemu-0.9.0/qemu-binfmt-conf.sh
===================================================================
--- qemu-0.9.0.orig/qemu-binfmt-conf.sh
+++ qemu-0.9.0/qemu-binfmt-conf.sh
@@ -12,7 +12,7 @@ fi
================================================================================
--- qemu/qemu-binfmt-conf.sh
+++ qemu/qemu-binfmt-conf.sh
@@ -12,7 +12,7 @@
# probe cpu type
cpu=`uname -m`
case "$cpu" in
@ -11,7 +11,7 @@ Index: qemu-0.9.0/qemu-binfmt-conf.sh
cpu="i386"
;;
m68k)
@@ -24,32 +24,34 @@ case "$cpu" in
@@ -24,36 +24,39 @@
"Power Macintosh"|ppc|ppc64)
cpu="ppc"
;;
@ -21,6 +21,7 @@ Index: qemu-0.9.0/qemu-binfmt-conf.sh
;;
+ sparc*)
+ cpu="sparc"
+ ;;
esac
# register the interpreter for each cpu except for the native one
@ -46,13 +47,21 @@ Index: qemu-0.9.0/qemu-binfmt-conf.sh
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\x04\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-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/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\x04\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-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

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b21915f6e941724eba05dce9b0f96295e4f7ff69b7ea0f743f5798c678b8839e
size 2043438
oid sha256:8892fead8e0caa1af63419e3376a784e56040e15d82e967e139f54c13ae22b49
size 2330234

View File

@ -1,36 +1,8 @@
Index: qemu/thunk.h
===================================================================
--- qemu.orig/thunk.h
+++ qemu/thunk.h
@@ -38,6 +38,7 @@ typedef enum argtype {
TYPE_PTR,
TYPE_ARRAY,
TYPE_STRUCT,
+ TYPE_INTBITFIELD,
} argtype;
#define MK_PTR(type) TYPE_PTR, type
@@ -87,6 +88,7 @@ static inline int thunk_type_size(const
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
@@ -124,6 +126,7 @@ static inline int thunk_type_align(const
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
Index: qemu/thunk.c
===================================================================
--- qemu.orig/thunk.c
================================================================================
--- qemu/thunk.c
+++ qemu/thunk.c
@@ -40,6 +40,7 @@ static inline const argtype *thunk_type_
@@ -40,6 +40,7 @@
case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
@ -38,7 +10,7 @@ Index: qemu/thunk.c
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
case TYPE_LONG:
@@ -132,6 +133,26 @@ const argtype *thunk_convert(void *dst,
@@ -132,6 +133,26 @@
case TYPE_INT:
*(uint32_t *)dst = tswap32(*(uint32_t *)src);
break;
@ -65,3 +37,29 @@ Index: qemu/thunk.c
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
*(uint64_t *)dst = tswap64(*(uint64_t *)src);
--- qemu/thunk.h
+++ qemu/thunk.h
@@ -38,6 +38,7 @@
TYPE_PTR,
TYPE_ARRAY,
TYPE_STRUCT,
+ TYPE_INTBITFIELD,
} argtype;
#define MK_PTR(type) TYPE_PTR, type
@@ -87,6 +88,7 @@
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
@@ -124,6 +126,7 @@
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:

View File

@ -1,6 +1,6 @@
Index: qemu/linux-user/ioctls.h
===================================================================
--- qemu.orig/linux-user/ioctls.h
================================================================================
--- qemu/linux-user/ioctls.h
+++ qemu/linux-user/ioctls.h
@@ -300,3 +300,8 @@
@ -11,9 +11,7 @@ Index: qemu/linux-user/ioctls.h
+#ifdef __powerpc__
+#include "ioctls_alsa.h"
+#endif
Index: qemu/linux-user/ioctls_alsa.h
===================================================================
--- /dev/null
--- qemu/linux-user/ioctls_alsa.h
+++ qemu/linux-user/ioctls_alsa.h
@@ -0,0 +1,467 @@
+#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
@ -483,9 +481,7 @@ Index: qemu/linux-user/ioctls_alsa.h
+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)) )
Index: qemu/linux-user/ioctls_alsa_structs.h
===================================================================
--- /dev/null
--- qemu/linux-user/ioctls_alsa_structs.h
+++ qemu/linux-user/ioctls_alsa_structs.h
@@ -0,0 +1,1740 @@
+/*
@ -2228,20 +2224,16 @@ Index: qemu/linux-user/ioctls_alsa_structs.h
+{
+ unsigned char *code;
+};
Index: qemu/linux-user/syscall_defs.h
===================================================================
--- qemu.orig/linux-user/syscall_defs.h
--- qemu/linux-user/syscall_defs.h
+++ qemu/linux-user/syscall_defs.h
@@ -1677,3 +1677,4 @@ struct target_sysinfo {
@@ -1875,3 +1875,4 @@
#include "socket.h"
#include "errno_defs.h"
+#include "ioctls_alsa_structs.h"
Index: qemu/linux-user/syscall_types.h
===================================================================
--- qemu.orig/linux-user/syscall_types.h
--- qemu/linux-user/syscall_types.h
+++ qemu/linux-user/syscall_types.h
@@ -79,3 +79,8 @@ STRUCT(count_info,
@@ -79,3 +79,8 @@
STRUCT(mixer_info,
MK_ARRAY(TYPE_CHAR, 16), MK_ARRAY(TYPE_CHAR, 32), TYPE_INT, MK_ARRAY(TYPE_INT, 10))
@ -2250,9 +2242,7 @@ Index: qemu/linux-user/syscall_types.h
+#ifdef __powerpc__
+#include "syscall_types_alsa.h"
+#endif
Index: qemu/linux-user/syscall_types_alsa.h
===================================================================
--- /dev/null
--- qemu/linux-user/syscall_types_alsa.h
+++ qemu/linux-user/syscall_types_alsa.h
@@ -0,0 +1,1337 @@
+/*

View File

@ -1,8 +1,8 @@
Index: qemu/linux-user/mmap.c
===================================================================
--- qemu.orig/linux-user/mmap.c
================================================================================
--- qemu/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -152,6 +152,9 @@ static int mmap_frag(target_ulong real_s
@@ -153,6 +153,9 @@
return 0;
}
@ -10,9 +10,9 @@ Index: qemu/linux-user/mmap.c
+#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000
+
/* NOTE: all the constants are the HOST ones */
long target_mmap(target_ulong start, target_ulong len, int prot,
int flags, int fd, target_ulong offset)
@@ -192,6 +195,17 @@ long target_mmap(target_ulong start, tar
abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
int flags, int fd, abi_ulong offset)
@@ -194,6 +197,17 @@
}
#endif

View File

@ -1,25 +0,0 @@
Index: qemu-0.9.0/hw/ide.c
===================================================================
--- qemu-0.9.0.orig/hw/ide.c
+++ qemu-0.9.0/hw/ide.c
@@ -586,7 +586,9 @@ static void ide_transfer_start(IDEState
s->end_transfer_func = end_transfer_func;
s->data_ptr = buf;
s->data_end = buf + size;
- s->status |= DRQ_STAT;
+ /* don't violate the HSM */
+ if (!(s->status & ERR_STAT))
+ s->status |= DRQ_STAT;
}
static void ide_transfer_stop(IDEState *s)
@@ -1805,6 +1807,7 @@ static void ide_ioport_write(void *opaqu
/* overlapping commands not supported */
if (s->feature & 0x02)
goto abort_cmd;
+ s->status = READY_STAT;
s->atapi_dma = s->feature & 1;
s->nsector = 1;
ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE,

View File

@ -1,20 +0,0 @@
Index: target-i386/helper.c
===================================================================
RCS file: /sources/qemu/qemu/target-i386/helper.c,v
retrieving revision 1.84
diff -u -r1.84 helper.c
--- target-i386/helper.c 26 Jun 2007 08:35:18 -0000 1.84
+++ target-i386/helper.c 8 Sep 2007 16:07:23 -0000
@@ -1657,10 +1657,10 @@
break;
case 2:
/* cache info: needed for Pentium Pro compatibility */
- EAX = 0x410601;
+ EAX = 1;
EBX = 0;
ECX = 0;
- EDX = 0;
+ EDX = 0x2c307d;
break;
case 0x80000000:
EAX = env->cpuid_xlevel;

View File

@ -1,26 +0,0 @@
Index: eepro100.c
===================================================================
RCS file: /sources/qemu/qemu/hw/eepro100.c,v
retrieving revision 1.3
diff -u -r1.3 eepro100.c
--- hw/eepro100.c 2 Jul 2007 13:38:46 -0000 1.3
+++ hw/eepro100.c 10 Sep 2007 08:38:51 -0000
@@ -140,6 +140,7 @@
SCBflash = 12, SCBeeprom = 14, /* EEPROM and flash memory control. */
SCBCtrlMDI = 16, /* MDI interface control. */
SCBEarlyRx = 20, /* Early receive byte count. */
+ SCBFlow = 24
};
/* A speedo3 transmit buffer descriptor with two buffers... */
@@ -1256,6 +1257,10 @@
eepro100_interrupt(s, 0);
break;
case SCBPort + 3:
+ case SCBFlow:
+ case SCBFlow + 1:
+ case SCBFlow + 2:
+ case SCBFlow + 3:
logout("addr=%s val=0x%02x\n", regname(addr), val);
break;
case SCBeeprom:

View File

@ -1,16 +0,0 @@
--- qemu-orig/hw/fdc.c Mon Aug 20 19:51:42 2007
+++ qemu/hw/fdc.c Tue Aug 28 15:46:31 2007
@@ -1843,5 +1843,13 @@
static void fdctrl_result_timer(void *opaque)
{
fdctrl_t *fdctrl = opaque;
+ fdrive_t *cur_drv = get_cur_drv(fdctrl);
+ /* Pretend we are spinning.
+ * This is needed for Coherent, which uses READ ID to check for
+ * sector interleaving.
+ */
+ if (cur_drv->last_sect != 0) {
+ cur_drv->sect = (cur_drv->sect % cur_drv->last_sect) + 1;
+ }
fdctrl_stop_transfer(fdctrl, 0x00, 0x00, 0x00);
}

View File

@ -1,8 +1,8 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1736,6 +1736,8 @@ static long do_ipc(long call, long first
@@ -1867,6 +1867,8 @@
switch (call) {
case IPCOP_semop:

View File

@ -1,7 +1,7 @@
Index: qemu.bkp/linux-user/syscall.c
===================================================================
--- qemu.bkp.orig/linux-user/syscall.c
+++ qemu.bkp/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -17,6 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@ -19,7 +19,7 @@ Index: qemu.bkp/linux-user/syscall.c
#include <linux/termios.h>
#include <linux/unistd.h>
#include <linux/utsname.h>
@@ -2554,6 +2557,91 @@ static inline void host_to_target_timesp
@@ -2715,6 +2718,91 @@
unlock_user_struct(target_ts, target_addr, 1);
}
@ -108,10 +108,10 @@ Index: qemu.bkp/linux-user/syscall.c
+ return retval;
+}
+
long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
long arg4, long arg5, long arg6)
{
@@ -4713,6 +4801,11 @@ long do_syscall(void *cpu_env, int num,
/* 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_<errcode>. */
@@ -5116,6 +5204,11 @@
}
#endif

View File

@ -1,8 +1,8 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -3596,6 +3596,7 @@ long do_syscall(void *cpu_env, int num,
@@ -3895,6 +3895,7 @@
case TARGET_NR_gettimeofday:
{
struct timeval tv;
@ -10,25 +10,3 @@ Index: qemu/linux-user/syscall.c
ret = get_errno(gettimeofday(&tv, NULL));
if (!is_error(ret)) {
host_to_target_timeval(arg1, &tv);
Index: qemu/linux-user/signal.c
===================================================================
--- qemu.orig/linux-user/signal.c
+++ qemu/linux-user/signal.c
@@ -207,6 +207,8 @@ static inline void host_to_target_siginf
/* should never come here, but who knows. The information for
the target is irrelevant */
tinfo->_sifields._sigfault._addr = 0;
+ } else if (sig == SIGIO) {
+ tinfo->_sifields._sigpoll._fd = info->si_fd;
} else if (sig >= TARGET_SIGRTMIN) {
tinfo->_sifields._rt._pid = info->si_pid;
tinfo->_sifields._rt._uid = info->si_uid;
@@ -228,6 +230,8 @@ static void tswap_siginfo(target_siginfo
sig == SIGBUS || sig == SIGTRAP) {
tinfo->_sifields._sigfault._addr =
tswapl(info->_sifields._sigfault._addr);
+ } else if (sig == SIGIO) {
+ tinfo->_sifields._sigpoll._fd = tswap32(info->_sifields._sigpoll._fd);
} else if (sig >= TARGET_SIGRTMIN) {
tinfo->_sifields._rt._pid = tswap32(info->_sifields._rt._pid);
tinfo->_sifields._rt._uid = tswap32(info->_sifields._rt._uid);

View File

@ -1,6 +1,6 @@
--- Makefile.target.~1.186.~ 2007-07-02 17:08:34.000000000 +0200
+++ Makefile.target 2007-07-09 19:13:35.000000000 +0200
@@ -92,6 +92,8 @@ cc-option = $(shell if $(CC) $(OP_CFLAGS
--- Makefile.target
+++ Makefile.target
@@ -111,6 +111,8 @@
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
@ -9,7 +9,7 @@
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
@@ -165,8 +167,9 @@ BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)
@@ -185,8 +187,9 @@
endif
ifeq ($(ARCH),ia64)
@ -21,8 +21,8 @@
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
--- target-alpha/op.c.~1.1.~ 2007-04-05 08:58:33.000000000 +0200
+++ target-alpha/op.c 2007-07-09 20:11:42.000000000 +0200
--- target-alpha/op.c
+++ target-alpha/op.c
@@ -18,8 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@ -31,8 +31,8 @@
-
#include "config.h"
#include "exec.h"
@@ -125,8 +123,12 @@
#include "host-utils.h"
@@ -126,8 +124,12 @@
void OPPROTO op_no_op (void)
{
#if !defined (DEBUG_OP)
@ -44,4 +44,4 @@
+#endif
RETURN();
}

View File

@ -1,29 +0,0 @@
diff -r 106bc46793ca hw/ide.c
--- a/hw/ide.c Mon Aug 27 16:20:33 2007 -0400
+++ b/hw/ide.c Mon Aug 27 16:27:28 2007 -0400
@@ -1914,6 +1914,8 @@ static void ide_ioport_write(void *opaqu
case 0x67: /* NOP */
case 0x96: /* NOP */
case 0x9a: /* NOP */
+ case 0x42: /* enable Automatic Acoustic Mode */
+ case 0xc2: /* disable Automatic Acoustic Mode */
s->status = READY_STAT | SEEK_STAT;
ide_set_irq(s);
break;
@@ -1952,12 +1954,16 @@ static void ide_ioport_write(void *opaqu
s->status = READY_STAT;
ide_set_irq(s);
break;
+ case WIN_STANDBY:
+ case WIN_STANDBY2:
case WIN_STANDBYNOW1:
case WIN_STANDBYNOW2:
case WIN_IDLEIMMEDIATE:
case CFA_IDLEIMMEDIATE:
case WIN_SETIDLE1:
case WIN_SETIDLE2:
+ case WIN_SLEEPNOW1:
+ case WIN_SLEEPNOW2:
s->status = READY_STAT;
ide_set_irq(s);
break;

View File

@ -1,121 +0,0 @@
Index: hw/ide.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ide.c,v
retrieving revision 1.65
diff -u -r1.65 ide.c
--- hw/ide.c 26 Aug 2007 17:42:20 -0000 1.65
+++ hw/ide.c 8 Sep 2007 16:05:27 -0000
@@ -261,6 +261,7 @@
* older drives only.
*/
#define GPCMD_GET_MEDIA_STATUS 0xda
+#define GPCMD_MODE_SENSE_6 0x1a
/* Mode page codes for mode sense/set */
#define GPMODE_R_W_ERROR_PAGE 0x01
@@ -1329,10 +1330,14 @@
ASC_MEDIUM_NOT_PRESENT);
}
break;
+ case GPCMD_MODE_SENSE_6:
case GPCMD_MODE_SENSE_10:
{
int action, code;
- max_len = ube16_to_cpu(packet + 7);
+ if (packet[0] == GPCMD_MODE_SENSE_10)
+ max_len = ube16_to_cpu(packet + 7);
+ else
+ max_len = packet[4];
action = packet[2] >> 6;
code = packet[2] & 0x3f;
switch(action) {
@@ -1368,7 +1373,7 @@
buf[8] = 0x2a;
buf[9] = 0x12;
- buf[10] = 0x00;
+ buf[10] = 0x08;
buf[11] = 0x00;
buf[12] = 0x70;
@@ -1582,6 +1587,50 @@
ide_atapi_cmd_reply(s, 8, 8);
}
break;
+ case GPCMD_READ_DVD_STRUCTURE:
+ {
+ int media = packet[1];
+ int layer = packet[6];
+ int format = packet[2];
+ int64_t total_sectors;
+
+ if (media != 0 || layer != 0)
+ {
+ ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
+ ASC_INV_FIELD_IN_CMD_PACKET);
+ }
+
+ switch (format) {
+ case 0:
+ bdrv_get_geometry(s->bs, &total_sectors);
+ total_sectors >>= 2;
+
+ memset(buf, 0, 2052);
+
+ buf[4] = 1; // DVD-ROM, part version 1
+ buf[5] = 0xf; // 120mm disc, maximum rate unspecified
+ buf[6] = 0; // one layer, embossed data
+ buf[7] = 0;
+
+ cpu_to_ube32(buf + 8, 0);
+ cpu_to_ube32(buf + 12, total_sectors - 1);
+ cpu_to_ube32(buf + 16, total_sectors - 1);
+
+ cpu_to_be16wu((uint16_t *)buf, 2048 + 4);
+
+ ide_atapi_cmd_reply(s, 2048 + 3, 2048 + 4);
+ break;
+
+ default:
+ ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
+ ASC_INV_FIELD_IN_CMD_PACKET);
+ break;
+ }
+ }
+ break;
+ case GPCMD_SET_SPEED:
+ ide_atapi_cmd_ok(s);
+ break;
case GPCMD_INQUIRY:
max_len = packet[4];
buf[0] = 0x05; /* CD-ROM */
@@ -1597,6 +1646,29 @@
padstr8(buf + 32, 4, QEMU_VERSION);
ide_atapi_cmd_reply(s, 36, max_len);
break;
+ case GPCMD_GET_CONFIGURATION:
+ {
+ int64_t total_sectors;
+
+ /* only feature 0 is supported */
+ if (packet[2] != 0 || packet[3] != 0) {
+ ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
+ ASC_INV_FIELD_IN_CMD_PACKET);
+ break;
+ }
+ memset(buf, 0, 32);
+ bdrv_get_geometry(s->bs, &total_sectors);
+ buf[3] = 16;
+ buf[7] = total_sectors <= 1433600 ? 0x08 : 0x10; /* current profile */
+ buf[10] = 0x10 | 0x1;
+ buf[11] = 0x08; /* size of profile list */
+ buf[13] = 0x10; /* DVD-ROM profile */
+ buf[14] = buf[7] == 0x10; /* (in)active */
+ buf[17] = 0x08; /* CD-ROM profile */
+ buf[18] = buf[7] == 0x08; /* (in)active */
+ ide_atapi_cmd_reply(s, 32, 32);
+ break;
+ }
default:
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
ASC_ILLEGAL_OPCODE);

View File

@ -1,11 +0,0 @@
--- Makefile.orig 2007-07-05 14:43:40.000000000 +0000
+++ Makefile 2007-07-05 14:46:50.000000000 +0000
@@ -33,7 +33,7 @@
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
qemu-img$(EXESUF): qemu-img.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c
- $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
+ $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
dyngen$(EXESUF): dyngen.c
$(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^

View File

@ -1,18 +1,18 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1950,7 +1950,12 @@ static long do_ioctl(long fd, long cmd,
@@ -2087,7 +2087,12 @@
ie = ioctl_entries;
for(;;) {
if (ie->target_cmd == 0) {
- gemu_log("Unsupported ioctl: cmd=0x%04lx\n", cmd);
- gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
+ int i;
+ gemu_log("Unsupported ioctl: cmd=0x%04lx (%x)\n", cmd, (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", ioctl_entries[i].host_cmd, ioctl_entries[i].name, (ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
+ }
return -ENOSYS;
return -TARGET_ENOSYS;
}
if (ie->target_cmd == cmd)

View File

@ -1,8 +1,8 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1980,6 +1980,11 @@ static long do_ioctl(long fd, long cmd,
@@ -2117,6 +2117,11 @@
arg_type++;
target_size = thunk_type_size(arg_type, 0);
switch(ie->access) {
@ -14,7 +14,7 @@ Index: qemu/linux-user/syscall.c
case IOC_R:
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
if (!is_error(ret)) {
@@ -1994,6 +1999,7 @@ static long do_ioctl(long fd, long cmd,
@@ -2131,6 +2136,7 @@
unlock_user(argptr, arg, 0);
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
break;

View File

@ -1,6 +1,6 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -29,7 +29,7 @@
#include <unistd.h>
@ -21,27 +21,27 @@ Index: qemu/linux-user/syscall.c
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/statfs.h>
@@ -150,6 +153,7 @@ type name (type1 arg1,type2 arg2,type3 a
#define __NR_sys_tgkill __NR_tgkill
@@ -164,6 +167,7 @@
#define __NR_sys_utimensat __NR_utimensat
#define __NR_sys_clone __NR_clone
#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
+#define __NR_sys_ipc __NR_ipc
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -172,6 +176,10 @@ _syscall3(int,sys_rt_sigqueueinfo,int,pi
_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
_syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
@@ -235,6 +239,10 @@
#ifdef __NR_sys_clone
_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
#endif
+#ifdef __NR_ipc
+_syscall6(int,sys_ipc, long, call, long, first, long, second, long, third, void *, ptr, long, fifth)
+#define semctl(a,b,c,d) sys_ipc(IPCOP_semctl,a,b,c,&d,0l)
+#endif
#ifdef __NR_sys_sched_getaffinity
_syscall3(int,sys_sched_getaffinity,pid_t,pid,unsigned int,cpusetsize,void*,mask)
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
@@ -1255,6 +1263,21 @@ struct target_ipc_perm
target_ulong __unused2;
#endif
@@ -1464,6 +1472,21 @@
abi_ulong __unused2;
};
+struct target_ipc64_perm
@ -62,8 +62,8 @@ Index: qemu/linux-user/syscall.c
struct target_semid_ds
{
struct target_ipc_perm sem_perm;
@@ -1267,6 +1290,18 @@ struct target_semid_ds
target_ulong __unused4;
@@ -1476,6 +1499,18 @@
abi_ulong __unused4;
};
+struct target_semid64_ds
@ -78,19 +78,19 @@ Index: qemu/linux-user/syscall.c
+ target_ulong __unused4;
+};
+
static inline void target_to_host_ipc_perm(struct ipc_perm *host_ip,
target_ulong target_addr)
static inline abi_long target_to_host_ipc_perm(struct ipc_perm *host_ip,
abi_ulong target_addr)
{
@@ -1301,6 +1336,41 @@ static inline void host_to_target_ipc_pe
unlock_user_struct(target_sd, target_addr, 1);
@@ -1514,6 +1549,43 @@
return 0;
}
+static inline void target_to_host_ipc64_perm( struct ipc64_perm *host_ip, target_ulong target_addr )
+static inline abi_long target_to_host_ipc64_perm( struct ipc64_perm *host_ip, target_ulong target_addr )
+{
+ struct target_ipc64_perm *target_ip;
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 1);
+ lock_user_struct(VERIFY_READ, target_sd, target_addr, 1);
+ target_ip=&(target_sd->sem_perm);
+ host_ip->key = tswapl(target_ip->key);
+ host_ip->uid = tswapl(target_ip->uid);
@ -100,15 +100,16 @@ Index: qemu/linux-user/syscall.c
+ host_ip->mode = tswap16(target_ip->mode);
+ host_ip->seq = tswap16(target_ip->seq);
+ unlock_user_struct(target_sd, target_addr, 1);
+ return 0;
+}
+
+static inline void host_to_target_ipc64_perm(target_ulong target_addr,
+static inline abi_long host_to_target_ipc64_perm(target_ulong target_addr,
+ struct ipc64_perm *host_ip)
+{
+ struct target_ipc64_perm *target_ip;
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 0);
+ lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0);
+ target_ip = &(target_sd->sem_perm);
+ target_ip->key = tswapl(host_ip->key);
+ target_ip->uid = tswapl(host_ip->uid);
@ -118,13 +119,14 @@ Index: qemu/linux-user/syscall.c
+ target_ip->mode = tswap16(host_ip->mode);
+ target_ip->seq = tswap16(host_ip->seq);
+ unlock_user_struct(target_sd, target_addr, 1);
+ return 0;
+}
+
static inline void target_to_host_semid_ds(struct semid_ds *host_sd,
target_ulong target_addr)
static inline abi_long target_to_host_semid_ds(struct semid_ds *host_sd,
abi_ulong target_addr)
{
@@ -1327,6 +1397,32 @@ static inline void host_to_target_semid_
unlock_user_struct(target_sd, target_addr, 1);
@@ -1544,6 +1616,32 @@
return 0;
}
+static inline void target_to_host_semid64_ds(struct semid64_ds *host_sd,
@ -132,7 +134,7 @@ Index: qemu/linux-user/syscall.c
+{
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 1);
+ lock_user_struct(VERIFY_READ, target_sd, target_addr, 1);
+ target_to_host_ipc64_perm(&(host_sd->sem_perm),target_addr);
+ host_sd->sem_nsems = tswapl(target_sd->sem_nsems);
+ host_sd->sem_otime = tswapl(target_sd->sem_otime);
@ -145,7 +147,7 @@ Index: qemu/linux-user/syscall.c
+{
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 0);
+ lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0);
+ host_to_target_ipc64_perm(target_addr,&(host_sd->sem_perm));
+ target_sd->sem_nsems = tswapl(host_sd->sem_nsems);
+ target_sd->sem_otime = tswapl(host_sd->sem_otime);
@ -156,7 +158,7 @@ Index: qemu/linux-user/syscall.c
union semun {
int val;
struct semid_ds *buf;
@@ -1339,6 +1435,10 @@ union target_semun {
@@ -1556,6 +1654,10 @@
unsigned short int *array;
};
@ -164,13 +166,13 @@ Index: qemu/linux-user/syscall.c
+#define IPC_64 0x100
+#endif
+
static inline void target_to_host_semun(unsigned long cmd,
union semun *host_su,
target_ulong target_addr,
@@ -1350,7 +1450,16 @@ static inline void target_to_host_semun(
case IPC_STAT:
static inline abi_long target_to_host_semun(int cmd,
union semun *host_su,
abi_ulong target_addr,
@@ -1568,7 +1670,15 @@
case IPC_SET:
lock_user_struct(target_su, target_addr, 1);
if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
return -TARGET_EFAULT;
- target_to_host_semid_ds(ds,target_su->buf);
+ target_to_host_semid_ds(ds,tswapl(target_su->buf));
+ host_su->buf = ds;
@ -178,40 +180,39 @@ Index: qemu/linux-user/syscall.c
+ break;
+ case IPC_STAT + IPC_64:
+ case IPC_SET + IPC_64:
+ lock_user_struct(target_su, target_addr, 1);
+
+ //target_to_host_semid_ds(ds,tswapl(target_su->buf));
+ target_to_host_semid64_ds((struct semid64_ds *)ds,tswapl(target_su->buf));
+ if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
+ return -TARGET_EFAULT;
+ target_to_host_semid64_ds((struct semid64_ds*)ds,tswapl(target_su->buf));
host_su->buf = ds;
unlock_user_struct(target_su, target_addr, 0);
break;
@@ -1382,7 +1491,14 @@ static inline void host_to_target_semun(
case IPC_STAT:
@@ -1604,7 +1714,14 @@
case IPC_SET:
lock_user_struct(target_su, target_addr, 0);
if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
return -TARGET_EFAULT;
- host_to_target_semid_ds(target_su->buf,ds);
+ host_to_target_semid_ds(tswapl(target_su->buf),ds);
+ unlock_user_struct(target_su, target_addr, 1);
+ break;
+ case IPC_STAT + IPC_64:
+ case IPC_SET + IPC_64:
+ lock_user_struct(target_su, target_addr, 0);
+ //host_to_target_semid_ds(tswapl(target_su->buf),ds);
+ host_to_target_semid64_ds(tswapl(target_su->buf),(struct semid64_ds *)ds);
+ if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
+ return -TARGET_EFAULT;
+ host_to_target_semid64_ds(tswapl(target_su->buf),(struct semid64_ds*)ds);
unlock_user_struct(target_su, target_addr, 1);
break;
case GETVAL:
@@ -1406,7 +1522,8 @@ static inline long do_semctl(long first,
@@ -1632,7 +1749,8 @@
{
union semun arg;
struct semid_ds dsarg;
- int cmd = third&0xff;
+ struct semid64_ds dsarg64;
+ int cmd = third; // & 0xff;
long ret = 0;
+ int cmd = third; // &0xff;
abi_long ret = 0;
switch( cmd ) {
@@ -1435,13 +1552,23 @@ static inline long do_semctl(long first,
@@ -1661,13 +1779,23 @@
ret = get_errno(semctl(first, second, cmd, arg));
host_to_target_semun(cmd,ptr,&arg,&dsarg);
break;
@ -236,11 +237,10 @@ Index: qemu/linux-user/syscall.c
}
return ret;
@@ -1465,6 +1592,42 @@ struct target_msqid_ds
target_ulong __unused5;
@@ -1691,6 +1819,41 @@
abi_ulong __unused5;
};
+
+struct target_shmid64_ds {
+ struct target_ipc64_perm shm_perm; /* operation perms */
+ target_ulong shm_segsz; /* size of segment (bytes) */
@ -276,10 +276,10 @@ Index: qemu/linux-user/syscall.c
+ unsigned long __unused6;
+ };
+
static inline void target_to_host_msqid_ds(struct msqid_ds *host_md,
target_ulong target_addr)
static inline abi_long target_to_host_msqid_ds(struct msqid_ds *host_md,
abi_ulong target_addr)
{
@@ -1665,11 +1828,59 @@ static long do_ipc(long call, long first
@@ -1919,11 +2082,59 @@
case IPCOP_shmctl:
switch(second) {
case IPC_RMID:
@ -297,7 +297,7 @@ Index: qemu/linux-user/syscall.c
+#ifdef DEBUG
+ gemu_log("qemu: doing IPC_STAT\n");
+#endif
+ lock_user_struct(target_buf, ptr, 1);
+ lock_user_struct(VERIFY_WRITE, target_buf, ptr, 1);
+ ret = get_errno(shmctl(first, second, (struct shmid_ds*)&buf));
+
+ host_to_target_ipc64_perm(ptr, &buf.shm_perm);
@ -318,7 +318,7 @@ Index: qemu/linux-user/syscall.c
+#ifdef DEBUG
+ gemu_log("qemu: doing IPC_SET\n");
+#endif
+ lock_user_struct(target_buf, ptr, 1);
+ lock_user_struct(VERIFY_READ, target_buf, ptr, 1);
+
+ target_to_host_ipc64_perm(&buf.shm_perm, ptr);
+ buf.shm_atime = tswapl(target_buf->shm_atime);

View File

@ -1,16 +1,16 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1573,9 +1732,19 @@ static long do_ipc(long call, long first
@@ -1983,9 +1983,19 @@
switch (call) {
case IPCOP_semop:
- ret = get_errno(semop(first,(struct sembuf *) ptr, second));
- ret = get_errno(semop(first,(struct sembuf *)g2h(ptr), second));
+ {
+ struct sembuf *target_sops;
+ int i;
+ lock_user_struct(target_sops, ptr, 0);
+ lock_user_struct(VERIFY_READ, target_sops, ptr, 0);
+ for(i=0; i<second; i++) {
+ target_sops[i].sem_num = tswap16(target_sops[i].sem_num);
+ target_sops[i].sem_op = tswap16(target_sops[i].sem_op);

View File

@ -1,6 +1,6 @@
Index: qemu/linux-user/mmap.c
===================================================================
--- qemu.orig/linux-user/mmap.c
================================================================================
--- qemu/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -27,6 +27,10 @@
@ -13,49 +13,39 @@ Index: qemu/linux-user/mmap.c
//#define DEBUG_MMAP
/* NOTE: all the constants are the HOST ones, but addresses are target. */
@@ -118,7 +122,7 @@ static int mmap_frag(target_ulong real_s
@@ -119,7 +123,7 @@
if (prot1 == 0) {
/* no page was there, so we allocate one */
ret = (long)mmap(host_start, qemu_host_page_size, prot,
- flags | MAP_ANONYMOUS, -1, 0);
+ flags | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
if (ret == -1)
return ret;
void *p = mmap(host_start, qemu_host_page_size, prot,
- flags | MAP_ANONYMOUS, -1, 0);
+ flags | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
if (p == MAP_FAILED)
return -1;
prot1 = prot;
@@ -219,7 +223,8 @@ long target_mmap(target_ulong start, tar
abort();
host_len = HOST_PAGE_ALIGN(len) + qemu_host_page_size - TARGET_PAGE_SIZE;
real_start = (long)mmap(g2h(real_start), host_len, PROT_NONE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT
+ , -1, 0);
if (real_start == -1)
return real_start;
real_end = real_start + host_len;
@@ -236,7 +241,7 @@ abort();
host_offset = offset & qemu_host_page_mask;
host_len = len + offset - host_offset;
host_start = (long)mmap(real_start ? g2h(real_start) : NULL,
@@ -251,7 +255,7 @@
host_len = HOST_PAGE_ALIGN(host_len + qemu_host_page_size
- qemu_real_host_page_size);
p = mmap(real_start ? g2h(real_start) : NULL,
- host_len, prot, flags, fd, host_offset);
+ host_len, prot, flags | MAP_32BIT, fd, host_offset);
if (p == MAP_FAILED)
return -1;
@@ -277,7 +281,7 @@
} else {
/* if not fixed, no need to do anything */
void *p = mmap(real_start ? g2h(real_start) : NULL,
- host_len, prot, flags, fd, host_offset);
+ host_len, prot, flags | MAP_32BIT, fd, host_offset);
if (host_start == -1)
return host_start;
if (p == MAP_FAILED)
return -1;
/* update start so that it points to the file position at 'offset' */
@@ -314,7 +319,7 @@ abort();
else
offset1 = offset + real_start - start;
ret = (long)mmap(g2h(real_start), real_end - real_start,
- prot, flags, fd, offset1);
+ prot, flags | MAP_32BIT, fd, offset1);
if (ret == -1)
return ret;
}
@@ -390,7 +395,7 @@ long target_mremap(target_ulong old_addr
int prot;
@@ -434,7 +438,7 @@
unsigned long host_addr;
/* XXX: use 5 args syscall */
- new_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
+ new_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
if (new_addr == -1)
return new_addr;
new_addr = h2g(new_addr);
- host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
+ host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
if (host_addr == -1)
return -1;
new_addr = h2g(host_addr);

View File

@ -1,8 +1,8 @@
Index: qemu/linux-user/mmap.c
===================================================================
--- qemu.orig/linux-user/mmap.c
================================================================================
--- qemu/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -48,8 +48,10 @@ int target_mprotect(target_ulong start,
@@ -49,8 +49,10 @@
end = start + len;
if (end < start)
return -EINVAL;
@ -14,4 +14,4 @@ Index: qemu/linux-user/mmap.c
+ }
if (len == 0)
return 0;

View File

@ -1,12 +0,0 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -898,6 +906,7 @@ static long do_socket(int domain, int ty
break;
}
#endif
+ if(domain == PF_NETLINK) return -EAFNOSUPPORT; /* do not make NETLINK socket connections possible */
return get_errno(socket(domain, type, protocol));
}

View File

@ -1,7 +1,7 @@
Index: qemu.bkp/linux-user/path.c
===================================================================
--- qemu.bkp.orig/linux-user/path.c
+++ qemu.bkp/linux-user/path.c
================================================================================
--- qemu/linux-user/path.c
+++ qemu/linux-user/path.c
@@ -1,159 +1,81 @@
/* Code to mangle pathnames into those matching a given prefix.
eg. open("/lib/foo.so") => open("/usr/gnemul/i386-linux/lib/foo.so");

View File

@ -1,9 +1,9 @@
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -5059,6 +5059,11 @@ long do_syscall(void *cpu_env, int num,
goto unimplemented_nowarn;
@@ -5491,6 +5491,11 @@
break;
#endif
+#ifdef TARGET_NR_fadvise64

View File

@ -1,13 +1,13 @@
Index: qemu-0.9.0/configure
===================================================================
--- qemu-0.9.0.orig/configure
+++ qemu-0.9.0/configure
@@ -473,7 +473,7 @@ fi
================================================================================
--- qemu/configure
+++ qemu/configure
@@ -506,7 +506,7 @@
if test -z "$target_list" ; then
# these targets are portable
if [ "$softmmu" = "yes" ] ; then
- target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc64-softmmu ppcemb-softmmu m68k-softmmu z80-softmmu"
+ target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc64-softmmu m68k-softmmu z80-softmmu"
- target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu cris-softmmu z80-softmmu"
+ target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu cris-softmmu z80-softmmu"
fi
# the following are Linux specific
if [ "$linux_user" = "yes" ] ; then

33
qemu-cvs-ppcspe.patch Normal file
View File

@ -0,0 +1,33 @@
--- target-ppc/op.c
+++ target-ppc/op.c
@@ -2720,6 +2720,7 @@
}
#endif /* !defined(CONFIG_USER_ONLY) */
+#if defined(TARGET_PPC64)
/* SPE extension */
void OPPROTO op_splatw_T1_64 (void)
{
@@ -3438,3 +3439,4 @@
T0 = _do_efdtsteq(T0_64, T1_64);
RETURN();
}
+#endif
--- target-ppc/translate.c
+++ target-ppc/translate.c
@@ -5853,6 +5853,7 @@
#endif /* !defined(TARGET_PPC64) */
+#if defined(TARGET_PPC64)
#define GEN_SPE(name0, name1, opc2, opc3, inval, type) \
GEN_HANDLER(name0##_##name1, 0x04, opc2, opc3, inval, type) \
{ \
@@ -6760,6 +6761,7 @@
GEN_SPE(efdctsiz, speundef, 0x1D, 0x0B, 0x00180000, PPC_SPEFPU); //
GEN_SPE(efdtstgt, efdtstlt, 0x1E, 0x0B, 0x00600000, PPC_SPEFPU); //
GEN_SPE(efdtsteq, speundef, 0x1F, 0x0B, 0x00600000, PPC_SPEFPU); //
+#endif
/* End opcode list */
GEN_OPCODE_MARK(end);

View File

@ -1,13 +1,13 @@
Index: qemu-0.9.0/Makefile
===================================================================
--- qemu-0.9.0.orig/Makefile
+++ qemu-0.9.0/Makefile
@@ -12,7 +12,7 @@ BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAG
BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
================================================================================
--- qemu/Makefile
+++ qemu/Makefile
@@ -13,7 +13,7 @@
CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP
CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-LIBS=
+LIBS=-lpthread
TOOLS=qemu-img$(EXESUF)
ifdef CONFIG_STATIC
BASE_LDFLAGS += -static
endif

View File

@ -1,134 +0,0 @@
diff -r 808c4b54209f block-raw.c
--- a/block-raw.c Fri Aug 10 16:30:38 2007 -0400
+++ b/block-raw.c Fri Aug 10 16:30:38 2007 -0400
@@ -59,6 +59,13 @@
//#define DEBUG_FLOPPY
+#undef DEBUG_BLOCK
+#ifdef DEBUG_BLOCK
+#define DEBUG_BLOCK_PRINT( formatCstr, args... ) fprintf( logfile, formatCstr, ##args ); fflush( logfile )
+#else
+#define DEBUG_BLOCK_PRINT( formatCstr, args... )
+#endif
+
#define FTYPE_FILE 0
#define FTYPE_CD 1
#define FTYPE_FD 2
@@ -70,6 +77,7 @@ typedef struct BDRVRawState {
typedef struct BDRVRawState {
int fd;
int type;
+ unsigned int lseek_err_cnt;
#if defined(__linux__)
/* linux floppy specific */
int fd_open_flags;
@@ -87,6 +95,8 @@ static int raw_open(BlockDriverState *bs
BDRVRawState *s = bs->opaque;
int fd, open_flags, ret;
+ s->lseek_err_cnt = 0;
+
open_flags = O_BINARY;
if ((flags & BDRV_O_ACCESS) == O_RDWR) {
open_flags |= O_RDWR;
@@ -137,8 +147,58 @@ static int raw_pread(BlockDriverState *b
if (ret < 0)
return ret;
- lseek(s->fd, offset, SEEK_SET);
+ if (lseek(s->fd, offset, SEEK_SET) == (off_t)-1) {
+ ++(s->lseek_err_cnt);
+ if(s->lseek_err_cnt <= 10) {
+ DEBUG_BLOCK_PRINT("raw_pread(%d:%s, %ld, %p, %d) [%ld] lseek failed : %d = %s\n",
+ s->fd,
+ bs->filename,
+ offset,
+ buf,
+ count,
+ bs->total_sectors, errno, strerror(errno) );
+ }
+ return -1;
+ }
+ s->lseek_err_cnt=0;
+
ret = read(s->fd, buf, count);
+ if (ret == count)
+ goto label__raw_read__success;
+
+ DEBUG_BLOCK_PRINT("raw_read(%d:%s, %ld, %p, %d) [%ld] read failed %d : %d = %s\n",
+ s->fd,
+ bs->filename,
+ offset,
+ buf,
+ count,
+ bs->total_sectors,
+ ret, errno, strerror(errno) );
+
+ if (bs->type == BDRV_TYPE_CDROM) { // Try harder for CDrom
+ lseek(s->fd, offset, SEEK_SET);
+ ret = read(s->fd, buf, count);
+ if (ret == count)
+ goto label__raw_read__success;
+ lseek(s->fd, offset, SEEK_SET);
+ ret = read(s->fd, buf, count);
+ if (ret == count)
+ goto label__raw_read__success;
+
+ DEBUG_BLOCK_PRINT("raw_read(%d:%s, %ld, %p, %d) [%ld] retry read failed %d : %d = %s\n",
+ s->fd,
+ bs->filename,
+ offset,
+ buf,
+ count,
+ bs->total_sectors,
+ ret, errno, strerror(errno) );
+ }
+
+ return -1;
+
+label__raw_read__success:
+
return ret;
}
@@ -152,8 +212,38 @@ static int raw_pwrite(BlockDriverState *
if (ret < 0)
return ret;
- lseek(s->fd, offset, SEEK_SET);
+ if (lseek(s->fd, offset, SEEK_SET) == (off_t)-1) {
+ ++(s->lseek_err_cnt);
+ if(s->lseek_err_cnt) {
+ DEBUG_BLOCK_PRINT("raw_write(%d:%s, %ld, %p, %d) [%ld] lseek failed : %d = %s\n",
+ s->fd,
+ bs->filename,
+ offset,
+ buf,
+ count,
+ bs->total_sectors, errno, strerror(errno) );
+ }
+ return -1;
+ }
+ s->lseek_err_cnt = 0;
+
ret = write(s->fd, buf, count);
+ if (ret == count)
+ goto label__raw_write__success;
+
+ DEBUG_BLOCK_PRINT("raw_write(%d:%s, %ld, %p, %d) [%ld] write failed %d : %d = %s\n",
+ s->fd,
+ bs->filename,
+ offset,
+ buf,
+ count,
+ bs->total_sectors,
+ ret, errno, strerror(errno) );
+
+ return -1;
+
+label__raw_write__success:
+
return ret;
}

View File

@ -1,32 +1,34 @@
Index: qemu.bkp/linux-user/syscall.c
===================================================================
--- qemu.bkp.orig/linux-user/syscall.c
+++ qemu.bkp/linux-user/syscall.c
@@ -149,6 +149,7 @@ type name (type1 arg1,type2 arg2,type3 a
#define __NR_sys_syslog __NR_syslog
#define __NR_sys_tgkill __NR_tgkill
================================================================================
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -163,6 +163,7 @@
#define __NR_sys_unlinkat __NR_unlinkat
#define __NR_sys_utimensat __NR_utimensat
#define __NR_sys_clone __NR_clone
+#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -171,6 +172,7 @@ _syscall3(int,sys_rt_sigqueueinfo,int,pi
_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
_syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
@@ -234,6 +235,9 @@
#ifdef __NR_sys_clone
_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
#endif
+#ifdef __NR_sys_sched_getaffinity
+_syscall3(int,sys_sched_getaffinity,pid_t,pid,unsigned int,cpusetsize,void*,mask)
+#endif
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -4823,6 +4825,17 @@ long do_syscall(void *cpu_env, int num,
goto unimplemented_nowarn;
@@ -5254,6 +5258,17 @@
break;
#endif
+#ifdef TARGET_NR_sched_getaffinity
+ case TARGET_NR_sched_getaffinity:
+ {
+ cpu_set_t *mask;
+ lock_user_struct(mask, arg3, 1);
+ lock_user_struct(VERIFY_READ, mask, arg3, 1);
+ ret = get_errno(sys_sched_getaffinity((pid_t)arg1, (unsigned int)arg2, mask));
+ unlock_user_struct(mask, arg3, 0);
+ break;

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
Index: qemu.bkp/linux-user/main.c
===================================================================
--- qemu.bkp.orig/linux-user/main.c
+++ qemu.bkp/linux-user/main.c
@@ -156,7 +156,7 @@ static void set_gate(void *ptr, unsigned
================================================================================
--- qemu/linux-user/main.c
+++ qemu/linux-user/main.c
@@ -156,7 +156,7 @@
p[1] = tswapl(e2);
}
@ -11,31 +11,31 @@ Index: qemu.bkp/linux-user/main.c
uint64_t idt_table[256];
/* only dpl matters as we do only user space emulation */
Index: qemu.bkp/linux-user/syscall.c
===================================================================
--- qemu.bkp.orig/linux-user/syscall.c
+++ qemu.bkp/linux-user/syscall.c
@@ -145,6 +145,7 @@ type name (type1 arg1,type2 arg2,type3 a
#define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
#define __NR_sys_syslog __NR_syslog
#define __NR_sys_tgkill __NR_tgkill
--- qemu/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -159,6 +159,7 @@
#define __NR_sys_tkill __NR_tkill
#define __NR_sys_unlinkat __NR_unlinkat
#define __NR_sys_utimensat __NR_utimensat
+#define __NR_sys_clone __NR_clone
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -166,6 +167,7 @@ _syscall5(int, _llseek, uint, fd, ulon
_syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)
_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
_syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
@@ -227,6 +228,9 @@
#if defined(TARGET_NR_tkill) && defined(__NR_tkill)
_syscall2(int,sys_tkill,int,tid,int,sig)
#endif
+#ifdef __NR_sys_clone
+_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
+#endif
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -2115,29 +2117,107 @@ int do_modify_ldt(CPUX86State *env, int
@@ -2249,6 +2253,80 @@
return ret;
}
+int do_set_thread_area(CPUX86State *env, target_ulong ptr)
+int do_set_thread_area(CPUX86State *env, abi_ulong ptr)
+{
+ uint64_t *gdt_table = g2h(env->gdt.base);
+ struct target_modify_ldt_ldt_s ldt_info;
@ -45,7 +45,7 @@ Index: qemu.bkp/linux-user/syscall.c
+ uint32_t *lp, entry_1, entry_2;
+ int i;
+
+ lock_user_struct(target_ldt_info, ptr, 1);
+ lock_user_struct(VERIFY_WRITE, target_ldt_info, ptr, 1);
+ ldt_info.entry_number = tswap32(target_ldt_info->entry_number);
+ ldt_info.base_addr = tswapl(target_ldt_info->base_addr);
+ ldt_info.limit = tswap32(target_ldt_info->limit);
@ -112,39 +112,29 @@ Index: qemu.bkp/linux-user/syscall.c
#endif /* defined(TARGET_I386) */
/* this stack is the equivalent of the kernel stack associated with a
thread/process */
#define NEW_STACK_SIZE 8192
@@ -2265,15 +2343,20 @@
-static int clone_func(void *arg)
+static int clone_func(void *cloneenv)
{
- CPUState *env = arg;
- cpu_loop(env);
+ cpu_loop((CPUState *)cloneenv);
/* never exits */
return 0;
}
-int do_fork(CPUState *env, unsigned int flags, unsigned long newsp)
+int do_fork(CPUState *env, unsigned int flags, target_ulong newsp, target_ulong parent_tidptr, target_ulong newtls, target_ulong child_tidptr)
/* do_fork() Must return host values and target errnos (unlike most
do_*() functions). */
-int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp)
+int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, abi_ulong parent_tidptr, abi_ulong newtls, abi_ulong child_tidptr)
{
int ret;
+ unsigned long parent_tid=gettid();
+ unsigned long parent_tid = gettid();
TaskState *ts;
uint8_t *new_stack;
CPUState *new_env;
-
+#if defined(TARGET_I386)
+ uint64_t *new_gdt_table;
+#endif
if (flags & CLONE_VM) {
ts = malloc(sizeof(TaskState) + NEW_STACK_SIZE);
+ if (!ts)
+ return -ENOMEM;
+ if (!ts) return -ENOMEM;
memset(ts, 0, sizeof(TaskState));
new_stack = ts->stack;
ts->used = 1;
@@ -2149,6 +2229,27 @@ int do_fork(CPUState *env, unsigned int
@@ -2285,6 +2368,27 @@
#if defined(TARGET_I386)
if (!newsp)
newsp = env->regs[R_ESP];
@ -172,7 +162,7 @@ Index: qemu.bkp/linux-user/syscall.c
new_env->regs[R_ESP] = newsp;
new_env->regs[R_EAX] = 0;
#elif defined(TARGET_ARM)
@@ -2202,15 +2303,27 @@ int do_fork(CPUState *env, unsigned int
@@ -2342,15 +2446,27 @@
#endif
new_env->opaque = ts;
#ifdef __ia64__
@ -205,7 +195,7 @@ Index: qemu.bkp/linux-user/syscall.c
}
return ret;
}
@@ -2458,7 +2571,7 @@ long do_syscall(void *cpu_env, int num,
@@ -2623,7 +2739,7 @@
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
@ -214,7 +204,7 @@ Index: qemu.bkp/linux-user/syscall.c
_exit(arg1);
ret = 0; /* avoid warning */
break;
@@ -2487,7 +2600,7 @@ long do_syscall(void *cpu_env, int num,
@@ -2671,7 +2787,7 @@
ret = do_brk(arg1);
break;
case TARGET_NR_fork:
@ -223,7 +213,7 @@ Index: qemu.bkp/linux-user/syscall.c
break;
#ifdef TARGET_NR_waitpid
case TARGET_NR_waitpid:
@@ -3651,7 +3764,7 @@ long do_syscall(void *cpu_env, int num,
@@ -4020,7 +4136,7 @@
ret = get_errno(fsync(arg1));
break;
case TARGET_NR_clone:
@ -232,7 +222,7 @@ Index: qemu.bkp/linux-user/syscall.c
break;
#ifdef __NR_exit_group
/* new thread calls */
@@ -4039,7 +4152,7 @@ long do_syscall(void *cpu_env, int num,
@@ -4419,7 +4535,7 @@
#endif
#ifdef TARGET_NR_vfork
case TARGET_NR_vfork:
@ -241,7 +231,7 @@ Index: qemu.bkp/linux-user/syscall.c
break;
#endif
#ifdef TARGET_NR_ugetrlimit
@@ -4561,12 +4674,12 @@ long do_syscall(void *cpu_env, int num,
@@ -4957,13 +5073,17 @@
#ifdef TARGET_NR_set_thread_area
case TARGET_NR_set_thread_area:
#ifdef TARGET_MIPS
@ -250,11 +240,16 @@ Index: qemu.bkp/linux-user/syscall.c
- break;
+ ((CPUMIPSState *) cpu_env)->tls_value = arg1;
+ ret = 0;
+#else
+#ifdef TARGET_I386
+ ret = get_errno(do_set_thread_area(cpu_env, arg1));
#else
- goto unimplemented_nowarn;
+ ret = get_errno(do_set_thread_area(cpu_env, arg1));
+ goto unimplemented_nowarn;
#endif
#endif
+ break;
#endif
+#endif
#ifdef TARGET_NR_get_thread_area
case TARGET_NR_get_thread_area:
goto unimplemented_nowarn;

View File

@ -1,660 +0,0 @@
diff --git a/qemu/usb-linux.c b/qemu/usb-linux.c
old mode 100644
new mode 100755
index 50386ea..e790f00
--- a/qemu/usb-linux.c
+++ b/qemu/usb-linux.c
@@ -28,6 +28,7 @@
#include <sys/ioctl.h>
#include <linux/usbdevice_fs.h>
#include <linux/version.h>
+#include <signal.h>
/* We redefine it to avoid version problems */
struct usb_ctrltransfer {
@@ -48,15 +49,152 @@ static int usb_host_find_device(int *pbus_num, int *paddr,
const char *devname);
//#define DEBUG
+//#define DEBUG_ISOCH
+//#define USE_ASYNCIO
#define USBDEVFS_PATH "/dev/bus/usb"
#define PRODUCT_NAME_SZ 32
+#define SIG_ISOCOMPLETE (SIGRTMIN+7)
+#define MAX_ENDPOINTS 16
+
+struct sigaction sigact;
+
+// endpoint association data
+struct endp_data {
+ uint8_t type;
+};
typedef struct USBHostDevice {
USBDevice dev;
int fd;
+ struct usbdevfs_urb *urb;
+ USBPacket *packet;
+ QEMUBH *bh;
+ int status;
+ struct endp_data endp_table[MAX_ENDPOINTS];
+ int configuration;
+ uint8_t descr[1024];
+ int descr_len;
} USBHostDevice;
+typedef struct PendingURB {
+ struct usbdevfs_urb *urb;
+ struct PendingURB *next;
+} PendingURB;
+
+PendingURB *pending_urbs = NULL;
+
+int add_pending_urb(struct usbdevfs_urb *urb)
+{
+ PendingURB *purb = qemu_mallocz(sizeof(PendingURB));
+ if (purb) {
+ purb->urb = urb;
+ purb->next = pending_urbs;
+ pending_urbs = purb;
+ return 1;
+ }
+ return 0;
+}
+
+int del_pending_urb(struct usbdevfs_urb *urb)
+{
+ PendingURB *purb = pending_urbs;
+ PendingURB *prev = NULL;
+
+ while (purb && purb->urb != urb) {
+ prev = purb;
+ purb = purb->next;
+ }
+
+ if (purb && purb->urb == urb) {
+ if (prev) {
+ prev->next = purb->next;
+ } else {
+ pending_urbs = purb->next;
+ }
+ qemu_free(purb);
+ return 1;
+ }
+ return 0;
+}
+
+static int usb_host_update_interfaces(USBHostDevice *dev, int configuration)
+{
+ int dev_descr_len, config_descr_len;
+ int interface, nb_interfaces, nb_configurations;
+ int ret, i;
+
+ if (configuration == 0) // address state - ignore
+ return 1;
+
+ i = 0;
+ dev_descr_len = dev->descr[0];
+ if (dev_descr_len > dev->descr_len)
+ goto fail;
+ nb_configurations = dev->descr[17];
+
+ i += dev_descr_len;
+ while (i < dev->descr_len) {
+#ifdef DEBUG
+ printf("i is %d, descr_len is %d, dl %d, dt %d\n", i, dev->descr_len,
+ dev->descr[i], dev->descr[i+1]);
+#endif
+ if (dev->descr[i+1] != USB_DT_CONFIG) {
+ i += dev->descr[i];
+ continue;
+ }
+ config_descr_len = dev->descr[i];
+
+ if (configuration == dev->descr[i + 5])
+ break;
+
+ i += config_descr_len;
+ }
+
+ if (i >= dev->descr_len) {
+ printf("usb_host: error - device has no matching configuration\n");
+ goto fail;
+ }
+ nb_interfaces = dev->descr[i + 4];
+
+#ifdef USBDEVFS_DISCONNECT
+ /* earlier Linux 2.4 do not support that */
+ {
+ struct usbdevfs_ioctl ctrl;
+ for (interface = 0; interface < nb_interfaces; interface++) {
+ ctrl.ioctl_code = USBDEVFS_DISCONNECT;
+ ctrl.ifno = interface;
+ ret = ioctl(dev->fd, USBDEVFS_IOCTL, &ctrl);
+ if (ret < 0 && errno != ENODATA) {
+ perror("USBDEVFS_DISCONNECT");
+ goto fail;
+ }
+ }
+ }
+#endif
+
+ /* XXX: only grab if all interfaces are free */
+ for (interface = 0; interface < nb_interfaces; interface++) {
+ ret = ioctl(dev->fd, USBDEVFS_CLAIMINTERFACE, &interface);
+ if (ret < 0) {
+ if (errno == EBUSY) {
+ fprintf(stderr, "usb_host: warning - device already grabbed\n");
+ } else {
+ perror("USBDEVFS_CLAIMINTERFACE");
+ }
+ fail:
+ return 0;
+ }
+ }
+
+#ifdef DEBUG
+ printf("usb_host: %d interfaces claimed for configuration %d\n", nb_interfaces,
+ configuration);
+#endif
+
+ return 1;
+}
+
static void usb_host_handle_reset(USBDevice *dev)
{
#if 0
@@ -76,6 +214,8 @@ static void usb_host_handle_destroy(USBDevice *dev)
qemu_free(s);
}
+static int usb_linux_update_endp_table(USBHostDevice *s);
+
static int usb_host_handle_control(USBDevice *dev,
int request,
int value,
@@ -85,13 +225,32 @@ static int usb_host_handle_control(USBDevice *dev,
{
USBHostDevice *s = (USBHostDevice *)dev;
struct usb_ctrltransfer ct;
+ struct usbdevfs_setinterface si;
+ int intf_update_required = 0;
int ret;
if (request == (DeviceOutRequest | USB_REQ_SET_ADDRESS)) {
/* specific SET_ADDRESS support */
dev->addr = value;
return 0;
+ } else if (request == ((USB_RECIP_INTERFACE << 8) | USB_REQ_SET_INTERFACE)) {
+ /* set alternate setting for the interface */
+ si.interface = index;
+ si.altsetting = value;
+ ret = ioctl(s->fd, USBDEVFS_SETINTERFACE, &si);
+ usb_linux_update_endp_table(dev);
+ } else if (request == (DeviceOutRequest | USB_REQ_SET_CONFIGURATION)) {
+#ifdef DEBUG
+ printf("usb_host_handle_control: SET_CONFIGURATION request - config %d\n",
+ value & 0xff);
+#endif
+ if (s->configuration != (value & 0xff)) {
+ s->configuration = (value & 0xff);
+ intf_update_required = 1;
+ }
+ goto do_request;
} else {
+ do_request:
ct.bRequestType = request >> 8;
ct.bRequest = request;
ct.wValue = value;
@@ -100,19 +259,28 @@ static int usb_host_handle_control(USBDevice *dev,
ct.timeout = 50;
ct.data = data;
ret = ioctl(s->fd, USBDEVFS_CONTROL, &ct);
- if (ret < 0) {
- switch(errno) {
- case ETIMEDOUT:
- return USB_RET_NAK;
- default:
- return USB_RET_STALL;
- }
- } else {
- return ret;
+ }
+
+ if (ret < 0) {
+ switch(errno) {
+ case ETIMEDOUT:
+ return USB_RET_NAK;
+ default:
+ return USB_RET_STALL;
+ }
+ } else {
+ if (intf_update_required) {
+#ifdef DEBUG
+ printf("usb_host_handle_control: updating interfaces\n");
+#endif
+ usb_host_update_interfaces(s, value & 0xff);
}
- }
+ return ret;
+ }
}
+static int usb_host_handle_isoch(USBDevice *dev, USBPacket *p);
+
static int usb_host_handle_data(USBDevice *dev, USBPacket *p)
{
USBHostDevice *s = (USBHostDevice *)dev;
@@ -120,6 +288,10 @@ static int usb_host_handle_data(USBDevice *dev, USBPacket *p)
int ret;
uint8_t devep = p->devep;
+ if (s->endp_table[p->devep - 1].type == USBDEVFS_URB_TYPE_ISO) {
+ return usb_host_handle_isoch(dev, p);
+ }
+
/* XXX: optimize and handle all data types by looking at the
config descriptor */
if (p->pid == USB_TOKEN_IN)
@@ -145,18 +317,268 @@ static int usb_host_handle_data(USBDevice *dev, USBPacket *p)
}
}
+void isoch_done(int signum, siginfo_t *info, void *context) {
+ struct usbdevfs_urb *urb = (struct usbdevfs_urb *)info->si_addr;
+ USBHostDevice *s = (USBHostDevice *)urb->usercontext;
+
+ if (info->si_code != SI_ASYNCIO ||
+ info->si_signo != SIG_ISOCOMPLETE) {
+ return;
+ }
+
+ s->status = info->si_errno;
+ qemu_bh_schedule(s->bh);
+}
+
+static int usb_host_handle_isoch(USBDevice *dev, USBPacket *p)
+{
+ USBHostDevice *s = (USBHostDevice *)dev;
+ struct usbdevfs_urb *urb, *purb = NULL;
+ int ret;
+ uint8_t devep = p->devep;
+
+ if (p->pid == USB_TOKEN_IN)
+ devep |= 0x80;
+
+ urb = qemu_mallocz(sizeof(struct usbdevfs_urb) +
+ sizeof(struct usbdevfs_iso_packet_desc));
+ if (!urb) {
+ printf("usb_host_handle_isoch: malloc failed\n");
+ return 0;
+ }
+
+ urb->type = USBDEVFS_URB_TYPE_ISO;
+ urb->endpoint = devep;
+ urb->status = 0;
+ urb->flags = USBDEVFS_URB_ISO_ASAP;
+ urb->buffer = p->data;
+ urb->buffer_length = p->len;
+ urb->actual_length = 0;
+ urb->start_frame = 0;
+ urb->error_count = 0;
+#ifdef USE_ASYNCIO
+ urb->signr = SIG_ISOCOMPLETE;
+#else
+ urb->signr = 0;
+#endif
+ urb->usercontext = s;
+ urb->number_of_packets = 1;
+ urb->iso_frame_desc[0].length = p->len;
+ urb->iso_frame_desc[0].actual_length = 0;
+ urb->iso_frame_desc[0].status = 0;
+ ret = ioctl(s->fd, USBDEVFS_SUBMITURB, urb);
+ if (ret == 0) {
+ if (!add_pending_urb(urb)) {
+ printf("usb_host_handle_isoch: add_pending_urb failed %p\n", urb);
+ }
+ } else {
+ printf("usb_host_handle_isoch: SUBMITURB ioctl=%d errno=%d\n", ret, errno);
+ qemu_free(urb);
+ switch(errno) {
+ case ETIMEDOUT:
+ return USB_RET_NAK;
+ case EPIPE:
+ default:
+ return USB_RET_STALL;
+ }
+ }
+#ifdef USE_ASYNCIO
+ s->urb = urb;
+ s->packet = p;
+ return USB_RET_ASYNC;
+#else
+ ret = ioctl(s->fd, USBDEVFS_REAPURBNDELAY, &purb);
+ if (ret == 0) {
+ if (del_pending_urb(purb)) {
+ ret = purb->actual_length;
+ qemu_free(purb);
+ } else {
+ printf("usb_host_handle_isoch: del_pending_urb failed %p\n", purb);
+ }
+ } else {
+#ifdef DEBUG_ISOCH
+ printf("usb_host_handle_isoch: REAPURBNDELAY ioctl=%d errno=%d\n", ret, errno);
+#endif
+ }
+ return ret;
+#endif
+}
+
+static void usb_linux_bh_cb(void *opaque)
+{
+ USBHostDevice *s = (USBHostDevice *)opaque;
+ struct usbdevfs_urb *purb = NULL;
+ USBPacket *p = s->packet;
+ int ret;
+
+ if (!s || !p)
+ return;
+
+#ifdef DEBUG_ISOCH
+ printf("completion: devaddr %d - devep 0x%02x\n", p->devaddr, p->devep);
+#endif
+
+ ret = ioctl(s->fd, USBDEVFS_REAPURBNDELAY, &purb);
+ if (ret < 0) {
+ perror("USBDEVFS_REAPURBNDELAY");
+ return;
+ }
+
+ /* FIXME: handle s->status */
+ if (del_pending_urb(purb)) {
+ p->len = purb->actual_length;
+ qemu_free(purb);
+ s->packet = NULL;
+ usb_packet_complete(p);
+ } else {
+ printf("usb_linux_bh_cb: purb NOT found %p\n", purb);
+ qemu_free(purb);
+ s->packet = NULL;
+ }
+}
+
+// returns 1 on problem encountered or 0 for success
+static int usb_linux_update_endp_table(USBHostDevice *s)
+{
+ uint8_t descriptors[1024];
+ uint8_t data, devep, type;
+ struct usb_ctrltransfer ct;
+ int configuration, interface, alt_interface;
+ int ret, length, i;
+
+ ct.bRequestType = USB_DIR_IN;
+ ct.bRequest = USB_REQ_GET_CONFIGURATION;
+ ct.wValue = 0;
+ ct.wIndex = 0;
+ ct.wLength = 1;
+ ct.data = &data;
+ ct.timeout = 50;
+
+ ret = ioctl(s->fd, USBDEVFS_CONTROL, &ct);
+ if (ret < 0) {
+ perror("usb_linux_update_endp_table");
+ return 1;
+ }
+ configuration = data;
+
+ // in address state
+ if (configuration == 0)
+ return 1;
+
+ /* get the desired configuration, interface, and endpoint
+ * descriptors in one shot - could also re-read all data from
+ * open file descriptor, go through sysfs entries, etc.
+ */
+ ct.bRequestType = USB_DIR_IN;
+ ct.bRequest = USB_REQ_GET_DESCRIPTOR;
+ ct.wValue = (USB_DT_CONFIG << 8) | (configuration - 1);
+ ct.wIndex = 0;
+ ct.wLength = 1024;
+ ct.data = descriptors;
+ ct.timeout = 50;
+
+ ret = ioctl(s->fd, USBDEVFS_CONTROL, &ct);
+ if (ret < 0) {
+ perror("usb_linux_update_endp_table");
+ return 1;
+ }
+
+ length = ret;
+ i = 0;
+
+ if (descriptors[i + 1] != USB_DT_CONFIG ||
+ descriptors[i + 5] != configuration) {
+ printf("invalid descriptor data - configuration\n");
+ return 1;
+ }
+ i += descriptors[i];
+
+ while (i < length) {
+ if (descriptors[i + 1] != USB_DT_INTERFACE ||
+ (descriptors[i + 1] == USB_DT_INTERFACE &&
+ descriptors[i + 4] == 0)) {
+ i += descriptors[i];
+ continue;
+ }
+
+ interface = descriptors[i + 2];
+
+ ct.bRequestType = USB_DIR_IN | USB_RECIP_INTERFACE;
+ ct.bRequest = USB_REQ_GET_INTERFACE;
+ ct.wValue = 0;
+ ct.wIndex = interface;
+ ct.wLength = 1;
+ ct.data = &data;
+ ct.timeout = 50;
+
+ ret = ioctl(s->fd, USBDEVFS_CONTROL, &ct);
+ if (ret < 0) {
+ perror("usb_linux_update_endp_table");
+ return 1;
+ }
+ alt_interface = data;
+
+ // the current interface descriptor is the active interface
+ // and has endpoints
+ if (descriptors[i + 3] != alt_interface) {
+ i += descriptors[i];
+ continue;
+ }
+
+ // advance to the endpoints
+ while (i < length && descriptors[i +1] != USB_DT_ENDPOINT)
+ i += descriptors[i];
+
+ if (i >= length)
+ break;
+
+ while (i < length) {
+ if (descriptors[i + 1] != USB_DT_ENDPOINT)
+ break;
+
+ devep = descriptors[i + 2];
+ switch (descriptors[i + 3] & 0x3) {
+ case 0x00:
+ type = USBDEVFS_URB_TYPE_CONTROL;
+ break;
+ case 0x01:
+ type = USBDEVFS_URB_TYPE_ISO;
+ break;
+ case 0x02:
+ type = USBDEVFS_URB_TYPE_BULK;
+ break;
+ case 0x03:
+ type = USBDEVFS_URB_TYPE_INTERRUPT;
+ break;
+ default:
+ printf("usb_host: malformed endpoint type\n");
+ type = USBDEVFS_URB_TYPE_BULK;
+ }
+ s->endp_table[(devep & 0xf) - 1].type = type;
+
+ i += descriptors[i];
+ }
+ }
+ return 0;
+}
+
/* XXX: exclude high speed devices or implement EHCI */
USBDevice *usb_host_device_open(const char *devname)
{
- int fd, interface, ret, i;
- USBHostDevice *dev;
+ int fd = -1, ret;
+ USBHostDevice *dev = NULL;
struct usbdevfs_connectinfo ci;
- uint8_t descr[1024];
char buf[1024];
- int descr_len, dev_descr_len, config_descr_len, nb_interfaces;
int bus_num, addr;
char product_name[PRODUCT_NAME_SZ];
+ dev = qemu_mallocz(sizeof(USBHostDevice));
+ if (!dev)
+ goto fail;
+
+#ifdef DEBUG_ISOCH
+ printf("usb_host_device_open %s\n", devname);
+#endif
if (usb_host_find_device(&bus_num, &addr,
product_name, sizeof(product_name),
devname) < 0)
@@ -164,61 +586,35 @@ USBDevice *usb_host_device_open(const char *devname)
snprintf(buf, sizeof(buf), USBDEVFS_PATH "/%03d/%03d",
bus_num, addr);
- fd = open(buf, O_RDWR);
+ fd = open(buf, O_RDWR | O_NONBLOCK);
if (fd < 0) {
perror(buf);
return NULL;
}
- /* read the config description */
- descr_len = read(fd, descr, sizeof(descr));
- if (descr_len <= 0) {
- perror("read descr");
- goto fail;
- }
-
- i = 0;
- dev_descr_len = descr[0];
- if (dev_descr_len > descr_len)
- goto fail;
- i += dev_descr_len;
- config_descr_len = descr[i];
- if (i + config_descr_len > descr_len)
- goto fail;
- nb_interfaces = descr[i + 4];
- if (nb_interfaces != 1) {
- /* NOTE: currently we grab only one interface */
- fprintf(stderr, "usb_host: only one interface supported\n");
+ /* read the device description */
+ dev->descr_len = read(fd, dev->descr, sizeof(dev->descr));
+ if (dev->descr_len <= 0) {
+ perror("usb_host_update_interfaces: reading device data failed");
goto fail;
}
-#ifdef USBDEVFS_DISCONNECT
- /* earlier Linux 2.4 do not support that */
+#ifdef DEBUG
{
- struct usbdevfs_ioctl ctrl;
- ctrl.ioctl_code = USBDEVFS_DISCONNECT;
- ctrl.ifno = 0;
- ret = ioctl(fd, USBDEVFS_IOCTL, &ctrl);
- if (ret < 0 && errno != ENODATA) {
- perror("USBDEVFS_DISCONNECT");
- goto fail;
- }
+ int x;
+ printf("=== begin dumping device descriptor data ===\n");
+ for (x = 0; x < dev->descr_len; x++)
+ printf("%02x ", dev->descr[x]);
+ printf("\n=== end dumping device descriptor data ===\n");
}
#endif
- /* XXX: only grab if all interfaces are free */
- interface = 0;
- ret = ioctl(fd, USBDEVFS_CLAIMINTERFACE, &interface);
- if (ret < 0) {
- if (errno == EBUSY) {
- fprintf(stderr, "usb_host: device already grabbed\n");
- } else {
- perror("USBDEVFS_CLAIMINTERFACE");
- }
- fail:
- close(fd);
- return NULL;
- }
+ dev->fd = fd;
+ dev->configuration = 1;
+
+ // XXX - do something about initial configuration
+ if (!usb_host_update_interfaces(dev, 1))
+ goto fail;
ret = ioctl(fd, USBDEVFS_CONNECTINFO, &ci);
if (ret < 0) {
@@ -230,10 +626,20 @@ USBDevice *usb_host_device_open(const char *devname)
printf("host USB device %d.%d grabbed\n", bus_num, addr);
#endif
- dev = qemu_mallocz(sizeof(USBHostDevice));
- if (!dev)
+ ret = usb_linux_update_endp_table(dev);
+ if (ret) {
+ qemu_free(dev);
goto fail;
- dev->fd = fd;
+ }
+
+#ifdef USE_ASYNCIO
+ dev->bh = qemu_bh_new(usb_linux_bh_cb, dev);
+ if (!dev->bh) {
+ qemu_free(dev);
+ goto fail;
+ }
+#endif
+
if (ci.slow)
dev->dev.speed = USB_SPEED_LOW;
else
@@ -252,7 +658,24 @@ USBDevice *usb_host_device_open(const char *devname)
pstrcpy(dev->dev.devname, sizeof(dev->dev.devname),
product_name);
+#ifdef USE_ASYNCIO
+ /* set up the signal handlers */
+ sigemptyset(&sigact.sa_mask);
+ sigact.sa_sigaction = isoch_done;
+ sigact.sa_flags = SA_SIGINFO;
+ sigact.sa_restorer = 0;
+ ret = sigaction(SIG_ISOCOMPLETE, &sigact, NULL);
+ if (ret < 0) {
+ printf("sigaction SIG_ISOCOMPLETE=%d errno=%d\n", ret, errno);
+ }
+#endif
+
return (USBDevice *)dev;
+fail:
+ if (dev)
+ qemu_free(dev);
+ close(fd);
+ return NULL;
}
static int get_tag_value(char *buf, int buf_size,

View File

@ -1,11 +1,8 @@
Index: gdbstub.c
===================================================================
RCS file: /sources/qemu/qemu/gdbstub.c,v
retrieving revision 1.59
diff -u -a -p -r1.59 gdbstub.c
--- gdbstub.c 7 Jul 2007 20:53:22 -0000 1.59
+++ gdbstub.c 10 Jul 2007 12:36:35 -0000
@@ -510,7 +510,9 @@ static int cpu_gdb_read_registers(CPUSta
================================================================================
--- gdbstub.c
+++ gdbstub.c
@@ -558,7 +558,9 @@
for (i = 0; i < 8; i++) {
u.d = env->fregs[i];
*(uint32_t *)ptr = tswap32(u.l.upper);
@ -15,36 +12,29 @@ diff -u -a -p -r1.59 gdbstub.c
}
/* FP control regs (not implemented). */
memset (ptr, 0, 3 * 4);
@@ -544,7 +546,9 @@ static void cpu_gdb_write_registers(CPUS
@@ -592,7 +594,9 @@
ColdFire has 8-bit double precision registers. */
for (i = 0; i < 8; i++) {
u.l.upper = tswap32(*(uint32_t *)ptr);
+ ptr += 4;
u.l.upper = tswap32(*(uint32_t *)ptr);
+ ptr += 4;
u.l.lower = tswap32(*(uint32_t *)ptr);
+ ptr += 8;
+ ptr += 8;
env->fregs[i] = u.d;
}
/* FP control regs (not implemented). */
Index: target-m68k/cpu.h
===================================================================
RCS file: /sources/qemu/qemu/target-m68k/cpu.h,v
retrieving revision 1.11
diff -u -a -p -r1.11 cpu.h
--- target-m68k/cpu.h 3 Jun 2007 21:02:38 -0000 1.11
+++ target-m68k/cpu.h 10 Jul 2007 12:36:35 -0000
@@ -86,7 +86,10 @@ typedef struct CPUM68KState {
/* Temporary storage for DIV helpers. */
--- target-m68k/cpu.h
+++ target-m68k/cpu.h
@@ -89,6 +89,9 @@
uint32_t div1;
uint32_t div2;
-
+
+ /* Upper 32 bits of a 64bit operand for quad MUL/DIV. */
+ uint32_t quadh;
+
/* MMU status. */
struct {
uint32_t ar;
@@ -133,14 +136,26 @@ enum {
@@ -135,14 +138,26 @@
CC_OP_DYNAMIC, /* Use env->cc_op */
CC_OP_FLAGS, /* CC_DEST = CVZN, CC_SRC = unused */
CC_OP_LOGIC, /* CC_DEST = result, CC_SRC = unused */
@ -73,7 +63,7 @@ diff -u -a -p -r1.11 cpu.h
CC_OP_SAR, /* CC_DEST = source, CC_SRC = shift */
};
@@ -189,6 +204,12 @@ void do_m68k_semihosting(CPUM68KState *e
@@ -191,6 +206,12 @@
ISA revisions mentioned. */
enum m68k_features {
@ -86,7 +76,7 @@ diff -u -a -p -r1.11 cpu.h
M68K_FEATURE_CF_ISA_A,
M68K_FEATURE_CF_ISA_B, /* (ISA B or C). */
M68K_FEATURE_CF_ISA_APLUSC, /* BIT/BITREV, FF1, STRLDSR (ISA A+ or C). */
@@ -199,7 +220,9 @@ enum m68k_features {
@@ -201,7 +222,9 @@
M68K_FEATURE_CF_EMAC_B, /* Revision B EMAC (dual accumulate). */
M68K_FEATURE_USP, /* User Stack Pointer. (ISA A+, B or C). */
M68K_FEATURE_EXT_FULL, /* 68020+ full extension word. */
@ -97,7 +87,7 @@ diff -u -a -p -r1.11 cpu.h
};
static inline int m68k_feature(CPUM68KState *env, int feature)
@@ -210,8 +233,8 @@ static inline int m68k_feature(CPUM68KSt
@@ -212,8 +235,8 @@
void register_m68k_insns (CPUM68KState *env);
#ifdef CONFIG_USER_ONLY
@ -106,16 +96,11 @@ diff -u -a -p -r1.11 cpu.h
+/* Linux uses 4k pages. */
+#define TARGET_PAGE_BITS 12
#else
/* Smallest TLB entry size is 1k. */
/* Smallest TLB entry size is 1k. */
#define TARGET_PAGE_BITS 10
Index: target-m68k/exec.h
===================================================================
RCS file: /sources/qemu/qemu/target-m68k/exec.h,v
retrieving revision 1.3
diff -u -a -p -r1.3 exec.h
--- target-m68k/exec.h 3 Jun 2007 17:44:36 -0000 1.3
+++ target-m68k/exec.h 10 Jul 2007 12:36:35 -0000
@@ -48,6 +48,10 @@ void cpu_m68k_flush_flags(CPUM68KState *
--- target-m68k/exec.h
+++ target-m68k/exec.h
@@ -48,6 +48,10 @@
float64 helper_sub_cmpf64(CPUM68KState *env, float64 src0, float64 src1);
void helper_movec(CPUM68KState *env, int reg, uint32_t val);
@ -126,13 +111,8 @@ diff -u -a -p -r1.3 exec.h
void cpu_loop_exit(void);
static inline int cpu_halted(CPUState *env) {
Index: target-m68k/helper.c
===================================================================
RCS file: /sources/qemu/qemu/target-m68k/helper.c,v
retrieving revision 1.6
diff -u -a -p -r1.6 helper.c
--- target-m68k/helper.c 3 Jun 2007 12:35:08 -0000 1.6
+++ target-m68k/helper.c 10 Jul 2007 12:36:35 -0000
--- target-m68k/helper.c
+++ target-m68k/helper.c
@@ -27,6 +27,10 @@
#include "exec-all.h"
@ -144,7 +124,7 @@ diff -u -a -p -r1.6 helper.c
M68K_CPUID_M5206,
M68K_CPUID_M5208,
M68K_CPUID_CFV4E,
@@ -39,6 +43,10 @@ struct m68k_def_t {
@@ -39,6 +43,10 @@
};
static m68k_def_t m68k_cpu_defs[] = {
@ -152,10 +132,10 @@ diff -u -a -p -r1.6 helper.c
+ {"m68020", M68K_CPUID_M68020},
+ {"m68040", M68K_CPUID_M68040},
+ {"m68060", M68K_CPUID_M68060},
{"m5206", M68K_CPUID_M5206},
{"m5208", M68K_CPUID_M5208},
{"m5206", M68K_CPUID_M5206},
{"m5208", M68K_CPUID_M5208},
{"cfv4e", M68K_CPUID_CFV4E},
@@ -63,12 +71,41 @@ int cpu_m68k_set_model(CPUM68KState *env
@@ -63,12 +71,41 @@
return 1;
switch (def->id) {
@ -197,7 +177,7 @@ diff -u -a -p -r1.6 helper.c
m68k_set_feature(env, M68K_FEATURE_BRAL);
m68k_set_feature(env, M68K_FEATURE_CF_EMAC);
m68k_set_feature(env, M68K_FEATURE_USP);
@@ -76,12 +113,19 @@ int cpu_m68k_set_model(CPUM68KState *env
@@ -76,12 +113,19 @@
case M68K_CPUID_CFV4E:
m68k_set_feature(env, M68K_FEATURE_CF_ISA_A);
m68k_set_feature(env, M68K_FEATURE_CF_ISA_B);
@ -217,7 +197,7 @@ diff -u -a -p -r1.6 helper.c
m68k_set_feature(env, M68K_FEATURE_CF_ISA_A);
m68k_set_feature(env, M68K_FEATURE_CF_ISA_B);
m68k_set_feature(env, M68K_FEATURE_CF_ISA_APLUSC);
@@ -93,6 +137,7 @@ int cpu_m68k_set_model(CPUM68KState *env
@@ -93,6 +137,7 @@
m68k_set_feature(env, M68K_FEATURE_CF_EMAC_B);
m68k_set_feature(env, M68K_FEATURE_USP);
m68k_set_feature(env, M68K_FEATURE_EXT_FULL);
@ -225,7 +205,7 @@ diff -u -a -p -r1.6 helper.c
m68k_set_feature(env, M68K_FEATURE_WORD_INDEX);
break;
}
@@ -102,6 +147,42 @@ int cpu_m68k_set_model(CPUM68KState *env
@@ -102,6 +147,42 @@
return 0;
}
@ -268,7 +248,7 @@ diff -u -a -p -r1.6 helper.c
void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op)
{
int flags;
@@ -127,6 +208,66 @@ void cpu_m68k_flush_flags(CPUM68KState *
@@ -127,6 +208,66 @@
flags |= CCF_V; \
} while (0)
@ -335,7 +315,7 @@ diff -u -a -p -r1.6 helper.c
flags = 0;
src = env->cc_src;
dest = env->cc_dest;
@@ -137,68 +278,68 @@ void cpu_m68k_flush_flags(CPUM68KState *
@@ -137,68 +278,68 @@
case CC_OP_LOGIC:
SET_NZ(dest);
break;
@ -450,14 +430,9 @@ diff -u -a -p -r1.6 helper.c
break;
default:
cpu_abort(env, "Bad CC_OP %d", cc_op);
Index: target-m68k/op-hacks.h
===================================================================
RCS file: /sources/qemu/qemu/target-m68k/op-hacks.h,v
retrieving revision 1.3
diff -u -a -p -r1.3 op-hacks.h
--- target-m68k/op-hacks.h 9 Jun 2007 20:50:00 -0000 1.3
+++ target-m68k/op-hacks.h 10 Jul 2007 12:36:35 -0000
@@ -89,6 +89,36 @@ static inline void gen_op_sar_im_cc(int
--- target-m68k/op-hacks.h
+++ target-m68k/op-hacks.h
@@ -89,6 +89,36 @@
gen_op_sar_cc(val, gen_im32(shift));
}
@ -494,14 +469,9 @@ diff -u -a -p -r1.3 op-hacks.h
#ifdef USE_DIRECT_JUMP
#define TBPARAM(x)
#else
Index: target-m68k/op.c
===================================================================
RCS file: /sources/qemu/qemu/target-m68k/op.c,v
retrieving revision 1.11
diff -u -a -p -r1.11 op.c
--- target-m68k/op.c 9 Jun 2007 20:50:01 -0000 1.11
+++ target-m68k/op.c 10 Jul 2007 12:36:35 -0000
@@ -136,6 +136,76 @@ OP(mul32)
--- target-m68k/op.c
+++ target-m68k/op.c
@@ -136,6 +136,76 @@
FORCE_RET();
}
@ -578,7 +548,7 @@ diff -u -a -p -r1.11 op.c
OP(not32)
{
uint32_t arg = get_op(PARAM2);
@@ -180,6 +250,22 @@ OP(ff1)
@@ -180,6 +250,22 @@
FORCE_RET();
}
@ -601,7 +571,7 @@ diff -u -a -p -r1.11 op.c
OP(subx_cc)
{
uint32_t op1 = get_op(PARAM1);
@@ -253,14 +339,60 @@ OP(shl32)
@@ -253,14 +339,60 @@
FORCE_RET();
}
@ -664,7 +634,7 @@ diff -u -a -p -r1.11 op.c
FORCE_RET();
}
@@ -279,9 +411,55 @@ OP(shr_cc)
@@ -279,9 +411,55 @@
uint32_t op1 = get_op(PARAM1);
uint32_t op2 = get_op(PARAM2);
uint32_t result;
@ -722,7 +692,7 @@ diff -u -a -p -r1.11 op.c
FORCE_RET();
}
@@ -300,12 +478,199 @@ OP(sar_cc)
@@ -300,12 +478,199 @@
int32_t op1 = get_op(PARAM1);
uint32_t op2 = get_op(PARAM2);
uint32_t result;
@ -924,7 +894,7 @@ diff -u -a -p -r1.11 op.c
/* Value extend. */
OP(ext8u32)
@@ -361,14 +726,17 @@ OP(divu)
@@ -361,14 +726,17 @@
/* Avoid using a PARAM1 of zero. This breaks dyngen because it uses
the address of a symbol, and gcc knows symbols can't have address
zero. */
@ -945,16 +915,16 @@ diff -u -a -p -r1.11 op.c
env->cc_dest = flags;
FORCE_RET();
}
@@ -379,7 +747,7 @@ OP(divs)
@@ -379,7 +747,7 @@
int32_t den;
int32_t quot;
int32_t rem;
- int32_t flags;
+ uint32_t flags;
num = env->div1;
den = env->div2;
@@ -388,14 +756,78 @@ OP(divs)
@@ -388,14 +756,78 @@
quot = num / den;
rem = num % den;
flags = 0;
@ -1036,14 +1006,9 @@ diff -u -a -p -r1.11 op.c
env->cc_dest = flags;
FORCE_RET();
}
Index: target-m68k/qregs.def
===================================================================
RCS file: /sources/qemu/qemu/target-m68k/qregs.def,v
retrieving revision 1.3
diff -u -a -p -r1.3 qregs.def
--- target-m68k/qregs.def 29 May 2007 14:57:59 -0000 1.3
+++ target-m68k/qregs.def 10 Jul 2007 12:36:35 -0000
@@ -32,6 +32,7 @@ DEFO32(CC_SRC, cc_src)
--- target-m68k/qregs.def
+++ target-m68k/qregs.def
@@ -32,6 +32,7 @@
DEFO32(CC_X, cc_x)
DEFO32(DIV1, div1)
DEFO32(DIV2, div2)
@ -1051,14 +1016,9 @@ diff -u -a -p -r1.3 qregs.def
DEFO32(EXCEPTION, exception_index)
DEFO32(MACSR, macsr)
DEFO32(MAC_MASK, mac_mask)
Index: target-m68k/translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-m68k/translate.c,v
retrieving revision 1.17
diff -u -a -p -r1.17 translate.c
--- target-m68k/translate.c 9 Jun 2007 21:30:14 -0000 1.17
+++ target-m68k/translate.c 10 Jul 2007 12:36:35 -0000
@@ -250,6 +250,9 @@ static int gen_lea_indexed(DisasContext
--- target-m68k/translate.c
+++ target-m68k/translate.c
@@ -250,6 +250,9 @@
if ((ext & 0x800) == 0 && !m68k_feature(s->env, M68K_FEATURE_WORD_INDEX))
return -1;
@ -1068,7 +1028,7 @@ diff -u -a -p -r1.17 translate.c
if (ext & 0x100) {
/* full extension word format */
if (!m68k_feature(s->env, M68K_FEATURE_EXT_FULL))
@@ -258,7 +261,7 @@ static int gen_lea_indexed(DisasContext
@@ -258,7 +261,7 @@
if ((ext & 0x30) > 0x10) {
/* base displacement */
if ((ext & 0x30) == 0x20) {
@ -1077,7 +1037,7 @@ diff -u -a -p -r1.17 translate.c
s->pc += 2;
} else {
bd = read_im32(s);
@@ -307,7 +310,7 @@ static int gen_lea_indexed(DisasContext
@@ -307,7 +310,7 @@
if ((ext & 3) > 1) {
/* outer displacement */
if ((ext & 3) == 2) {
@ -1086,7 +1046,7 @@ diff -u -a -p -r1.17 translate.c
s->pc += 2;
} else {
od = read_im32(s);
@@ -366,6 +369,25 @@ static inline int opsize_bytes(int opsiz
@@ -366,6 +369,25 @@
}
}
@ -1112,7 +1072,7 @@ diff -u -a -p -r1.17 translate.c
/* Assign value to a register. If the width is less than the register width
only the low part of the register is set. */
static void gen_partset_reg(int opsize, int reg, int val)
@@ -881,8 +903,27 @@ DISAS_INSN(divl)
@@ -881,8 +903,27 @@
ext = lduw_code(s->pc);
s->pc += 2;
@ -1142,7 +1102,7 @@ diff -u -a -p -r1.17 translate.c
return;
}
num = DREG(ext, 12);
@@ -895,13 +936,10 @@ DISAS_INSN(divl)
@@ -895,13 +936,10 @@
} else {
gen_op_divu(2);
}
@ -1160,7 +1120,7 @@ diff -u -a -p -r1.17 translate.c
gen_op_flags_set();
s->cc_op = CC_OP_FLAGS;
}
@@ -914,31 +952,33 @@ DISAS_INSN(addsub)
@@ -914,31 +952,33 @@
int tmp;
int addr;
int add;
@ -1200,7 +1160,7 @@ diff -u -a -p -r1.17 translate.c
}
}
@@ -1065,6 +1105,8 @@ DISAS_INSN(movem)
@@ -1065,6 +1105,8 @@
int reg;
int tmp;
int is_load;
@ -1209,7 +1169,7 @@ diff -u -a -p -r1.17 translate.c
mask = lduw_code(s->pc);
s->pc += 2;
@@ -1076,21 +1118,40 @@ DISAS_INSN(movem)
@@ -1076,21 +1118,40 @@
addr = gen_new_qreg(QMODE_I32);
gen_op_mov32(addr, tmp);
is_load = ((insn & 0x0400) != 0);
@ -1265,7 +1225,7 @@ diff -u -a -p -r1.17 translate.c
}
}
@@ -1158,10 +1219,26 @@ DISAS_INSN(arith_im)
@@ -1158,10 +1219,26 @@
int dest;
int src2;
int addr;
@ -1294,7 +1254,7 @@ diff -u -a -p -r1.17 translate.c
dest = gen_new_qreg(QMODE_I32);
switch (op) {
case 0: /* ori */
@@ -1177,14 +1254,14 @@ DISAS_INSN(arith_im)
@@ -1177,14 +1254,14 @@
gen_op_update_xflag_lt(dest, src2);
gen_op_sub32(dest, dest, src2);
gen_op_update_cc_add(dest, src2);
@ -1311,7 +1271,7 @@ diff -u -a -p -r1.17 translate.c
break;
case 5: /* eori */
gen_op_xor32(dest, src1, src2);
@@ -1194,13 +1271,13 @@ DISAS_INSN(arith_im)
@@ -1194,13 +1271,13 @@
gen_op_mov32(dest, src1);
gen_op_sub32(dest, dest, src2);
gen_op_update_cc_add(dest, src2);
@ -1327,7 +1287,7 @@ diff -u -a -p -r1.17 translate.c
}
}
@@ -1290,19 +1367,7 @@ DISAS_INSN(clr)
@@ -1290,19 +1367,7 @@
{
int opsize;
@ -1348,7 +1308,7 @@ diff -u -a -p -r1.17 translate.c
DEST_EA(insn, opsize, gen_im32(0), NULL);
gen_logic_cc(s, gen_im32(0));
}
@@ -1331,17 +1396,20 @@ DISAS_INSN(move_from_ccr)
@@ -1331,17 +1396,20 @@
DISAS_INSN(neg)
{
@ -1378,7 +1338,7 @@ diff -u -a -p -r1.17 translate.c
}
static void gen_set_sr_im(DisasContext *s, uint16_t val, int ccr_only)
@@ -1390,11 +1458,17 @@ DISAS_INSN(move_to_ccr)
@@ -1390,11 +1458,17 @@
DISAS_INSN(not)
{
@ -1400,7 +1360,7 @@ diff -u -a -p -r1.17 translate.c
}
DISAS_INSN(swap)
@@ -1452,19 +1526,7 @@ DISAS_INSN(tst)
@@ -1452,19 +1526,7 @@
int opsize;
int tmp;
@ -1421,7 +1381,7 @@ diff -u -a -p -r1.17 translate.c
SRC_EA(tmp, opsize, -1, NULL);
gen_logic_cc(s, tmp);
}
@@ -1493,28 +1555,149 @@ DISAS_INSN(tas)
@@ -1493,28 +1555,149 @@
DEST_EA(insn, OS_BYTE, dest, &addr);
}
@ -1577,7 +1537,7 @@ diff -u -a -p -r1.17 translate.c
}
DISAS_INSN(link)
@@ -1534,6 +1717,22 @@ DISAS_INSN(link)
@@ -1534,6 +1717,22 @@
gen_op_add32(QREG_SP, tmp, gen_im32(offset));
}
@ -1600,7 +1560,7 @@ diff -u -a -p -r1.17 translate.c
DISAS_INSN(unlk)
{
int src;
@@ -1586,8 +1785,14 @@ DISAS_INSN(addsubq)
@@ -1586,8 +1785,14 @@
int dest;
int val;
int addr;
@ -1616,7 +1576,7 @@ diff -u -a -p -r1.17 translate.c
val = (insn >> 9) & 7;
if (val == 0)
val = 8;
@@ -1606,15 +1811,15 @@ DISAS_INSN(addsubq)
@@ -1606,15 +1811,15 @@
if (insn & 0x0100) {
gen_op_update_xflag_lt(dest, src2);
gen_op_sub32(dest, dest, src2);
@ -1635,7 +1595,7 @@ diff -u -a -p -r1.17 translate.c
}
DISAS_INSN(tpf)
@@ -1633,6 +1838,47 @@ DISAS_INSN(tpf)
@@ -1633,6 +1838,47 @@
}
}
@ -1683,7 +1643,7 @@ diff -u -a -p -r1.17 translate.c
DISAS_INSN(branch)
{
int32_t offset;
@@ -1698,17 +1944,19 @@ DISAS_INSN(or)
@@ -1698,17 +1944,19 @@
int dest;
int src;
int addr;
@ -1707,7 +1667,7 @@ diff -u -a -p -r1.17 translate.c
}
gen_logic_cc(s, dest);
}
@@ -1718,7 +1966,7 @@ DISAS_INSN(suba)
@@ -1718,7 +1966,7 @@
int src;
int reg;
@ -1716,7 +1676,7 @@ diff -u -a -p -r1.17 translate.c
reg = AREG(insn, 9);
gen_op_sub32(reg, reg, src);
}
@@ -1763,34 +2011,18 @@ DISAS_INSN(mov3q)
@@ -1763,34 +2011,18 @@
DISAS_INSN(cmp)
{
@ -1753,7 +1713,7 @@ diff -u -a -p -r1.17 translate.c
}
DISAS_INSN(cmpa)
@@ -1810,7 +2042,7 @@ DISAS_INSN(cmpa)
@@ -1810,7 +2042,7 @@
dest = gen_new_qreg(QMODE_I32);
gen_op_sub32(dest, reg, src);
gen_op_update_cc_add(dest, src);
@ -1762,7 +1722,7 @@ diff -u -a -p -r1.17 translate.c
}
DISAS_INSN(eor)
@@ -1819,13 +2051,15 @@ DISAS_INSN(eor)
@@ -1819,13 +2051,15 @@
int reg;
int dest;
int addr;
@ -1780,7 +1740,7 @@ diff -u -a -p -r1.17 translate.c
}
DISAS_INSN(and)
@@ -1834,17 +2068,19 @@ DISAS_INSN(and)
@@ -1834,17 +2068,19 @@
int reg;
int dest;
int addr;
@ -1804,7 +1764,7 @@ diff -u -a -p -r1.17 translate.c
}
gen_logic_cc(s, dest);
}
@@ -1854,7 +2090,7 @@ DISAS_INSN(adda)
@@ -1854,7 +2090,7 @@
int src;
int reg;
@ -1813,7 +1773,7 @@ diff -u -a -p -r1.17 translate.c
reg = AREG(insn, 9);
gen_op_add32(reg, reg, src);
}
@@ -1907,6 +2143,58 @@ DISAS_INSN(shift_im)
@@ -1907,6 +2143,58 @@
}
}
@ -1872,7 +1832,7 @@ diff -u -a -p -r1.17 translate.c
DISAS_INSN(shift_reg)
{
int reg;
@@ -1931,6 +2219,603 @@ DISAS_INSN(shift_reg)
@@ -1931,6 +2219,603 @@
}
}
@ -2476,7 +2436,7 @@ diff -u -a -p -r1.17 translate.c
DISAS_INSN(ff1)
{
int reg;
@@ -2194,17 +3079,42 @@ DISAS_INSN(fpu)
@@ -2194,17 +3079,42 @@
case 7:
{
int addr;
@ -2525,7 +2485,7 @@ diff -u -a -p -r1.17 translate.c
dest = QREG_F0;
while (mask) {
if (ext & mask) {
@@ -2216,8 +3126,11 @@ DISAS_INSN(fpu)
@@ -2216,8 +3126,11 @@
/* load */
gen_ld(s, f64, dest, addr);
}
@ -2539,7 +2499,7 @@ diff -u -a -p -r1.17 translate.c
}
mask >>= 1;
dest++;
@@ -2293,6 +3206,12 @@ DISAS_INSN(fpu)
@@ -2293,6 +3206,12 @@
case 0x23: case 0x63: case 0x67: /* fmul */
gen_op_mulf64(res, res, src);
break;
@ -2552,7 +2512,7 @@ diff -u -a -p -r1.17 translate.c
case 0x28: case 0x68: case 0x6c: /* fsub */
gen_op_subf64(res, res, src);
break;
@@ -2759,85 +3678,158 @@ void register_m68k_insns (CPUM68KState *
@@ -2759,85 +3678,158 @@
register_opcode(disas_##name, 0x##opcode, 0x##mask); \
} while(0)
INSN(undef, 0000, 0000, CF_ISA_A);
@ -2713,7 +2673,7 @@ diff -u -a -p -r1.17 translate.c
INSN(mac, a000, f100, CF_EMAC);
INSN(from_mac, a180, f9b0, CF_EMAC);
INSN(move_mac, a110, f9fc, CF_EMAC);
@@ -2856,19 +3848,50 @@ void register_m68k_insns (CPUM68KState *
@@ -2856,19 +3848,50 @@
INSN(cmpa, b0c0, f1c0, CF_ISA_B); /* cmpa.w */
INSN(cmp, b080, f1c0, CF_ISA_A);
INSN(cmpa, b1c0, f1c0, CF_ISA_A);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Nov 13 15:54:45 CET 2007 - uli@suse.de
- update -> current CVS:
- Read-only support for Parallels disk images (Alex Beregszaszi)
- CRIS emulation (Edgar E. Iglesias)
- SPARC32PLUS execution support (Blue Swirl)
- MIPS mipssim pseudo machine (Thiemo Seufer)
- Strace for Linux userland emulation (Stuart Anderson, Thayne Harbaugh)
- OMAP310 MPU emulation plus Palm T|E machine (Andrzej Zaborowski)
- ARM v6, v7, NEON SIMD and SMP emulation (Paul Brook/CodeSourcery)
-------------------------------------------------------------------
Fri Oct 12 01:30:23 CEST 2007 - ro@suse.de

View File

@ -13,17 +13,16 @@
Name: qemu
BuildRequires: SDL-devel bison e2fsprogs-devel
Url: http://fabrice.bellard.free.fr/qemu/
License: BSD 3-Clause; GPL v2 or later; LGPL v2 or later; X11/MIT
License: BSD 3-Clause; GPL v2 or later; LGPL v2.1 or later; X11/MIT
Group: System/Emulators/PC
Summary: Universal CPU emulator
Version: 0.9.0.cvs
Release: 37
Release: 50
Source: %name-%version.tar.bz2
#Patch400: qemu-0.7.0-gcc4-dot-syms.patch
#Patch401: qemu-0.8.0-gcc4-hacks.patch
#Patch402: qemu-0.8.3-gcc4.patch
Patch1: qemu-0.7.0-binfmt.patch
Patch5: qemu-0.7.0-sigaltstackhack.patch
Patch1: qemu-0.9.0.cvs-binfmt.patch
Patch6: qemu-0.7.0-amd64.patch
Patch8: qemu-cvs-pthread.patch
Patch10: linkerscripts.patch
@ -35,13 +34,11 @@ Patch37: qemu-0.9.0-kvm.patch
Patch38: qemu-0.9.0-kvm-bios.patch
Patch39: qemu-0.9.0-kvm-kqemu-window-caption.patch
Patch48: qemu-z80.diff
Patch49: qemu-cvs-img.patch
Patch50: qemu-cvs-newpath.patch
Patch51: qemu-cvs-tls.patch
Patch52: qemu-cvs-futex.patch
Patch53: qemu-cvs-sched_getaffinity.patch
Patch54: qemu-cvs-mplayer.patch
Patch55: qemu-cvs-netlink.patch
Patch56: qemu-cvs-ipc.patch
Patch57: qemu-cvs-ipc_semop.patch
Patch58: qemu-cvs-ioctl_debug.patch
@ -58,16 +55,8 @@ Patch68: qemu-0.8.3-gcc4.patch
Patch69: qemu-cvs-ia64.patch
Patch70: qemu-m68k.diff
Patch71: qemu-s390.patch
Patch72: qemu-cvs-atapi.patch
Patch73: qemu-cvs-svm.patch
Patch74: qemu-cvs-cache-info.patch
Patch76: qemu-cvs-eepro100-flow-control.patch
Patch77: qemu-cvs-fdc.patch
Patch78: qemu-cvs-ide-allow-more-powermgmt.patch
Patch79: qemu-cvs-ide-dvd.patch
Patch80: qemu-cvs-raw-io-reliability.patch
Patch81: qemu-cvs-usb-isoch.patch
Patch82: qemu-cvs-svm2.patch
Patch83: qemu-cvs-ppcspe.patch
Source200: kvm_bios.bin
Source201: zx-rom.bin
Source202: COPYING.zx-rom
@ -112,7 +101,7 @@ Patch701: gcc-3.3.5.dif
# this is to make lint happy
Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 ppc sparc x86_64 ia64 s390
ExclusiveArch: %ix86 ppc sparc x86_64 ia64 s390 ppc64
%description
QEMU is an extremely well-performing CPU emulator that allows you to
@ -128,12 +117,11 @@ Authors:
Fabrice Bellard <fabrice.bellard@free.fr>
%prep
%setup -q -a601
%setup -n qemu -q -a601
#%patch400 -p1
#%patch401 -p1
#%patch402 -p1
%patch1 -p1
%patch5
%patch6
%patch8 -p1
%patch10
@ -145,13 +133,11 @@ Authors:
#%patch38 -p1
#%patch39 -p1
%patch48 -p1
%patch49
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
@ -167,20 +153,12 @@ Authors:
%patch69
%patch70
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74
%patch76
# needs fixing
%patch77 -p1
%patch78 -p1
%patch79
%patch80 -p1
%patch81 -p2
%ifarch ia64 ppc64
#this is the dyngen for gcc4 patch (does not work on x86)
%patch68 -p1
%endif
%patch83
%if 1
cd gcc-3.3.5
%patch600
%patch601
@ -215,6 +193,7 @@ cd gcc-3.3.5
%patch700 -p1
%patch701
cd ..
%endif
%build
cp -p %SOURCE200 pc-bios/
@ -277,7 +256,7 @@ make clean
./configure --prefix=/usr \
--interp-prefix=/usr/share/qemu/qemu-i386 \
%ifarch s390 # alpha-linux-user broken (ICE)
--target-list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user" \
--target-list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user sh4-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user x86_64-linux-user cris-linux-user" \
%else
--enable-linux-user \
%endif
@ -285,6 +264,8 @@ make clean
--static --disable-gcc-check \
--extra-cflags="$QEMU_OPT_FLAGS"
make %{?jobs:-j%{jobs}}
mv ppc64abi32-linux-user/qemu-ppc64 ppc64abi32-linux-user/qemu-ppc64abi32
make qemu-img
%install
install -d -m 755 $RPM_BUILD_ROOT/usr/bin
@ -328,6 +309,15 @@ rm -rf %{gcc33tmp}
%dir /emul/ia32-linux
%endif
%changelog
* Tue Nov 13 2007 - uli@suse.de
- update -> current CVS:
- Read-only support for Parallels disk images (Alex Beregszaszi)
- CRIS emulation (Edgar E. Iglesias)
- SPARC32PLUS execution support (Blue Swirl)
- MIPS mipssim pseudo machine (Thiemo Seufer)
- Strace for Linux userland emulation (Stuart Anderson, Thayne Harbaugh)
- OMAP310 MPU emulation plus Palm T|E machine (Andrzej Zaborowski)
- ARM v6, v7, NEON SIMD and SMP emulation (Paul Brook/CodeSourcery)
* Fri Oct 12 2007 - ro@suse.de
- hack to fix build: undef DEBUG_BLOCK for now
* Fri Sep 28 2007 - agraf@suse.de

View File

@ -1,5 +1,5 @@
# This line is mandatory to access the configuration functions
from Config import *
addFilter("qemu arch-dependent-file-in-usr-share")
addFilter("arch-dependent-file-in-usr-share")