unicore32: necessary modifications for other files to support unicore32
PATCH 3/3 unicore32: necessary modifications for other files to support unicore32
unicore32: necessary modifications for other files to support unicore32
Signed-off-by Guan Xuetao <[email protected]>
--- configure | 11 +++- cpu-exec.c | 12 ++++- default-configs/unicore32-linux-user.mak | 1 + elf.h | 2 + fpu/softfloat-specialize.h | 10 ++-- linux-user/elfload.c | 74 +++++++++++++++++++++++++ linux-user/main.c | 89 +++++++++++++++++++++++++++++- linux-user/qemu.h | 5 +- linux-user/syscall_defs.h | 10 ++- 9 files changed, 201 insertions(+), 13 deletions(-) create mode 100644 default-configs/unicore32-linux-user.mak
configure +9 -2
@@ -280,7 +280,7 @@ else fi case "$cpu" in - alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64) + alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64|unicore32) cpu="$cpu" ;; i386|i486|i586|i686|i86pc|BePC)
@@ -793,6 +793,9 @@ case "$cpu" in hppa*) host_guest_base="yes" ;; + unicore32*) + host_guest_base="yes" + ;; esac [ -z "$guest_base" ] && guest_base="$host_guest_base"
@@ -1018,6 +1021,7 @@ sh4eb-linux-user \ sparc-linux-user \ sparc64-linux-user \ sparc32plus-linux-user \ +unicore32-linux-user \ " fi # the following are Darwin specific
@@ -2495,7 +2499,7 @@ echo "docdir=$docdir" >> $config_host_mak echo "confdir=$confdir" >> $config_host_mak case "$cpu" in - i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) + i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64|unicore32) ARCH=$cpu ;; armv4b|armv4l)
@@ -3007,6 +3011,9 @@ case "$target_arch2" in s390x) target_phys_bits=64 ;; + unicore32) + target_phys_bits=32 + ;; *) echo "Unsupported target CPU" exit 1
cpu-exec.c +11 -1
@@ -262,6 +262,7 @@ int cpu_exec(CPUState *env1) env->cc_x = (env->sr >>4 ) &1 ;#elif defined(TARGET_ALPHA )#elif defined(TARGET_ARM ) +#elif defined(TARGET_UNICORE32 )#elif defined(TARGET_PPC )#elif defined(TARGET_MICROBLAZE )#elif defined(TARGET_MIPS )
@@ -326,6 +327,8 @@ int cpu_exec(CPUState *env1)do_interrupt (env);#elif defined(TARGET_ARM )do_interrupt (env); +#elif defined(TARGET_UNICORE32 ) +do_interrupt (env);#elif defined(TARGET_SH4 )do_interrupt (env);#elif defined(TARGET_ALPHA )
@@ -363,7 +366,7 @@ int cpu_exec(CPUState *env1) }#if defined(TARGET_ARM ) || defined(TARGET_SPARC ) || defined(TARGET_MIPS ) || \ defined(TARGET_PPC ) || defined(TARGET_ALPHA ) || defined(TARGET_CRIS ) || \ - defined(TARGET_MICROBLAZE ) + defined(TARGET_MICROBLAZE ) || defined(TARGET_UNICORE32 )if (interrupt_request &CPU_INTERRUPT_HALT ) { env->interrupt_request &= ~CPU_INTERRUPT_HALT ; env->halted =1 ;
@@ -503,6 +506,12 @@ int cpu_exec(CPUState *env1)do_interrupt (env); next_tb = 0; } +#elif defined(TARGET_UNICORE32) +if (interrupt_request &CPU_INTERRUPT_HARD + && !(env->uncached_asr &ASR_I )) { +do_interrupt (env); + next_tb =0 ; + }#elif defined(TARGET_SH4)if (interrupt_request &CPU_INTERRUPT_HARD ) {do_interrupt (env);
@@ -653,6 +662,7 @@ int cpu_exec(CPUState *env1) env->eflags = env->eflags |helper_cc_compute_all (CC_OP ) | (DF &DF_MASK );#elif defined(TARGET_ARM )/* XXX: Save/restore host fpu exception state?. */ +#elif defined(TARGET_UNICORE32 )#elif defined(TARGET_SPARC )#elif defined(TARGET_PPC )#elif defined(TARGET_M68K )
default-configs/unicore32-linux-user.mak new file +1 -0
@@ -0,0 +1 @@ +# Default configuration for unicore32-linux-user
elf.h +2 -0
@@ -105,6 +105,8 @@ typedef int64_t Elf64_Sxword;#define EM_H8_300H 47/* Hitachi H8/300H */ #define EM_H8S 48/* Hitachi H8S */ +#define EM_UNICORE32 110/* UniCore32 */ +/* * This is an interim value that we will use until the committee comes * up with a final number.
fpu/softfloat-specialize.h +5 -5
@@ -30,7 +30,7 @@ these four paragraphs for those parts of this code that are retained.=============================================================================*/ -#if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) +#if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) || defined(TARGET_UNICORE32 )#define SNAN_BIT_IS_ONE 1#else #define SNAN_BIT_IS_ONE 0
@@ -108,7 +108,7 @@ float32 float32_maybe_silence_nan( float32 a_ ) {if (float32_is_signaling_nan (a_)) {#if SNAN_BIT_IS_ONE -# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) +# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) || defined(TARGET_UNICORE32 )return float32_default_nan;# else # error Rules for silencing a signaling NaN are target-specific
@@ -362,7 +362,7 @@ float64 float64_maybe_silence_nan( float64 a_ ) {if (float64_is_signaling_nan (a_)) {#if SNAN_BIT_IS_ONE -# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) +# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) || defined(TARGET_UNICORE32 )return float64_default_nan;# else # error Rules for silencing a signaling NaN are target-specific
@@ -519,7 +519,7 @@ floatx80 floatx80_maybe_silence_nan( floatx80 a ) {if (floatx80_is_signaling_nan (a)) {#if SNAN_BIT_IS_ONE -# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) +# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) || defined(TARGET_UNICORE32 ) a.low = floatx80_default_nan_low; a.high = floatx80_default_nan_high;# else
@@ -668,7 +668,7 @@ float128 float128_maybe_silence_nan( float128 a ) {if (float128_is_signaling_nan (a)) {#if SNAN_BIT_IS_ONE -# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) +# if defined(TARGET_MIPS ) || defined(TARGET_SH4 ) || defined(TARGET_UNICORE32 ) a.low = float128_default_nan_low; a.high = float128_default_nan_high;# else
linux-user/elfload.c +74 -0
80 lines not on this page · raw message
linux-user/main.c +88 -1
113 lines not on this page · raw message
linux-user/qemu.h +4 -1
@@ -98,6 +98,9 @@ typedef struct TaskState {FPA11 fpa;int swi_errno;#endif +#ifdef TARGET_UNICORE32 +int swi_errno; +#endif #if defined(TARGET_I386 ) && !defined(TARGET_X86_64 )abi_ulong target_v86;struct vm86_saved_state vm86_saved_regs;
@@ -111,7 +114,7 @@ typedef struct TaskState {#ifdef TARGET_M68K int sim_syscalls;#endif -#if defined(TARGET_ARM ) || defined(TARGET_M68K ) +#if defined(TARGET_ARM ) || defined(TARGET_M68K ) || defined(TARGET_UNICORE32 )/* Extra fields for semihosted binaries. */ uint32_t stack_base;uint32_t heap_base;
linux-user/syscall_defs.h +1 -2
@@ -55,7 +55,7 @@#endif #if defined(TARGET_I386 ) || defined(TARGET_ARM ) || defined(TARGET_SH4 ) \ - || defined(TARGET_M68K ) || defined(TARGET_CRIS ) + || defined(TARGET_M68K ) || defined(TARGET_CRIS ) || defined(TARGET_UNICORE32 )#define TARGET_IOC_SIZEBITS 14#define TARGET_IOC_DIRBITS 2
@@ -315,7 +315,10 @@ struct target_sigaction;int do_sigaction (int sig,const struct target_sigaction *act,struct target_sigaction *oact); -#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_MIPS) || defined
(TARGET_SH4) || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS) || defined(TARGET_MICROBLAZE) +#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) \
+ || defined(TARGET_PPC) || defined(TARGET_MIPS) || defined(TARGET_SH4) \ + || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS) \ + || defined(TARGET_MICROBLAZE) || defined(TARGET_UNICORE32)
#if defined(TARGET_SPARC)
#define TARGET_SA_NOCLDSTOP 8u
@@ -1001,7 +1004,8 @@ struct target_winsize {
#define TARGET_MAP_NONBLOCK 0x10000 /* do not block on IO */
#endif
-#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || defined(TARGET_ARM) || defined(TARGET_CRIS) +#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || defined(TARGET_ARM) \
+ || defined(TARGET_CRIS) || defined(TARGET_UNICORE32)
struct target_stat {
unsigned short st_dev;
unsigned short __pad1;
Signature · 1 line
1.6.2.2