summaryrefslogtreecommitdiff
path: root/arch/powerpc/util.h
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2024-03-05 19:50:13 -0500
committerRusty Wagner <rusty.wagner@gmail.com>2024-03-05 20:34:34 -0500
commite093c21ed880ac3eb72119be15093ee04f8ce299 (patch)
tree9f720ebdc0ae415734b1199ed341668c69710a94 /arch/powerpc/util.h
parent0609276712622908254065546102381466033141 (diff)
Move architecture modules into the API repo
Diffstat (limited to 'arch/powerpc/util.h')
-rw-r--r--arch/powerpc/util.h18
1 files changed, 18 insertions, 0 deletions
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);