From: Mike Frysinger Date: Thu, 17 Jun 2021 23:03:32 +0000 (-0400) Subject: sim: ppc: avoid "PAGE_SIZE" name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a49dd19e81deb6d6c4af0fcadd94be1574f0b7dc;p=binutils-gdb.git sim: ppc: avoid "PAGE_SIZE" name This define is used for a particular target and depends on the simulated CPU hardware. It has no relation to the host CPU that the sim is running on. So rename the common "PAGE_SIZE" here to better reflect its usage and avoid conflicts with system headers. --- diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 05178aa427b..280234af869 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +2021-06-17 Mike Frysinger + + * igen.c (gen_semantics_h): Rename PAGE_SIZE to MPC860C0_PAGE_SIZE. + * ppc-instructions: Likewise. + 2021-06-16 Mike Frysinger * configure.ac: Delete AC_EXEEXT call. diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 0bf3b58ca26..f0ff06b31c4 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -182,7 +182,7 @@ gen_semantics_h(insn_table *table, lf_printf(file, "\n"); if ((code & generate_calls)) { lf_printf(file, "extern int option_mpc860c0;\n"); - lf_printf(file, "#define PAGE_SIZE 0x1000\n"); + lf_printf(file, "#define MPC860C0_PAGE_SIZE 0x1000\n"); lf_printf(file, "\n"); lf_printf(file, "PSIM_EXTERN_SEMANTICS(void)\n"); lf_printf(file, "semantic_init(device* root);\n"); diff --git a/sim/ppc/ppc-instructions b/sim/ppc/ppc-instructions index 70aa04e2210..2278b626376 100644 --- a/sim/ppc/ppc-instructions +++ b/sim/ppc/ppc-instructions @@ -1537,7 +1537,7 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, If this is a forward branch and it is near the end of a page, we've detected a problematic branch. */ if (succeed && NIA > CIA) { - if (PAGE_SIZE - (CIA & (PAGE_SIZE-1)) <= option_mpc860c0) + if (MPC860C0_PAGE_SIZE - (CIA & (MPC860C0_PAGE_SIZE-1)) <= option_mpc860c0) program_interrupt(processor, cia, mpc860c0_instruction_program_interrupt); } } @@ -1579,7 +1579,7 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, If this is a forward branch and it is near the end of a page, we've detected a problematic branch. */ if (succeed && NIA > CIA) { - if (PAGE_SIZE - (CIA & (PAGE_SIZE-1)) <= option_mpc860c0) + if (MPC860C0_PAGE_SIZE - (CIA & (MPC860C0_PAGE_SIZE-1)) <= option_mpc860c0) program_interrupt(processor, cia, mpc860c0_instruction_program_interrupt); } } @@ -1610,7 +1610,7 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, If this is a forward branch and it is near the end of a page, we've detected a problematic branch. */ if (succeed && NIA > CIA) { - if (PAGE_SIZE - (CIA & (PAGE_SIZE-1)) <= option_mpc860c0) + if (MPC860C0_PAGE_SIZE - (CIA & (MPC860C0_PAGE_SIZE-1)) <= option_mpc860c0) program_interrupt(processor, cia, mpc860c0_instruction_program_interrupt); } }