diff options
Diffstat (limited to 'arch/um/util/mk_task.c')
-rw-r--r-- | arch/um/util/mk_task.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/um/util/mk_task.c b/arch/um/util/mk_task.c new file mode 100644 index 00000000000..36c9606505e --- /dev/null +++ b/arch/um/util/mk_task.c | |||
@@ -0,0 +1,30 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <kernel-offsets.h> | ||
3 | |||
4 | void print_ptr(char *name, char *type, int offset) | ||
5 | { | ||
6 | printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type, | ||
7 | offset); | ||
8 | } | ||
9 | |||
10 | void print(char *name, char *type, int offset) | ||
11 | { | ||
12 | printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, | ||
13 | offset); | ||
14 | } | ||
15 | |||
16 | int main(int argc, char **argv) | ||
17 | { | ||
18 | printf("/*\n"); | ||
19 | printf(" * Generated by mk_task\n"); | ||
20 | printf(" */\n"); | ||
21 | printf("\n"); | ||
22 | printf("#ifndef __TASK_H\n"); | ||
23 | printf("#define __TASK_H\n"); | ||
24 | printf("\n"); | ||
25 | print_ptr("TASK_REGS", "union uml_pt_regs", TASK_REGS); | ||
26 | print("TASK_PID", "int", TASK_PID); | ||
27 | printf("\n"); | ||
28 | printf("#endif\n"); | ||
29 | return(0); | ||
30 | } | ||