diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-10 14:09:51 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-13 18:02:55 +0200 |
commit | 338f93fad2fb41198abb6fa6d8a9e4a28a86e55e (patch) | |
tree | 8db37933c3b7d3c51b5442565276ceab8a32c1de | |
parent | e7ff2c6b8ad26b53deb18cf6589d5dc88629b6bd (diff) | |
download | sparse-338f93fad2fb41198abb6fa6d8a9e4a28a86e55e.tar.gz |
sh: add minimal support
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | machine.h | 1 | ||||
-rw-r--r-- | target-sh.c | 28 | ||||
-rw-r--r-- | target.c | 2 | ||||
-rw-r--r-- | target.h | 1 |
5 files changed, 33 insertions, 0 deletions
@@ -82,6 +82,7 @@ LIB_OBJS += target-nios2.o LIB_OBJS += target-ppc.o LIB_OBJS += target-riscv.o LIB_OBJS += target-s390.o +LIB_OBJS += target-sh.o LIB_OBJS += target-sparc.o LIB_OBJS += target-x86.o LIB_OBJS += target-xtensa.o @@ -39,6 +39,7 @@ enum machine { MACH_MICROBLAZE, MACH_NDS32, MACH_NIOS2, + MACH_SH, MACH_XTENSA, MACH_UNKNOWN }; diff --git a/target-sh.c b/target-sh.c new file mode 100644 index 00000000..db517ccb --- /dev/null +++ b/target-sh.c @@ -0,0 +1,28 @@ +#include "symbol.h" +#include "target.h" +#include "machine.h" + + +static void init_sh(const struct target *self) +{ + int64_ctype = &llong_ctype; + uint64_ctype = &ullong_ctype; + wchar_ctype = &long_ctype; +} + +static void predefine_sh(const struct target *self) +{ + predefine_weak("__SH4__"); + predefine_weak("__sh__"); +} + +const struct target target_sh = { + .mach = MACH_SH, + .bitness = ARCH_LP32, + .big_endian = false, + + .bits_in_longdouble = 64, + + .init = init_sh, + .predefine = predefine_sh, +}; @@ -75,6 +75,7 @@ static const struct target *targets[] = { [MACH_RISCV64] = &target_riscv64, [MACH_S390] = &target_s390, [MACH_S390X] = &target_s390x, + [MACH_SH] = &target_sh, [MACH_SPARC32] = &target_sparc32, [MACH_SPARC64] = &target_sparc64, [MACH_X86_64] = &target_x86_64, @@ -110,6 +111,7 @@ enum machine target_parse(const char *name) { "sparc", MACH_SPARC32, 0, }, { "x86_64", MACH_X86_64, 64, }, { "x86-64", MACH_X86_64, 64, }, + { "sh", MACH_SH, 32, }, { "xtensa", MACH_XTENSA, 32, }, { NULL }, }; @@ -98,6 +98,7 @@ extern const struct target target_riscv32; extern const struct target target_riscv64; extern const struct target target_s390; extern const struct target target_s390x; +extern const struct target target_sh; extern const struct target target_sparc32; extern const struct target target_sparc64; extern const struct target target_i386; |