summaryrefslogtreecommitdiffstats
path: root/arch/um/util/mk_task_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/util/mk_task_user.c')
-rw-r--r--arch/um/util/mk_task_user.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/um/util/mk_task_user.c b/arch/um/util/mk_task_user.c
new file mode 100644
index 00000000000..9db849f3f3a
--- /dev/null
+++ b/arch/um/util/mk_task_user.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+
+void print(char *name, char *type, int offset)
+{
+ printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
+ offset);
+}
+
+void print_ptr(char *name, char *type, int offset)
+{
+ printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type,
+ offset);
+}
+
+void print_head(void)
+{
+ printf("/*\n");
+ printf(" * Generated by mk_task\n");
+ printf(" */\n");
+ printf("\n");
+ printf("#ifndef __TASK_H\n");
+ printf("#define __TASK_H\n");
+ printf("\n");
+}
+
+void print_tail(void)
+{
+ printf("\n");
+ printf("#endif\n");
+}