diff options
author | jamesbowman <jamesb@excamera.com> | 2015-09-28 11:22:06 -0700 |
---|---|---|
committer | jamesbowman <jamesb@excamera.com> | 2015-09-28 11:23:54 -0700 |
commit | 71f4ed30fe331d062703e803f29a67b558e8e22d (patch) | |
tree | 5d28cf3ee4585e2aaf6f1551087e692ea0288293 | |
parent | b08b78e7d4bb56f395d3212eed6184ede236c760 (diff) | |
download | gdb-71f4ed30fe331d062703e803f29a67b558e8e22d.zip gdb-71f4ed30fe331d062703e803f29a67b558e8e22d.tar.gz gdb-71f4ed30fe331d062703e803f29a67b558e8e22d.tar.bz2 |
FT32: define macros for instruction recognition.
Other places (e.g. the gdb stack unwinder) can use these instead of
hard-coded patterns.
[include/Changelog]
2015-09-26 James Bowman <james.bowman@ftdichip.com>
* opcode/ft32.h: Add instruction macros FT32_*()
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/opcode/ft32.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 8b9f921..99a8bd9 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2015-09-26 James Bowman <james.bowman@ftdichip.com> + + * opcode/ft32.h: Add instruction macros FT32_*() + 2015-09-20 Rich Felker <dalias@libc.org> * bfdlink.h (struct bfd_link_info): Add "nointerp" field. diff --git a/include/opcode/ft32.h b/include/opcode/ft32.h index 9617890..6db46d9 100644 --- a/include/opcode/ft32.h +++ b/include/opcode/ft32.h @@ -96,5 +96,11 @@ typedef struct ft32_opc_info_t #define FT32_FLD_AL_BIT 0 #define FT32_FLD_AL_SIZ 4 +#define FT32_IS_CALL(inst) (((inst) & 0xfffc0000) == 0x00340000) +#define FT32_IS_PUSH(inst) (((inst) & 0xfff00000) == 0x84000000) +#define FT32_PUSH_REG(inst) (((inst) >> 15) & 0x1f) +#define FT32_IS_LINK(inst) (((inst) & 0xffff0000) == 0x95d00000) +#define FT32_LINK_SIZE(inst) ((inst) & 0xffff) + #define FT32_FLD_R_D_POST (1 << 17) #define FT32_FLD_R_1_POST (1 << 18) |