From ddaa4fc95836673ce96c144821fc4e0f752cf793 Mon Sep 17 00:00:00 2001
From: Linus Torvalds
Date: Wed, 28 Apr 2004 16:20:38 -0700
Subject: Use variables for target data structure information, instead of
hardcoding it at compile time. This allows us to do "cross-checks" much more
easily.
---
target.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 target.c
(limited to 'target.c')
diff --git a/target.c b/target.c
new file mode 100644
index 00000000..6aece3bd
--- /dev/null
+++ b/target.c
@@ -0,0 +1,49 @@
+#ifndef TARGET_H
+#define TARGET_H
+
+#include
+
+#include "symbol.h"
+#include "target.h"
+
+struct symbol *size_t_ctype = &ulong_ctype;
+struct symbol *ssize_t_ctype = &long_ctype;
+
+/*
+ * For "__attribute__((aligned))"
+ */
+int MAX_ALIGNMENT = 16;
+
+/*
+ * Integer data types
+ */
+int BITS_IN_CHAR = 8;
+int BITS_IN_SHORT = 16;
+int BITS_IN_INT = 32;
+int BITS_IN_LONG = 32;
+int BITS_IN_LONGLONG = 64;
+
+int MAX_INT_ALIGNMENT = 4;
+
+/*
+ * Floating point data types
+ */
+int BITS_IN_FLOAT = 32;
+int BITS_IN_DOUBLE = 64;
+int BITS_IN_LONGDOUBLE = 80;
+
+int MAX_FP_ALIGNMENT = 8;
+
+/*
+ * Pointer data type
+ */
+int BITS_IN_POINTER = 32;
+int POINTER_ALIGNMENT = 4;
+
+/*
+ * Enum data types
+ */
+int BITS_IN_ENUM = 32;
+int ENUM_ALIGNMENT = 4;
+
+#endif
--
cgit 1.2.3-korg