diff options
author | comex | 2015-02-08 23:45:24 -0500 |
---|---|---|
committer | comex | 2015-02-08 23:45:24 -0500 |
commit | eb93cee2a22cde812ccd6b9bd418d36185c058f5 (patch) | |
tree | 43a22ccf021a1513dba3a9c99f7b81822fe950fa /lib/substitute-internal.h | |
parent | formatting (diff) | |
download | substitute-eb93cee2a22cde812ccd6b9bd418d36185c058f5.tar.gz |
Refactor disassembly so x86 works, and add x86 transform-dis.
This patch is a monolithic mess, because I was too lazy to do the
refactor first (that would require some stash fun, since I wasn't
actually sure before doing x86 transform-dis what would be needed).
Anyway, the resulting code should be cleaner - less duplication.
This breaks ARM/ARM64.
Diffstat (limited to 'lib/substitute-internal.h')
-rw-r--r-- | lib/substitute-internal.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/substitute-internal.h b/lib/substitute-internal.h index 17ad6ec..9a91516 100644 --- a/lib/substitute-internal.h +++ b/lib/substitute-internal.h @@ -49,12 +49,22 @@ typedef struct section section_x; #endif #if defined(TARGET_arm) - #include "arm/misc.h" + #define TARGET_DIR arm #elif defined(TARGET_arm64) - #include "arm64/misc.h" + #define TARGET_DIR arm64 #elif defined(TARGET_x86_64) || defined(TARGET_i386) - #include "x86/misc.h" + #define TARGET_DIR x86 #endif +#define stringify_(x) #x +#define stringify(x) stringify_(x) +#include stringify(TARGET_DIR/misc.h) + +#if TARGET_POINTER_SIZE == 8 + typedef uint64_t uint_tptr; +#elif TARGET_POINTER_SIZE == 4 + typedef uint32_t uint_tptr; +#endif + #ifdef __APPLE__ /* This could graduate to a public API but is not yet. Needs more |