aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386/util/mk_thread_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/sys-i386/util/mk_thread_user.c')
-rw-r--r--arch/um/sys-i386/util/mk_thread_user.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/um/sys-i386/util/mk_thread_user.c b/arch/um/sys-i386/util/mk_thread_user.c
new file mode 100644
index 000000000000..2620cd6aa1f1
--- /dev/null
+++ b/arch/um/sys-i386/util/mk_thread_user.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+
+void print_head(void)
+{
+ printf("/*\n");
+ printf(" * Generated by mk_thread\n");
+ printf(" */\n");
+ printf("\n");
+ printf("#ifndef __UM_THREAD_H\n");
+ printf("#define __UM_THREAD_H\n");
+ printf("\n");
+}
+
+void print_constant_ptr(char *name, int value)
+{
+ printf("#define %s(task) ((unsigned long *) "
+ "&(((char *) (task))[%d]))\n", name, value);
+}
+
+void print_constant(char *name, char *type, int value)
+{
+ printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
+ value);
+}
+
+void print_tail(void)
+{
+ printf("\n");
+ printf("#endif\n");
+}