From 417bf01068031468f9e95bdad928f368b1bc385d Mon Sep 17 00:00:00 2001 From: j_mayer Date: Sun, 7 Oct 2007 23:10:08 +0000 Subject: Work-around C89 and/or "old" gcc unspecified behavior (#if in macro calls). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3350 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/translate.c | 17 +++++++---------- target-ppc/translate_init.c | 27 +++++++++------------------ 2 files changed, 16 insertions(+), 28 deletions(-) (limited to 'target-ppc') diff --git a/target-ppc/translate.c b/target-ppc/translate.c index a17066341d..eb795fb6f5 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -3297,16 +3297,17 @@ GEN_HANDLER(hrfid, 0x13, 0x12, 0x08, 0x03FF8001, PPC_64B) #endif /* sc */ +#if defined(CONFIG_USER_ONLY) +#define POWERPC_SYSCALL POWERPC_EXCP_SYSCALL_USER +#else +#define POWERPC_SYSCALL POWERPC_EXCP_SYSCALL +#endif GEN_HANDLER(sc, 0x11, 0xFF, 0xFF, 0x03FFF01D, PPC_FLOW) { uint32_t lev; lev = (ctx->opcode >> 5) & 0x7F; -#if defined(CONFIG_USER_ONLY) - GEN_EXCP(ctx, POWERPC_EXCP_SYSCALL_USER, lev); -#else - GEN_EXCP(ctx, POWERPC_EXCP_SYSCALL, lev); -#endif + GEN_EXCP(ctx, POWERPC_SYSCALL, lev); } /*** Trap ***/ @@ -6830,11 +6831,7 @@ static always_inline int gen_intermediate_code_internal (CPUState *env, } else if (unlikely(single_step != 0 && (ctx.nip <= 0x100 || ctx.nip > 0xF00 || (ctx.nip & 0xFC) != 0x04) && -#if defined(CONFIG_USER_ONLY) - ctx.exception != POWERPC_EXCP_SYSCALL_USER && -#else - ctx.exception != POWERPC_EXCP_SYSCALL && -#endif + ctx.exception != POWERPC_SYSCALL && ctx.exception != POWERPC_EXCP_TRAP)) { GEN_EXCP(ctxp, POWERPC_EXCP_TRACE, 0); } else if (unlikely(((ctx.nip & (TARGET_PAGE_SIZE - 1)) == 0) || diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index edff5cd90a..7ba9b1965b 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -4024,6 +4024,12 @@ static void init_proc_7455 (CPUPPCState *env) #define POWERPC_BFDM_970 (bfd_mach_ppc64) #define POWERPC_FLAG_970 (POWERPC_FLAG_VRE) +#if defined(CONFIG_USER_ONLY) +#define POWERPC970_HID5_INIT 0x00000080 +#else +#define POWERPC970_HID5_INIT 0x00000000 +#endif + static void init_proc_970 (CPUPPCState *env) { gen_spr_ne_601(env); @@ -4050,12 +4056,7 @@ static void init_proc_970 (CPUPPCState *env) spr_register(env, SPR_970_HID5, "HID5", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, -#if defined(CONFIG_USER_ONLY) - 0x00000080 -#else - 0x00000000 -#endif - ); + POWERPC970_HID5_INIT); /* Memory management */ /* XXX: not correct */ gen_low_BATs(env); @@ -4123,12 +4124,7 @@ static void init_proc_970FX (CPUPPCState *env) spr_register(env, SPR_970_HID5, "HID5", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, -#if defined(CONFIG_USER_ONLY) - 0x00000080 -#else - 0x00000000 -#endif - ); + POWERPC970_HID5_INIT); /* Memory management */ /* XXX: not correct */ gen_low_BATs(env); @@ -4196,12 +4192,7 @@ static void init_proc_970GX (CPUPPCState *env) spr_register(env, SPR_970_HID5, "HID5", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, -#if defined(CONFIG_USER_ONLY) - 0x00000080 -#else - 0x00000000 -#endif - ); + POWERPC970_HID5_INIT); /* Memory management */ /* XXX: not correct */ gen_low_BATs(env); -- cgit v1.2.3