aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-17 19:03:32 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-17 19:05:59 -0400
commita49dd19e81deb6d6c4af0fcadd94be1574f0b7dc (patch)
tree48b98b45d3d426ea5a5cff731383864199559a57 /sim
parent336b30e58ae98fe66862ab8480d3f7bb885fef23 (diff)
downloadfsf-binutils-gdb-a49dd19e81deb6d6c4af0fcadd94be1574f0b7dc.zip
fsf-binutils-gdb-a49dd19e81deb6d6c4af0fcadd94be1574f0b7dc.tar.gz
fsf-binutils-gdb-a49dd19e81deb6d6c4af0fcadd94be1574f0b7dc.tar.bz2
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.
Diffstat (limited to 'sim')
-rw-r--r--sim/ppc/ChangeLog5
-rw-r--r--sim/ppc/igen.c2
-rw-r--r--sim/ppc/ppc-instructions6
3 files changed, 9 insertions, 4 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 05178aa..280234a 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * igen.c (gen_semantics_h): Rename PAGE_SIZE to MPC860C0_PAGE_SIZE.
+ * ppc-instructions: Likewise.
+
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Delete AC_EXEEXT call.
diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c
index 0bf3b58..f0ff06b 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 70aa04e..2278b62 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);
}
}