Hello community,
here is the log from the commit of package qemu
checked in at Mon May 29 18:12:25 CEST 2006.
--------
--- qemu/qemu.changes 2006-03-07 22:32:17.000000000 +0100
+++ qemu/qemu.changes 2006-05-29 13:39:39.000000000 +0200
@@ -1,0 +2,11 @@
+Mon May 29 13:39:30 CEST 2006 - uli(a)suse.de
+
+- fixed to build with new kernel headers
+
+-------------------------------------------------------------------
+Wed Mar 8 18:14:04 CET 2006 - uli(a)suse.de
+
+- split giant patch
+- added NWFPE glue code fix
+
+-------------------------------------------------------------------
Old:
----
qemu-0.7.0-syscall.patch
New:
----
qemu-0.7.0-sigaltstackhack.patch
qemu-0.7.1-armfpaex.patch
qemu-0.7.1-jobsignals.patch
qemu-0.7.1-syscalls.patch
qemu-0.8.0-usbdevice_fs.patch
qemu-nwfpe-cpsr.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ qemu.spec ++++++
--- /var/tmp/diff_new_pack.rbVeOz/_old 2006-05-29 18:11:40.000000000 +0200
+++ /var/tmp/diff_new_pack.rbVeOz/_new 2006-05-29 18:11:40.000000000 +0200
@@ -17,16 +17,21 @@
Group: System/Emulators/Other
Summary: Universal CPU emulator
Version: 0.8.0
-Release: 6
+Release: 14
Source: %name-%version.tar.bz2
Patch1: qemu-0.7.0-binfmt.patch
-Patch5: qemu-0.7.0-syscall.patch
+Patch5: qemu-0.7.0-sigaltstackhack.patch
Patch6: qemu-0.7.0-amd64.patch
#Patch7: qemu-0.6.1-abuildappease.patch
Patch8: qemu-0.7.1.patch
Patch9: qemu-0.8.0-ia64.patch
Patch10: linkerscripts.patch
Patch11: qemu-0.7.2-kqemu.patch
+Patch12: qemu-0.7.1-armfpaex.patch
+Patch13: qemu-nwfpe-cpsr.patch
+Patch14: qemu-0.7.1-jobsignals.patch
+Patch15: qemu-0.7.1-syscalls.patch
+Patch16: qemu-0.8.0-usbdevice_fs.patch
# GCC 3 sources/patches
Source601: gcc-3.3.5.tar.bz2
Patch600: gcc-gcc-3.3.5-hammer.patch.bz2
@@ -83,13 +88,18 @@
%prep
%setup -q -a601
%patch1
-%patch5 -p1
+%patch5
%patch6
#%patch7
%patch8
%patch9
%patch10
%patch11
+%patch12
+%patch13 -p1
+%patch14
+%patch15
+%patch16
cd gcc-3.3.5
%patch600
%patch601
@@ -253,6 +263,11 @@
%endif
%changelog -n qemu
+* Mon May 29 2006 - uli(a)suse.de
+- fixed to build with new kernel headers
+* Wed Mar 08 2006 - uli(a)suse.de
+- split giant patch
+- added NWFPE glue code fix
* Tue Mar 07 2006 - schwab(a)suse.de
- More fixes for ia64 port.
* Mon Mar 06 2006 - schwab(a)suse.de
++++++ qemu-0.7.0-sigaltstackhack.patch ++++++
--- 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
*/
++++++ qemu-0.7.1-armfpaex.patch ++++++
--- linux-user/main.c
+++ linux-user/main.c
@@ -339,18 +339,54 @@
{
TaskState *ts = env->opaque;
uint32_t opcode;
+ int rc;
/* we handle the FPU emulation here, as Linux */
/* we get the opcode */
opcode = ldl_raw((uint8_t *)env->regs[15]);
- if (EmulateAll(opcode, &ts->fpa, env->regs) == 0) {
+ if ((rc=EmulateAll(opcode, &ts->fpa, env->regs)) == 0) { /* illegal instruction */
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN;
info._sifields._sigfault._addr = env->regs[15];
queue_signal(info.si_signo, &info);
- } else {
+ } else if (rc < 0) { /* FP exception */
+ int arm_fpe=0;
+ /* translate softfloat flags to FPSR flags */
+ if(-rc & float_flag_invalid) arm_fpe |= BIT_IOC;
+ if(-rc & float_flag_divbyzero) arm_fpe |= BIT_DZC;
+ if(-rc & float_flag_overflow) arm_fpe |= BIT_OFC;
+ if(-rc & float_flag_underflow) arm_fpe |= BIT_UFC;
+ if(-rc & float_flag_inexact) arm_fpe |= BIT_IXC;
+
+ FPSR fpsr = ts->fpa.fpsr;
+ //printf("fpsr 0x%x, arm_fpe 0x%x\n",fpsr,arm_fpe);
+
+ if(fpsr & (arm_fpe << 16)) /* exception enabled? */
+ {
+ info.si_signo = SIGFPE;
+ info.si_errno = 0;
+ /* ordered by priority, least first */
+ if(arm_fpe & BIT_IXC) info.si_code = TARGET_FPE_FLTRES;
+ if(arm_fpe & BIT_UFC) info.si_code = TARGET_FPE_FLTUND;
+ if(arm_fpe & BIT_OFC) info.si_code = TARGET_FPE_FLTOVF;
+ if(arm_fpe & BIT_DZC) info.si_code = TARGET_FPE_FLTDIV;
+ if(arm_fpe & BIT_IOC) info.si_code = TARGET_FPE_FLTINV;
+ info._sifields._sigfault._addr = env->regs[15];
+ queue_signal(info.si_signo, &info);
+ }
+ else
+ env->regs[15] += 4;
+
+ /* accumulate unenabled exceptions */
+ if((!(fpsr & BIT_IXE)) && (arm_fpe & BIT_IXC)) fpsr |= BIT_IXC;
+ if((!(fpsr & BIT_UFE)) && (arm_fpe & BIT_UFC)) fpsr |= BIT_UFC;
+ if((!(fpsr & BIT_OFE)) && (arm_fpe & BIT_OFC)) fpsr |= BIT_OFC;
+ if((!(fpsr & BIT_DZE)) && (arm_fpe & BIT_DZC)) fpsr |= BIT_DZC;
+ if((!(fpsr & BIT_IOE)) && (arm_fpe & BIT_IOC)) fpsr |= BIT_IOC;
+ ts->fpa.fpsr=fpsr;
+ } else { /* everything OK */
/* increment PC */
env->regs[15] += 4;
}
--- target-arm/nwfpe/fpa11.c
+++ target-arm/nwfpe/fpa11.c
@@ -161,6 +161,8 @@
fpa11->initflag = 1;
}
+ set_float_exception_flags(0, &fpa11->fp_status);
+
if (TEST_OPCODE(opcode,MASK_CPRT))
{
//fprintf(stderr,"emulating CPRT\n");
@@ -190,6 +192,11 @@
}
// restore_flags(flags);
+ if(nRc == 1 && get_float_exception_flags(&fpa11->fp_status))
+ {
+ //printf("fef 0x%x\n",float_exception_flags);
+ nRc=-get_float_exception_flags(&fpa11->fp_status);
+ }
//printf("returning %d\n",nRc);
return(nRc);
++++++ qemu-0.7.1-jobsignals.patch ++++++
--- linux-user/signal.c
+++ linux-user/signal.c
@@ -341,10 +341,15 @@
k = &sigact_table[sig - 1];
handler = k->sa._sa_handler;
if (handler == TARGET_SIG_DFL) {
+ if (sig == TARGET_SIGTSTP || sig == TARGET_SIGTTIN || sig == TARGET_SIGTTOU) {
+ kill(getpid(),SIGSTOP);
+ return 0;
+ } else
/* default handler : ignore some signal. The other are fatal */
if (sig != TARGET_SIGCHLD &&
sig != TARGET_SIGURG &&
- sig != TARGET_SIGWINCH) {
+ sig != TARGET_SIGWINCH &&
+ sig != TARGET_SIGCONT) {
force_sig(sig);
} else {
return 0; /* indicate ignored */
++++++ qemu-0.7.1-syscalls.patch ++++++
--- linux-user/arm/syscall_nr.h
+++ linux-user/arm/syscall_nr.h
@@ -259,4 +259,5 @@
/* 254 for set_thread_area */
/* 255 for get_thread_area */
/* 256 for set_tid_address */
+#define TARGET_NR_clock_gettime (263)
#define TARGET_NR_utimes (269)
--- linux-user/syscall.c
+++ linux-user/syscall.c
@@ -207,6 +207,7 @@
#define __NR_sys_getdents __NR_getdents
#define __NR_sys_getdents64 __NR_getdents64
#define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#define __NR_sys_syslog __NR_syslog
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -228,6 +229,7 @@
_syscall2(int,sys_statfs,const char *,path,struct kernel_statfs *,buf)
_syscall2(int,sys_fstatfs,int,fd,struct kernel_statfs *,buf)
_syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)
+_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -241,6 +243,7 @@
extern int setresgid(gid_t, gid_t, gid_t);
extern int getresgid(gid_t *, gid_t *, gid_t *);
extern int setgroups(int, gid_t *);
+extern int uselib(const char*);
static inline long get_errno(long ret)
{
@@ -1895,7 +1898,9 @@
goto unimplemented;
case TARGET_NR_acct:
- goto unimplemented;
+ ret = get_errno(acct(path((const char*)arg1)));
+ break;
+
case TARGET_NR_umount2:
ret = get_errno(umount2((const char *)arg1, arg2));
break;
@@ -2207,7 +2212,9 @@
ret = get_errno(readlink(path((const char *)arg1), (char *)arg2, arg3));
break;
case TARGET_NR_uselib:
- goto unimplemented;
+ ret = get_errno(uselib(path((const char*)arg1)));
+ break;
+
case TARGET_NR_swapon:
ret = get_errno(swapon((const char *)arg1, arg2));
break;
@@ -2322,7 +2329,9 @@
ret = do_socketcall(arg1, (int32_t *)arg2);
break;
case TARGET_NR_syslog:
- goto unimplemented;
+ ret = get_errno(sys_syslog((int)arg1, (char*)arg2, (int)arg3));
+ break;
+
case TARGET_NR_setitimer:
{
struct target_itimerval *target_value = (void *)arg2;
@@ -3116,11 +3125,14 @@
goto unimplemented;
#ifdef TARGET_NR_mincore
case TARGET_NR_mincore:
- goto unimplemented;
+ page_unprotect_range((void*)arg3, ((size_t)arg2 + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE);
+ ret = get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned char*)arg3));
+ break;
#endif
#ifdef TARGET_NR_madvise
case TARGET_NR_madvise:
- goto unimplemented;
+ ret = get_errno(madvise((void*)arg1, (size_t)arg2, (int)arg3));
+ break;
#endif
#if TARGET_LONG_BITS == 32
case TARGET_NR_fcntl64:
@@ -3169,7 +3181,8 @@
ret = get_errno(gettid());
break;
case TARGET_NR_readahead:
- goto unimplemented;
+ ret = get_errno(readahead((int)arg1, (off64_t)arg2, (size_t)arg3));
+ break;
#ifdef TARGET_NR_setxattr
case TARGET_NR_setxattr:
case TARGET_NR_lsetxattr:
@@ -3190,6 +3203,22 @@
case TARGET_NR_get_thread_area:
goto unimplemented_nowarn;
#endif
+#ifdef TARGET_NR_clock_gettime
+ case TARGET_NR_clock_gettime:
+ {
+ struct target_timespec* ttp = (struct target_timespec*)arg2;
+ struct timespec htp;
+ if(ttp) {
+ htp.tv_sec = tswapl(ttp->tv_sec);
+ htp.tv_nsec = tswapl(ttp->tv_nsec);
+ ret = get_errno(clock_gettime((clockid_t)arg1, &htp));
+ ttp->tv_sec = tswapl(htp.tv_sec);
+ ttp->tv_nsec = tswapl(htp.tv_nsec);
+ } else
+ ret = get_errno(clock_gettime((clockid_t)arg1, NULL));
+ break;
+ }
+#endif
default:
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
++++++ qemu-0.7.1.patch ++++++
--- /var/tmp/diff_new_pack.rbVeOz/_old 2006-05-29 18:11:43.000000000 +0200
+++ /var/tmp/diff_new_pack.rbVeOz/_new 2006-05-29 18:11:43.000000000 +0200
@@ -22,92 +22,8 @@
ifndef CONFIG_USER_ONLY
LIBS+=-lz
endif
---- linux-user/arm/syscall_nr.h
-+++ linux-user/arm/syscall_nr.h
-@@ -259,4 +259,5 @@
- /* 254 for set_thread_area */
- /* 255 for get_thread_area */
- /* 256 for set_tid_address */
-+#define TARGET_NR_clock_gettime (263)
- #define TARGET_NR_utimes (269)
---- linux-user/main.c
-+++ linux-user/main.c
-@@ -339,18 +339,54 @@
- {
- TaskState *ts = env->opaque;
- uint32_t opcode;
-+ int rc;
-
- /* we handle the FPU emulation here, as Linux */
- /* we get the opcode */
- opcode = ldl_raw((uint8_t *)env->regs[15]);
-
-- if (EmulateAll(opcode, &ts->fpa, env->regs) == 0) {
-+ if ((rc=EmulateAll(opcode, &ts->fpa, env->regs)) == 0) { /* illegal instruction */
- info.si_signo = SIGILL;
- info.si_errno = 0;
- info.si_code = TARGET_ILL_ILLOPN;
- info._sifields._sigfault._addr = env->regs[15];
- queue_signal(info.si_signo, &info);
-- } else {
-+ } else if (rc < 0) { /* FP exception */
-+ int arm_fpe=0;
-+ /* translate softfloat flags to FPSR flags */
-+ if(-rc & float_flag_invalid) arm_fpe |= BIT_IOC;
-+ if(-rc & float_flag_divbyzero) arm_fpe |= BIT_DZC;
-+ if(-rc & float_flag_overflow) arm_fpe |= BIT_OFC;
-+ if(-rc & float_flag_underflow) arm_fpe |= BIT_UFC;
-+ if(-rc & float_flag_inexact) arm_fpe |= BIT_IXC;
-+
-+ FPSR fpsr = ts->fpa.fpsr;
-+ //printf("fpsr 0x%x, arm_fpe 0x%x\n",fpsr,arm_fpe);
-+
-+ if(fpsr & (arm_fpe << 16)) /* exception enabled? */
-+ {
-+ info.si_signo = SIGFPE;
-+ info.si_errno = 0;
-+ /* ordered by priority, least first */
-+ if(arm_fpe & BIT_IXC) info.si_code = TARGET_FPE_FLTRES;
-+ if(arm_fpe & BIT_UFC) info.si_code = TARGET_FPE_FLTUND;
-+ if(arm_fpe & BIT_OFC) info.si_code = TARGET_FPE_FLTOVF;
-+ if(arm_fpe & BIT_DZC) info.si_code = TARGET_FPE_FLTDIV;
-+ if(arm_fpe & BIT_IOC) info.si_code = TARGET_FPE_FLTINV;
-+ info._sifields._sigfault._addr = env->regs[15];
-+ queue_signal(info.si_signo, &info);
-+ }
-+ else
-+ env->regs[15] += 4;
-+
-+ /* accumulate unenabled exceptions */
-+ if((!(fpsr & BIT_IXE)) && (arm_fpe & BIT_IXC)) fpsr |= BIT_IXC;
-+ if((!(fpsr & BIT_UFE)) && (arm_fpe & BIT_UFC)) fpsr |= BIT_UFC;
-+ if((!(fpsr & BIT_OFE)) && (arm_fpe & BIT_OFC)) fpsr |= BIT_OFC;
-+ if((!(fpsr & BIT_DZE)) && (arm_fpe & BIT_DZC)) fpsr |= BIT_DZC;
-+ if((!(fpsr & BIT_IOE)) && (arm_fpe & BIT_IOC)) fpsr |= BIT_IOC;
-+ ts->fpa.fpsr=fpsr;
-+ } else { /* everything OK */
- /* increment PC */
- env->regs[15] += 4;
- }
--- linux-user/signal.c
+++ linux-user/signal.c
-@@ -341,10 +341,15 @@
- k = &sigact_table[sig - 1];
- handler = k->sa._sa_handler;
- if (handler == TARGET_SIG_DFL) {
-+ if (sig == TARGET_SIGTSTP || sig == TARGET_SIGTTIN || sig == TARGET_SIGTTOU) {
-+ kill(getpid(),SIGSTOP);
-+ return 0;
-+ } else
- /* default handler : ignore some signal. The other are fatal */
- if (sig != TARGET_SIGCHLD &&
- sig != TARGET_SIGURG &&
-- sig != TARGET_SIGWINCH) {
-+ sig != TARGET_SIGWINCH &&
-+ sig != TARGET_SIGCONT) {
- force_sig(sig);
- } else {
- return 0; /* indicate ignored */
@@ -389,6 +394,8 @@
{
int sig;
@@ -117,170 +33,3 @@
/* the CPU emulator uses some host signals to detect exceptions,
we we forward to it some signals */
-@@ -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
- */
---- linux-user/syscall.c
-+++ linux-user/syscall.c
-@@ -207,6 +207,7 @@
- #define __NR_sys_getdents __NR_getdents
- #define __NR_sys_getdents64 __NR_getdents64
- #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
-+#define __NR_sys_syslog __NR_syslog
-
- #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
- #define __NR__llseek __NR_lseek
-@@ -228,6 +229,7 @@
- _syscall2(int,sys_statfs,const char *,path,struct kernel_statfs *,buf)
- _syscall2(int,sys_fstatfs,int,fd,struct kernel_statfs *,buf)
- _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)
-+_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
- #ifdef __NR_exit_group
- _syscall1(int,exit_group,int,error_code)
- #endif
-@@ -241,6 +243,7 @@
- extern int setresgid(gid_t, gid_t, gid_t);
- extern int getresgid(gid_t *, gid_t *, gid_t *);
- extern int setgroups(int, gid_t *);
-+extern int uselib(const char*);
-
- static inline long get_errno(long ret)
- {
-@@ -1895,7 +1898,9 @@
- goto unimplemented;
-
- case TARGET_NR_acct:
-- goto unimplemented;
-+ ret = get_errno(acct(path((const char*)arg1)));
-+ break;
-+
- case TARGET_NR_umount2:
- ret = get_errno(umount2((const char *)arg1, arg2));
- break;
-@@ -2207,7 +2212,9 @@
- ret = get_errno(readlink(path((const char *)arg1), (char *)arg2, arg3));
- break;
- case TARGET_NR_uselib:
-- goto unimplemented;
-+ ret = get_errno(uselib(path((const char*)arg1)));
-+ break;
-+
- case TARGET_NR_swapon:
- ret = get_errno(swapon((const char *)arg1, arg2));
- break;
-@@ -2322,7 +2329,9 @@
- ret = do_socketcall(arg1, (int32_t *)arg2);
- break;
- case TARGET_NR_syslog:
-- goto unimplemented;
-+ ret = get_errno(sys_syslog((int)arg1, (char*)arg2, (int)arg3));
-+ break;
-+
- case TARGET_NR_setitimer:
- {
- struct target_itimerval *target_value = (void *)arg2;
-@@ -3116,11 +3125,14 @@
- goto unimplemented;
- #ifdef TARGET_NR_mincore
- case TARGET_NR_mincore:
-- goto unimplemented;
-+ page_unprotect_range((void*)arg3, ((size_t)arg2 + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE);
-+ ret = get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned char*)arg3));
-+ break;
- #endif
- #ifdef TARGET_NR_madvise
- case TARGET_NR_madvise:
-- goto unimplemented;
-+ ret = get_errno(madvise((void*)arg1, (size_t)arg2, (int)arg3));
-+ break;
- #endif
- #if TARGET_LONG_BITS == 32
- case TARGET_NR_fcntl64:
-@@ -3169,7 +3181,8 @@
- ret = get_errno(gettid());
- break;
- case TARGET_NR_readahead:
-- goto unimplemented;
-+ ret = get_errno(readahead((int)arg1, (off64_t)arg2, (size_t)arg3));
-+ break;
- #ifdef TARGET_NR_setxattr
- case TARGET_NR_setxattr:
- case TARGET_NR_lsetxattr:
-@@ -3190,6 +3203,22 @@
- case TARGET_NR_get_thread_area:
- goto unimplemented_nowarn;
- #endif
-+#ifdef TARGET_NR_clock_gettime
-+ case TARGET_NR_clock_gettime:
-+ {
-+ struct target_timespec* ttp = (struct target_timespec*)arg2;
-+ struct timespec htp;
-+ if(ttp) {
-+ htp.tv_sec = tswapl(ttp->tv_sec);
-+ htp.tv_nsec = tswapl(ttp->tv_nsec);
-+ ret = get_errno(clock_gettime((clockid_t)arg1, &htp));
-+ ttp->tv_sec = tswapl(htp.tv_sec);
-+ ttp->tv_nsec = tswapl(htp.tv_nsec);
-+ } else
-+ ret = get_errno(clock_gettime((clockid_t)arg1, NULL));
-+ break;
-+ }
-+#endif
- default:
- unimplemented:
- gemu_log("qemu: Unsupported syscall: %d\n", num);
---- target-arm/nwfpe/fpa11.c
-+++ target-arm/nwfpe/fpa11.c
-@@ -161,6 +161,8 @@
- fpa11->initflag = 1;
- }
-
-+ set_float_exception_flags(0, &fpa11->fp_status);
-+
- if (TEST_OPCODE(opcode,MASK_CPRT))
- {
- //fprintf(stderr,"emulating CPRT\n");
-@@ -190,6 +192,11 @@
- }
-
- // restore_flags(flags);
-+ if(nRc == 1 && get_float_exception_flags(&fpa11->fp_status))
-+ {
-+ //printf("fef 0x%x\n",float_exception_flags);
-+ nRc=-get_float_exception_flags(&fpa11->fp_status);
-+ }
-
- //printf("returning %d\n",nRc);
- return(nRc);
++++++ qemu-0.8.0-usbdevice_fs.patch ++++++
--- usb-linux.c
+++ usb-linux.c 2006/05/29 11:02:15
@@ -26,7 +26,9 @@
#if defined(__linux__)
#include <dirent.h>
#include <sys/ioctl.h>
+#define __user
#include <linux/usbdevice_fs.h>
+#undef __user
#include <linux/version.h>
/* We redefine it to avoid version problems */
++++++ qemu-nwfpe-cpsr.patch ++++++
--- qemu-0.8.0/linux-user/main.c
+++ qemu-0.8.0/linux-user/main.c
@@ -346,7 +346,7 @@
/* we get the opcode */
opcode = ldl_raw((uint8_t *)env->regs[15]);
- if ((rc=EmulateAll(opcode, &ts->fpa, env->regs)) == 0) { /* illegal instruction */
+ if ((rc=EmulateAll(opcode, &ts->fpa, env)) == 0) { /* illegal instruction */
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = TARGET_ILL_ILLOPN;
--- qemu-0.8.0/target-arm/nwfpe/fpa11.c
+++ qemu-0.8.0/target-arm/nwfpe/fpa11.c
@@ -36,7 +36,7 @@
unsigned int EmulateCPRT(const unsigned int);
FPA11* qemufpa=0;
-unsigned int* user_registers=0;
+CPUARMState* user_registers=0;
/* Reset the FPA11 chip. Called to initialize and reset the emulator. */
void resetFPA11(void)
@@ -137,7 +137,7 @@
}
/* Emulate the instruction in the opcode. */
-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, unsigned int* qregs)
+unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs)
{
unsigned int nRc = 0;
// unsigned long flags;
--- qemu-0.8.0/target-arm/nwfpe/fpa11.h
+++ qemu-0.8.0/target-arm/nwfpe/fpa11.h
@@ -26,6 +26,8 @@
#include <stdio.h>
#include <errno.h>
+#include <cpu.h>
+
#define GET_FPA11() (qemufpa)
/*
@@ -33,7 +35,7 @@
* stack+task struct. Use the same method as 'current' uses to
* reach them.
*/
-extern unsigned int *user_registers;
+extern CPUARMState *user_registers;
#define GET_USERREG() (user_registers)
@@ -94,7 +96,7 @@
static inline unsigned int readRegister(unsigned int reg)
{
- return (user_registers[(reg)]);
+ return (user_registers->regs[(reg)]);
}
static inline void writeRegister(unsigned int x, unsigned int y)
@@ -102,34 +104,17 @@
#if 0
printf("writing %d to r%d\n",y,x);
#endif
- user_registers[(x)]=(y);
+ user_registers->regs[(x)]=(y);
}
static inline void writeConditionCodes(unsigned int x)
{
-#if 0
-unsigned int y;
-unsigned int ZF;
- printf("setting flags to %x from %x\n",x,user_registers[16]);
-#endif
- user_registers[16]=(x); // cpsr
- user_registers[17]=(x>>29)&1; // cf
- user_registers[18]=(x<<3)&(1<<31); // vf
- user_registers[19]=x&(1<<31); // nzf
- if(!(x&(1<<30))) user_registers[19]++; // nzf must be non-zero for zf to be cleared
-
-#if 0
- ZF = (user_registers[19] == 0);
- y=user_registers[16] | (user_registers[19] & 0x80000000) | (ZF << 30) |
- (user_registers[17] << 29) | ((user_registers[18] & 0x80000000) >> 3);
- if(y != x)
- printf("GODDAM SHIIIIIIIIIIIIIIIIT! %x %x nzf %x zf %x\n",x,y,user_registers[19],ZF);
-#endif
+ cpsr_write(user_registers,x,~CPSR_M);
}
#define REG_PC 15
-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, unsigned int* qregs);
+unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs);
/* included only for get_user/put_user macros */
#include "qemu.h"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...