diff options
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | machine.h | 1 | ||||
-rw-r--r-- | target-microblaze.c | 25 | ||||
-rw-r--r-- | target.c | 2 | ||||
-rw-r--r-- | target.h | 1 |
5 files changed, 30 insertions, 0 deletions
@@ -74,6 +74,7 @@ LIB_OBJS += target-arm64.o LIB_OBJS += target-bfin.o LIB_OBJS += target-default.o LIB_OBJS += target-m68k.o +LIB_OBJS += target-microblaze.o LIB_OBJS += target-mips.o LIB_OBJS += target-nios2.o LIB_OBJS += target-ppc.o @@ -35,6 +35,7 @@ enum machine { MACH_ALPHA, MACH_BFIN, MACH_M68K, + MACH_MICROBLAZE, MACH_NIOS2, MACH_UNKNOWN }; diff --git a/target-microblaze.c b/target-microblaze.c new file mode 100644 index 00000000..1fbeef3c --- /dev/null +++ b/target-microblaze.c @@ -0,0 +1,25 @@ +#include "symbol.h" +#include "target.h" +#include "machine.h" + + +static void predefine_microblaze(const struct target *self) +{ + predefine("__MICROBLAZE__", 1, "1"); + predefine("__microblaze__", 1, "1"); + + if (arch_big_endian) + predefine("__MICROBLAZEEB__", 1, "1"); + else + predefine("__MICROBLAZEEL__", 1, "1"); +} + +const struct target target_microblaze = { + .mach = MACH_MICROBLAZE, + .bitness = ARCH_LP32, + .big_endian = true, + + .bits_in_longdouble = 64, + + .predefine = predefine_microblaze, +}; @@ -63,6 +63,7 @@ static const struct target *targets[] = { [MACH_I386] = &target_i386, [MACH_BFIN] = &target_bfin, [MACH_X86_64] = &target_x86_64, + [MACH_MICROBLAZE] = &target_microblaze, [MACH_MIPS32] = &target_mips32, [MACH_MIPS64] = &target_mips64, [MACH_NIOS2] = &target_nios2, @@ -93,6 +94,7 @@ enum machine target_parse(const char *name) { "i386", MACH_I386, 32, }, { "bfin", MACH_BFIN, 32, }, { "m68k", MACH_M68K, 32, }, + { "microblaze", MACH_MICROBLAZE,32, }, { "mips", MACH_MIPS32, 0, }, { "nios2", MACH_NIOS2, 32, }, { "powerpc", MACH_PPC32, 0, }, @@ -86,6 +86,7 @@ extern const struct target target_arm; extern const struct target target_arm64; extern const struct target target_bfin; extern const struct target target_m68k; +extern const struct target target_microblaze; extern const struct target target_mips32; extern const struct target target_mips64; extern const struct target target_nios2; |