diff options
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | machine.h | 1 | ||||
-rw-r--r-- | target-openrisc.c | 26 | ||||
-rw-r--r-- | target.c | 2 | ||||
-rw-r--r-- | target.h | 1 |
5 files changed, 31 insertions, 0 deletions
@@ -79,6 +79,7 @@ LIB_OBJS += target-microblaze.o LIB_OBJS += target-mips.o LIB_OBJS += target-nds32.o LIB_OBJS += target-nios2.o +LIB_OBJS += target-openrisc.o LIB_OBJS += target-ppc.o LIB_OBJS += target-riscv.o LIB_OBJS += target-s390.o @@ -39,6 +39,7 @@ enum machine { MACH_MICROBLAZE, MACH_NDS32, MACH_NIOS2, + MACH_OPENRISC, MACH_SH, MACH_XTENSA, MACH_UNKNOWN diff --git a/target-openrisc.c b/target-openrisc.c new file mode 100644 index 00000000..553963c0 --- /dev/null +++ b/target-openrisc.c @@ -0,0 +1,26 @@ +#include "symbol.h" +#include "target.h" +#include "machine.h" + + +static void init_openrisc(const struct target *self) +{ + wchar_ctype = &uint_ctype; +} + +static void predefine_openrisc(const struct target *self) +{ + predefine_weak("__OR1K__"); + predefine_weak("__or1k__"); +} + +const struct target target_openrisc = { + .mach = MACH_NDS32, + .bitness = ARCH_LP32, + .big_endian = true, + + .bits_in_longdouble = 64, + + .init = init_openrisc, + .predefine = predefine_openrisc, +}; @@ -69,6 +69,7 @@ static const struct target *targets[] = { [MACH_MIPS64] = &target_mips64, [MACH_NDS32] = &target_nds32, [MACH_NIOS2] = &target_nios2, + [MACH_OPENRISC] = &target_openrisc, [MACH_PPC32] = &target_ppc32, [MACH_PPC64] = &target_ppc64, [MACH_RISCV32] = &target_riscv32, @@ -103,6 +104,7 @@ enum machine target_parse(const char *name) { "mips", MACH_MIPS32, 0, }, { "nds32", MACH_NDS32, 32, }, { "nios2", MACH_NIOS2, 32, }, + { "openrisc", MACH_OPENRISC, 32, }, { "powerpc", MACH_PPC32, 0, }, { "ppc", MACH_PPC32, 0, }, { "riscv", MACH_RISCV32, 0, }, @@ -92,6 +92,7 @@ extern const struct target target_mips32; extern const struct target target_mips64; extern const struct target target_nds32; extern const struct target target_nios2; +extern const struct target target_openrisc; extern const struct target target_ppc32; extern const struct target target_ppc64; extern const struct target target_riscv32; |