From e093c21ed880ac3eb72119be15093ee04f8ce299 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 5 Mar 2024 19:50:13 -0500 Subject: Move architecture modules into the API repo --- arch/powerpc/util.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 arch/powerpc/util.h (limited to 'arch/powerpc/util.h') diff --git a/arch/powerpc/util.h b/arch/powerpc/util.h new file mode 100644 index 00000000..fe2b7fda --- /dev/null +++ b/arch/powerpc/util.h @@ -0,0 +1,18 @@ +#ifdef __clang__ +#define FALL_THROUGH +#elif defined(__GNUC__) && __GNUC__ >= 7 +#define FALL_THROUGH __attribute__((fallthrough)); +#else +#define FALL_THROUGH +#endif + +inline uint32_t bswap32(uint32_t x) +{ + return ((x&0xFF)<<24) | + ((x&0xFF00)<<8) | + ((x&0xFF0000)>>8) | + ((x&0xFF000000)>>24); +} + +void printOperandVerbose(decomp_result *res, cs_ppc_op *opers); +void printInstructionVerbose(decomp_result *res); -- cgit v1.3.1