Committing NON-WORKING cil tools directory. This code all needs
[ocaml-bitstring.git] / cil-tools / task_struct.c
diff --git a/cil-tools/task_struct.c b/cil-tools/task_struct.c
new file mode 100644 (file)
index 0000000..b17f925
--- /dev/null
@@ -0,0 +1,25 @@
+/* This is an example import file, showing how to import the
+ * Linux task_struct structure from header files.
+ *
+ * Use: bitmatch-import-c task_struct.c > task_struct.ml
+ *
+ * Tip: Add the --debug flag to that command line to see what's going on.
+ */
+
+/* Any defines, etc. necessary to get the include to work. */
+#define __KERNEL__
+#define CONFIG_HZ 100
+#define CONFIG_PAGE_OFFSETUL 0xc0000000 /* XXX? */
+#define THREAD_SIZE 4096 /* XXX? */
+
+/* Include files necessary to get the structure(s) and constant(s) we're
+ * interested in.
+ *
+ * Note in this case glibc strips the useful structures out of the
+ * so-called "kernel headers" that it supplies, so instead I have
+ * a local copy of the real headers from a version of Linux.
+ */
+#include "linux/sched.h"
+
+/* This tells the importer program what structures and constants to import. */
+typedef struct task_struct BITMATCH_IMPORT(task_struct);