diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/um/util |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/um/util')
-rw-r--r-- | arch/um/util/Makefile | 8 | ||||
-rw-r--r-- | arch/um/util/mk_constants_kern.c | 28 | ||||
-rw-r--r-- | arch/um/util/mk_constants_user.c | 28 | ||||
-rw-r--r-- | arch/um/util/mk_task_kern.c | 17 | ||||
-rw-r--r-- | arch/um/util/mk_task_user.c | 30 |
5 files changed, 111 insertions, 0 deletions
diff --git a/arch/um/util/Makefile b/arch/um/util/Makefile new file mode 100644 index 000000000000..e2ab71209f3f --- /dev/null +++ b/arch/um/util/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | hostprogs-y := mk_task mk_constants | ||
2 | always := $(hostprogs-y) | ||
3 | |||
4 | mk_task-objs := mk_task_user.o mk_task_kern.o | ||
5 | mk_constants-objs := mk_constants_user.o mk_constants_kern.o | ||
6 | |||
7 | HOSTCFLAGS_mk_task_kern.o := $(CFLAGS) $(CPPFLAGS) | ||
8 | HOSTCFLAGS_mk_constants_kern.o := $(CFLAGS) $(CPPFLAGS) | ||
diff --git a/arch/um/util/mk_constants_kern.c b/arch/um/util/mk_constants_kern.c new file mode 100644 index 000000000000..cdcb1232a1ea --- /dev/null +++ b/arch/um/util/mk_constants_kern.c | |||
@@ -0,0 +1,28 @@ | |||
1 | #include "linux/kernel.h" | ||
2 | #include "linux/stringify.h" | ||
3 | #include "linux/time.h" | ||
4 | #include "asm/page.h" | ||
5 | |||
6 | extern void print_head(void); | ||
7 | extern void print_constant_str(char *name, char *value); | ||
8 | extern void print_constant_int(char *name, int value); | ||
9 | extern void print_tail(void); | ||
10 | |||
11 | int main(int argc, char **argv) | ||
12 | { | ||
13 | print_head(); | ||
14 | print_constant_int("UM_KERN_PAGE_SIZE", PAGE_SIZE); | ||
15 | |||
16 | print_constant_str("UM_KERN_EMERG", KERN_EMERG); | ||
17 | print_constant_str("UM_KERN_ALERT", KERN_ALERT); | ||
18 | print_constant_str("UM_KERN_CRIT", KERN_CRIT); | ||
19 | print_constant_str("UM_KERN_ERR", KERN_ERR); | ||
20 | print_constant_str("UM_KERN_WARNING", KERN_WARNING); | ||
21 | print_constant_str("UM_KERN_NOTICE", KERN_NOTICE); | ||
22 | print_constant_str("UM_KERN_INFO", KERN_INFO); | ||
23 | print_constant_str("UM_KERN_DEBUG", KERN_DEBUG); | ||
24 | |||
25 | print_constant_int("UM_NSEC_PER_SEC", NSEC_PER_SEC); | ||
26 | print_tail(); | ||
27 | return(0); | ||
28 | } | ||
diff --git a/arch/um/util/mk_constants_user.c b/arch/um/util/mk_constants_user.c new file mode 100644 index 000000000000..8f4d7e50be7c --- /dev/null +++ b/arch/um/util/mk_constants_user.c | |||
@@ -0,0 +1,28 @@ | |||
1 | #include <stdio.h> | ||
2 | |||
3 | void print_head(void) | ||
4 | { | ||
5 | printf("/*\n"); | ||
6 | printf(" * Generated by mk_constants\n"); | ||
7 | printf(" */\n"); | ||
8 | printf("\n"); | ||
9 | printf("#ifndef __UM_CONSTANTS_H\n"); | ||
10 | printf("#define __UM_CONSTANTS_H\n"); | ||
11 | printf("\n"); | ||
12 | } | ||
13 | |||
14 | void print_constant_str(char *name, char *value) | ||
15 | { | ||
16 | printf("#define %s \"%s\"\n", name, value); | ||
17 | } | ||
18 | |||
19 | void print_constant_int(char *name, int value) | ||
20 | { | ||
21 | printf("#define %s %d\n", name, value); | ||
22 | } | ||
23 | |||
24 | void print_tail(void) | ||
25 | { | ||
26 | printf("\n"); | ||
27 | printf("#endif\n"); | ||
28 | } | ||
diff --git a/arch/um/util/mk_task_kern.c b/arch/um/util/mk_task_kern.c new file mode 100644 index 000000000000..c218103315ed --- /dev/null +++ b/arch/um/util/mk_task_kern.c | |||
@@ -0,0 +1,17 @@ | |||
1 | #include "linux/sched.h" | ||
2 | #include "linux/stddef.h" | ||
3 | |||
4 | extern void print(char *name, char *type, int offset); | ||
5 | extern void print_ptr(char *name, char *type, int offset); | ||
6 | extern void print_head(void); | ||
7 | extern void print_tail(void); | ||
8 | |||
9 | int main(int argc, char **argv) | ||
10 | { | ||
11 | print_head(); | ||
12 | print_ptr("TASK_REGS", "union uml_pt_regs", | ||
13 | offsetof(struct task_struct, thread.regs)); | ||
14 | print("TASK_PID", "int", offsetof(struct task_struct, pid)); | ||
15 | print_tail(); | ||
16 | return(0); | ||
17 | } | ||
diff --git a/arch/um/util/mk_task_user.c b/arch/um/util/mk_task_user.c new file mode 100644 index 000000000000..9db849f3f3ac --- /dev/null +++ b/arch/um/util/mk_task_user.c | |||
@@ -0,0 +1,30 @@ | |||
1 | #include <stdio.h> | ||
2 | |||
3 | void print(char *name, char *type, int offset) | ||
4 | { | ||
5 | printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, | ||
6 | offset); | ||
7 | } | ||
8 | |||
9 | void print_ptr(char *name, char *type, int offset) | ||
10 | { | ||
11 | printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type, | ||
12 | offset); | ||
13 | } | ||
14 | |||
15 | void print_head(void) | ||
16 | { | ||
17 | printf("/*\n"); | ||
18 | printf(" * Generated by mk_task\n"); | ||
19 | printf(" */\n"); | ||
20 | printf("\n"); | ||
21 | printf("#ifndef __TASK_H\n"); | ||
22 | printf("#define __TASK_H\n"); | ||
23 | printf("\n"); | ||
24 | } | ||
25 | |||
26 | void print_tail(void) | ||
27 | { | ||
28 | printf("\n"); | ||
29 | printf("#endif\n"); | ||
30 | } | ||