Commit 417bf01068031468f9e95bdad928f368b1bc385d
1 parent
a9d9eb8f
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
Showing
2 changed files
with
16 additions
and
28 deletions
target-ppc/translate.c
... | ... | @@ -3297,16 +3297,17 @@ GEN_HANDLER(hrfid, 0x13, 0x12, 0x08, 0x03FF8001, PPC_64B) |
3297 | 3297 | #endif |
3298 | 3298 | |
3299 | 3299 | /* sc */ |
3300 | +#if defined(CONFIG_USER_ONLY) | |
3301 | +#define POWERPC_SYSCALL POWERPC_EXCP_SYSCALL_USER | |
3302 | +#else | |
3303 | +#define POWERPC_SYSCALL POWERPC_EXCP_SYSCALL | |
3304 | +#endif | |
3300 | 3305 | GEN_HANDLER(sc, 0x11, 0xFF, 0xFF, 0x03FFF01D, PPC_FLOW) |
3301 | 3306 | { |
3302 | 3307 | uint32_t lev; |
3303 | 3308 | |
3304 | 3309 | lev = (ctx->opcode >> 5) & 0x7F; |
3305 | -#if defined(CONFIG_USER_ONLY) | |
3306 | - GEN_EXCP(ctx, POWERPC_EXCP_SYSCALL_USER, lev); | |
3307 | -#else | |
3308 | - GEN_EXCP(ctx, POWERPC_EXCP_SYSCALL, lev); | |
3309 | -#endif | |
3310 | + GEN_EXCP(ctx, POWERPC_SYSCALL, lev); | |
3310 | 3311 | } |
3311 | 3312 | |
3312 | 3313 | /*** Trap ***/ |
... | ... | @@ -6830,11 +6831,7 @@ static always_inline int gen_intermediate_code_internal (CPUState *env, |
6830 | 6831 | } else if (unlikely(single_step != 0 && |
6831 | 6832 | (ctx.nip <= 0x100 || ctx.nip > 0xF00 || |
6832 | 6833 | (ctx.nip & 0xFC) != 0x04) && |
6833 | -#if defined(CONFIG_USER_ONLY) | |
6834 | - ctx.exception != POWERPC_EXCP_SYSCALL_USER && | |
6835 | -#else | |
6836 | - ctx.exception != POWERPC_EXCP_SYSCALL && | |
6837 | -#endif | |
6834 | + ctx.exception != POWERPC_SYSCALL && | |
6838 | 6835 | ctx.exception != POWERPC_EXCP_TRAP)) { |
6839 | 6836 | GEN_EXCP(ctxp, POWERPC_EXCP_TRACE, 0); |
6840 | 6837 | } else if (unlikely(((ctx.nip & (TARGET_PAGE_SIZE - 1)) == 0) || | ... | ... |
target-ppc/translate_init.c
... | ... | @@ -4024,6 +4024,12 @@ static void init_proc_7455 (CPUPPCState *env) |
4024 | 4024 | #define POWERPC_BFDM_970 (bfd_mach_ppc64) |
4025 | 4025 | #define POWERPC_FLAG_970 (POWERPC_FLAG_VRE) |
4026 | 4026 | |
4027 | +#if defined(CONFIG_USER_ONLY) | |
4028 | +#define POWERPC970_HID5_INIT 0x00000080 | |
4029 | +#else | |
4030 | +#define POWERPC970_HID5_INIT 0x00000000 | |
4031 | +#endif | |
4032 | + | |
4027 | 4033 | static void init_proc_970 (CPUPPCState *env) |
4028 | 4034 | { |
4029 | 4035 | gen_spr_ne_601(env); |
... | ... | @@ -4050,12 +4056,7 @@ static void init_proc_970 (CPUPPCState *env) |
4050 | 4056 | spr_register(env, SPR_970_HID5, "HID5", |
4051 | 4057 | SPR_NOACCESS, SPR_NOACCESS, |
4052 | 4058 | &spr_read_generic, &spr_write_generic, |
4053 | -#if defined(CONFIG_USER_ONLY) | |
4054 | - 0x00000080 | |
4055 | -#else | |
4056 | - 0x00000000 | |
4057 | -#endif | |
4058 | - ); | |
4059 | + POWERPC970_HID5_INIT); | |
4059 | 4060 | /* Memory management */ |
4060 | 4061 | /* XXX: not correct */ |
4061 | 4062 | gen_low_BATs(env); |
... | ... | @@ -4123,12 +4124,7 @@ static void init_proc_970FX (CPUPPCState *env) |
4123 | 4124 | spr_register(env, SPR_970_HID5, "HID5", |
4124 | 4125 | SPR_NOACCESS, SPR_NOACCESS, |
4125 | 4126 | &spr_read_generic, &spr_write_generic, |
4126 | -#if defined(CONFIG_USER_ONLY) | |
4127 | - 0x00000080 | |
4128 | -#else | |
4129 | - 0x00000000 | |
4130 | -#endif | |
4131 | - ); | |
4127 | + POWERPC970_HID5_INIT); | |
4132 | 4128 | /* Memory management */ |
4133 | 4129 | /* XXX: not correct */ |
4134 | 4130 | gen_low_BATs(env); |
... | ... | @@ -4196,12 +4192,7 @@ static void init_proc_970GX (CPUPPCState *env) |
4196 | 4192 | spr_register(env, SPR_970_HID5, "HID5", |
4197 | 4193 | SPR_NOACCESS, SPR_NOACCESS, |
4198 | 4194 | &spr_read_generic, &spr_write_generic, |
4199 | -#if defined(CONFIG_USER_ONLY) | |
4200 | - 0x00000080 | |
4201 | -#else | |
4202 | - 0x00000000 | |
4203 | -#endif | |
4204 | - ); | |
4195 | + POWERPC970_HID5_INIT); | |
4205 | 4196 | /* Memory management */ |
4206 | 4197 | /* XXX: not correct */ |
4207 | 4198 | gen_low_BATs(env); | ... | ... |