[binutils-gdb] sim: ppc: avoid "PAGE_SIZE" name
Michael Frysinger
vapier@sourceware.org
Thu Jun 17 23:12:11 GMT 2021
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a49dd19e81deb6d6c4af0fcadd94be1574f0b7dc
commit a49dd19e81deb6d6c4af0fcadd94be1574f0b7dc
Author: Mike Frysinger <vapier@gentoo.org>
Date: Thu Jun 17 19:03:32 2021 -0400
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:
---
sim/ppc/ChangeLog | 5 +++++
sim/ppc/igen.c | 2 +-
sim/ppc/ppc-instructions | 6 +++---
3 files changed, 9 insertions(+), 4 deletions(-)
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 <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 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);
}
}
More information about the Gdb-cvs
mailing list