aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/target.h
diff options
context:
space:
mode:
Diffstat (limited to 'target.h')
-rw-r--r--target.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/target.h b/target.h
index 8bbe494f..a89e21b6 100644
--- a/target.h
+++ b/target.h
@@ -1,6 +1,8 @@
#ifndef TARGET_H
#define TARGET_H
+#include "machine.h"
+
extern struct symbol *size_t_ctype;
extern struct symbol *ssize_t_ctype;
extern struct symbol *intmax_ctype;
@@ -51,6 +53,52 @@ extern int pointer_alignment;
extern int bits_in_enum;
extern int enum_alignment;
+
+struct target {
+ enum machine mach;
+ enum bitness bitness;
+ unsigned int big_endian:1;
+ unsigned int unsigned_char:1;
+ unsigned int size_t_long:1;
+ unsigned int has_int128:1;
+
+ struct symbol *wchar;
+ struct symbol *wint;
+
+ unsigned int bits_in_longdouble;
+ unsigned int max_fp_alignment;
+
+ const struct target *target_32bit;
+ const struct target *target_64bit;
+
+ void (*init)(const struct target *self);
+ void (*predefine)(const struct target *self);
+};
+
+extern const struct target target_default;
+extern const struct target target_arm;
+extern const struct target target_arm64;
+extern const struct target target_m68k;
+extern const struct target target_mips32;
+extern const struct target target_mips64;
+extern const struct target target_ppc32;
+extern const struct target target_ppc64;
+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_sparc32;
+extern const struct target target_sparc64;
+extern const struct target target_i386;
+extern const struct target target_x86_64;
+
+/* target.c */
+extern const struct target *arch_target;
+
+enum machine target_parse(const char *name);
+void target_config(enum machine mach);
+void target_init(void);
+
/*
* Helper functions for converting bits to bytes and vice versa.
*/