* [Qemu-devel] [PATCH] target-cris/opcode-cris.h: rename REG_PC/SP to CRIS_REG_PC/SP
@ 2011-08-19 23:27 Peter Maydell
2011-08-19 23:43 ` Edgar E. Iglesias
0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2011-08-19 23:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Edgar E. Iglesias, patches
The REG_PC constant used in opcode-cris.h can clash with a
similar define in system include files. In particular the
Ubuntu Lucid SPARC signal.h will define REG_PC, and since
qemu-common.h now includes signal.h this was causing compile
failures. Rename the constants to avoid this issue.
(NB that REG_SP is not actually used within QEMU.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
You might recall that we had to make a similar renaming in the
linux-user code back in April for the same reason.
target-cris/opcode-cris.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target-cris/opcode-cris.h b/target-cris/opcode-cris.h
index 8d4749d..779d4aa 100644
--- a/target-cris/opcode-cris.h
+++ b/target-cris/opcode-cris.h
@@ -29,8 +29,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Registers. */
#define MAX_REG (15)
-#define REG_SP (14)
-#define REG_PC (15)
+#define CRIS_REG_SP (14)
+#define CRIS_REG_PC (15)
/* CPU version control of disassembly and assembly of instructions.
May affect how the instruction is assembled, at least the size of
@@ -138,7 +138,7 @@ extern const struct cris_cond15 cris_conds15[];
#define BDAP_INDIR_OPCODE (BDAP_INDIR_HIGH * 0x0100 + BDAP_INDIR_LOW)
#define BDAP_INDIR_Z_BITS (BDAP_INDIR_HIGH_Z * 0x100 + BDAP_INDIR_LOW_Z)
-#define BDAP_PC_LOW (BDAP_INDIR_LOW + REG_PC)
+#define BDAP_PC_LOW (BDAP_INDIR_LOW + CRIS_REG_PC)
#define BDAP_INCR_HIGH (BDAP_INDIR_HIGH + AUTOINCR_BIT)
/* No prefix must have this code for its "match" bits in the
@@ -192,16 +192,16 @@ extern const char *const cris_cc_strings[];
#define JUMP_INDIR_OPCODE (0x0930)
#define JUMP_INDIR_Z_BITS (0xf2c0)
#define JUMP_PC_INCR_OPCODE \
- (JUMP_INDIR_OPCODE + AUTOINCR_BIT * 0x0100 + REG_PC)
+ (JUMP_INDIR_OPCODE + AUTOINCR_BIT * 0x0100 + CRIS_REG_PC)
#define MOVE_M_TO_PREG_OPCODE 0x0a30
#define MOVE_M_TO_PREG_ZBITS 0x01c0
/* BDAP.D N,PC. */
#define MOVE_PC_INCR_OPCODE_PREFIX \
- (((BDAP_INCR_HIGH | (REG_PC << 4)) << 8) | BDAP_PC_LOW | (2 << 4))
+ (((BDAP_INCR_HIGH | (CRIS_REG_PC << 4)) << 8) | BDAP_PC_LOW | (2 << 4))
#define MOVE_PC_INCR_OPCODE_SUFFIX \
- (MOVE_M_TO_PREG_OPCODE | REG_PC | (AUTOINCR_BIT << 8))
+ (MOVE_M_TO_PREG_OPCODE | CRIS_REG_PC | (AUTOINCR_BIT << 8))
#define JUMP_PC_INCR_OPCODE_V32 (0x0DBF)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] target-cris/opcode-cris.h: rename REG_PC/SP to CRIS_REG_PC/SP
2011-08-19 23:27 [Qemu-devel] [PATCH] target-cris/opcode-cris.h: rename REG_PC/SP to CRIS_REG_PC/SP Peter Maydell
@ 2011-08-19 23:43 ` Edgar E. Iglesias
0 siblings, 0 replies; 2+ messages in thread
From: Edgar E. Iglesias @ 2011-08-19 23:43 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel, patches
On Sat, Aug 20, 2011 at 12:27:04AM +0100, Peter Maydell wrote:
> The REG_PC constant used in opcode-cris.h can clash with a
> similar define in system include files. In particular the
> Ubuntu Lucid SPARC signal.h will define REG_PC, and since
> qemu-common.h now includes signal.h this was causing compile
> failures. Rename the constants to avoid this issue.
> (NB that REG_SP is not actually used within QEMU.)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Applied, thanks Peter.
Cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-19 23:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-19 23:27 [Qemu-devel] [PATCH] target-cris/opcode-cris.h: rename REG_PC/SP to CRIS_REG_PC/SP Peter Maydell
2011-08-19 23:43 ` Edgar E. Iglesias
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).