aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-08 01:07:51 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-13 17:54:36 +0200
commit85fb62e73e82ba165fc2f1246d9096e94f268a60 (patch)
tree35979fe8769a5f6a24f3e1424dbda3fe41215906
parent53ff1650faff3b0a7ebebd455e0d38c26162f9d1 (diff)
downloadsparse-85fb62e73e82ba165fc2f1246d9096e94f268a60.tar.gz
h8300: add minimal support
This is now the only architecture needing '-msize-long'. Prepare the obsolescence of this option by adding the target file for this architecture. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--Makefile1
-rw-r--r--machine.h1
-rw-r--r--target-h8300.c27
-rw-r--r--target.c2
-rw-r--r--target.h1
5 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 35098940..d7cfe4f5 100644
--- a/Makefile
+++ b/Makefile
@@ -73,6 +73,7 @@ LIB_OBJS += target-arm.o
LIB_OBJS += target-arm64.o
LIB_OBJS += target-bfin.o
LIB_OBJS += target-default.o
+LIB_OBJS += target-h8300.o
LIB_OBJS += target-m68k.o
LIB_OBJS += target-microblaze.o
LIB_OBJS += target-mips.o
diff --git a/machine.h b/machine.h
index 7407e716..1b8b862a 100644
--- a/machine.h
+++ b/machine.h
@@ -34,6 +34,7 @@ enum machine {
MACH_S390, MACH_S390X,
MACH_ALPHA,
MACH_BFIN,
+ MACH_H8300,
MACH_M68K,
MACH_MICROBLAZE,
MACH_NIOS2,
diff --git a/target-h8300.c b/target-h8300.c
new file mode 100644
index 00000000..47872b38
--- /dev/null
+++ b/target-h8300.c
@@ -0,0 +1,27 @@
+#include "symbol.h"
+#include "target.h"
+#include "machine.h"
+
+
+static void init_h8300(const struct target *self)
+{
+ ssize_t_ctype = &long_ctype;
+ size_t_ctype = &ulong_ctype;
+ wchar_ctype = &ushort_ctype;
+}
+
+static void predefine_h8300(const struct target *self)
+{
+ predefine("__H8300H__", 1, "1");
+}
+
+const struct target target_h8300 = {
+ .mach = MACH_H8300,
+ .bitness = ARCH_LP32,
+ .big_endian = true,
+
+ .bits_in_longdouble = 64,
+
+ .init = init_h8300,
+ .predefine = predefine_h8300,
+};
diff --git a/target.c b/target.c
index e512f7f1..b3966151 100644
--- a/target.c
+++ b/target.c
@@ -61,6 +61,7 @@ static const struct target *targets[] = {
[MACH_ARM] = &target_arm,
[MACH_ARM64] = &target_arm64,
[MACH_BFIN] = &target_bfin,
+ [MACH_H8300] = &target_h8300,
[MACH_I386] = &target_i386,
[MACH_M68K] = &target_m68k,
[MACH_MICROBLAZE] = &target_microblaze,
@@ -92,6 +93,7 @@ enum machine target_parse(const char *name)
{ "arm64", MACH_ARM64, 64, },
{ "arm", MACH_ARM, 32, },
{ "bfin", MACH_BFIN, 32, },
+ { "h8300", MACH_H8300, 32, },
{ "i386", MACH_I386, 32, },
{ "m68k", MACH_M68K, 32, },
{ "microblaze", MACH_MICROBLAZE,32, },
diff --git a/target.h b/target.h
index 8f79426c..45ee40f1 100644
--- a/target.h
+++ b/target.h
@@ -85,6 +85,7 @@ extern const struct target target_alpha;
extern const struct target target_arm;
extern const struct target target_arm64;
extern const struct target target_bfin;
+extern const struct target target_h8300;
extern const struct target target_m68k;
extern const struct target target_microblaze;
extern const struct target target_mips32;