patch-2.1.87 linux/arch/m68k/kernel/m68k_defs.c
Next file: linux/arch/m68k/kernel/m68k_ksyms.c
Previous file: linux/arch/m68k/kernel/ints.c
Back to the patch index
Back to the overall index
- Lines: 24
- Date:
Thu Feb 12 16:30:12 1998
- Orig file:
v2.1.86/linux/arch/m68k/kernel/m68k_defs.c
- Orig date:
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.1.86/linux/arch/m68k/kernel/m68k_defs.c linux/arch/m68k/kernel/m68k_defs.c
@@ -0,0 +1,23 @@
+/*
+ * This program is used to generate definitions needed by
+ * assembly language modules.
+ *
+ * We use the technique used in the OSF Mach kernel code:
+ * generate asm statements containing #defines,
+ * compile this file to assembler, and then extract the
+ * #defines from the assembly-language output.
+ */
+
+#include <linux/stddef.h>
+#include <linux/sched.h>
+
+#define DEFINE(sym, val) \
+ asm volatile("\n#define " #sym " %0" : : "i" (val))
+
+int main(void)
+{
+ DEFINE(TS_TSS, offsetof(struct task_struct, tss));
+ DEFINE(TS_ESP0, offsetof(struct task_struct, tss.esp0));
+ DEFINE(TS_FPU, offsetof(struct task_struct, tss.fp));
+ return 0;
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov