summaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386/util/mk_thread_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/sys-i386/util/mk_thread_kern.c')
-rw-r--r--arch/um/sys-i386/util/mk_thread_kern.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/um/sys-i386/util/mk_thread_kern.c b/arch/um/sys-i386/util/mk_thread_kern.c
new file mode 100644
index 000000000000..948b1ce85230
--- /dev/null
+++ b/arch/um/sys-i386/util/mk_thread_kern.c
@@ -0,0 +1,22 @@
+#include "linux/config.h"
+#include "linux/stddef.h"
+#include "linux/sched.h"
+
+extern void print_head(void);
+extern void print_constant_ptr(char *name, int value);
+extern void print_constant(char *name, char *type, int value);
+extern void print_tail(void);
+
+#define THREAD_OFFSET(field) offsetof(struct task_struct, thread.field)
+
+int main(int argc, char **argv)
+{
+ print_head();
+ print_constant_ptr("TASK_DEBUGREGS", THREAD_OFFSET(arch.debugregs));
+#ifdef CONFIG_MODE_TT
+ print_constant("TASK_EXTERN_PID", "int", THREAD_OFFSET(mode.tt.extern_pid));
+#endif
+ print_tail();
+ return(0);
+}
+