]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #include <stdio.h> |
2 | ||
3 | void print_head(void) | |
4 | { | |
5 | printf("/*\n"); | |
6 | printf(" * Generated by mk_thread\n"); | |
7 | printf(" */\n"); | |
8 | printf("\n"); | |
9 | printf("#ifndef __UM_THREAD_H\n"); | |
10 | printf("#define __UM_THREAD_H\n"); | |
11 | printf("\n"); | |
12 | } | |
13 | ||
14 | void print_constant_ptr(char *name, int value) | |
15 | { | |
16 | printf("#define %s(task) ((unsigned long *) " | |
17 | "&(((char *) (task))[%d]))\n", name, value); | |
18 | } | |
19 | ||
20 | void print_constant(char *name, char *type, int value) | |
21 | { | |
22 | printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, | |
23 | value); | |
24 | } | |
25 | ||
26 | void print_tail(void) | |
27 | { | |
28 | printf("\n"); | |
29 | printf("#endif\n"); | |
30 | } |