unicore32: necessary modifications for other files to support unicore32
PATCH v3 3/3 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 ++-- fpu/softfloat.h | 2 +- linux-user/elfload.c | 74 +++++++++++++++++++++++++ linux-user/main.c | 89 +++++++++++++++++++++++++++++- linux-user/qemu.h | 5 +- linux-user/syscall_defs.h | 10 ++- 10 files changed, 202 insertions(+), 14 deletions(-) create mode 100644 default-configs/unicore32-linux-user.mak
configure +9 -2
@@ -283,7 +283,7 @@ else fi case "$cpu" in - alpha|cris|ia64|lm32|m68k|microblaze|ppc|ppc64|sparc64) + alpha|cris|ia64|lm32|m68k|microblaze|ppc|ppc64|sparc64|unicore32) cpu="$cpu" ;; i386|i486|i586|i686|i86pc|BePC)
@@ -814,6 +814,9 @@ case "$cpu" in hppa*) host_guest_base="yes" ;; + unicore32*) + host_guest_base="yes" + ;; esac [ -z "$guest_base" ] && guest_base="$host_guest_base"
@@ -1048,6 +1051,7 @@ sh4eb-linux-user \ sparc-linux-user \ sparc64-linux-user \ sparc32plus-linux-user \ +unicore32-linux-user \ " fi # the following are Darwin specific
@@ -2633,7 +2637,7 @@ echo "docdir=$docdir" >> $config_host_mak echo "confdir=$confdir" >> $config_host_mak case "$cpu" in - i386|x86_64|alpha|cris|hppa|ia64|lm32|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) + i386|x86_64|alpha|cris|hppa|ia64|lm32|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64|unicore32) ARCH=$cpu ;; armv4b|armv4l)
@@ -3186,6 +3190,9 @@ case "$target_arch2" in target_phys_bits=64 target_long_alignment=8 ;; + unicore32) + target_phys_bits=32 + ;; *) echo "Unsupported target CPU" exit 1
cpu-exec.c +11 -1
@@ -267,6 +267,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_LM32 )#elif defined(TARGET_MICROBLAZE )
@@ -335,6 +336,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 )
@@ -367,7 +370,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_LM32 ) + defined(TARGET_MICROBLAZE ) || defined(TARGET_LM32 ) || defined(TARGET_UNICORE32 )if (interrupt_request &CPU_INTERRUPT_HALT ) { env->interrupt_request &= ~CPU_INTERRUPT_HALT ; env->halted =1 ;
@@ -514,6 +517,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);
@@ -664,6 +673,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_LM32 )
default-configs/unicore32-linux-user.mak new file +1 -0
@@ -0,0 +1 @@ +# Default configuration for unicore32-linux-user
elf.h +2 -0
@@ -106,6 +106,8 @@ typedef int64_t Elf64_Sxword;#define EM_H8S 48/* Hitachi H8S */ #define EM_LATTICEMICO32 138/* LatticeMico32 */ +#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
@@ -93,7 +93,7 @@ float16 float16_maybe_silence_nan(float16 a_) {if (float16_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 float16_default_nan;# else # error Rules for silencing a signaling NaN are target-specific
@@ -184,7 +184,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
@@ -430,7 +430,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
@@ -578,7 +578,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
@@ -721,7 +721,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
fpu/softfloat.h +1 -1
@@ -68,7 +68,7 @@ typedef int64_t int64;#define LIT64 ( a ) a##LL#define INLINE static inline -#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
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
@@ -105,6 +105,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;
@@ -118,7 +121,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
@@ -1002,7 +1005,8 @@ struct target_winsize {
#define TARGET_MAP_UNINITIALIZED 0x4000000 /* for anonymous mmap, memory could be uninitialized */
#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