diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-05-05 19:15:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 19:36:33 -0400 |
commit | 23352fc252495fdc072b3bd29f57c4c6b7a6bd83 (patch) | |
tree | 6d8bbac7d5512e7a984551f39d3922410ba53455 /arch/um/sys-x86_64 | |
parent | f7fe8781749bf2de2ca03147a1691244a7d93ec7 (diff) |
[PATCH] uml: kludgy compilation fixes for x86-64 subarch modules support
These are some trivial fixes for the x86-64 subarch module support. The only
potential problem is that I have to modify arch/x86_64/kernel/module.c, to
avoid copying the whole of it.
I can't use it verbatim because it depends on a special vmalloc-like area for
modules, which for now (maybe that's to fix, I guess not) UML/x86-64 has not.
I went the easy way and reused the i386 vmalloc()-based allocator.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/sys-x86_64')
-rw-r--r-- | arch/um/sys-x86_64/Makefile | 7 | ||||
-rw-r--r-- | arch/um/sys-x86_64/ksyms.c | 23 | ||||
-rw-r--r-- | arch/um/sys-x86_64/um_module.c | 19 |
3 files changed, 48 insertions, 1 deletions
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index d7ed2f7908df..e60c9da8fb48 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile | |||
@@ -4,16 +4,20 @@ | |||
4 | # Licensed under the GPL | 4 | # Licensed under the GPL |
5 | # | 5 | # |
6 | 6 | ||
7 | #XXX: why into lib-y? | ||
7 | lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ | 8 | lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ |
8 | ptrace.o ptrace_user.o semaphore.o sigcontext.o signal.o \ | 9 | ptrace.o ptrace_user.o semaphore.o sigcontext.o signal.o \ |
9 | syscalls.o sysrq.o thunk.o syscall_table.o | 10 | syscalls.o sysrq.o thunk.o syscall_table.o |
10 | 11 | ||
12 | obj-y := ksyms.o | ||
13 | obj-$(CONFIG_MODULES) += module.o um_module.o | ||
14 | |||
11 | USER_OBJS := ptrace_user.o sigcontext.o | 15 | USER_OBJS := ptrace_user.o sigcontext.o |
12 | 16 | ||
13 | include arch/um/scripts/Makefile.rules | 17 | include arch/um/scripts/Makefile.rules |
14 | 18 | ||
15 | SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ | 19 | SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ |
16 | semaphore.c thunk.S | 20 | semaphore.c thunk.S module.c |
17 | 21 | ||
18 | # this needs to be before the foreach, because clean-files does not accept | 22 | # this needs to be before the foreach, because clean-files does not accept |
19 | # complete paths like $(src)/$f. | 23 | # complete paths like $(src)/$f. |
@@ -30,6 +34,7 @@ csum-wrappers.c-dir = lib | |||
30 | memcpy.S-dir = lib | 34 | memcpy.S-dir = lib |
31 | semaphore.c-dir = kernel | 35 | semaphore.c-dir = kernel |
32 | thunk.S-dir = lib | 36 | thunk.S-dir = lib |
37 | module.c-dir = kernel | ||
33 | 38 | ||
34 | $(SYMLINKS): FORCE | 39 | $(SYMLINKS): FORCE |
35 | $(call if_changed,make_link) | 40 | $(call if_changed,make_link) |
diff --git a/arch/um/sys-x86_64/ksyms.c b/arch/um/sys-x86_64/ksyms.c new file mode 100644 index 000000000000..8d30fa8393c8 --- /dev/null +++ b/arch/um/sys-x86_64/ksyms.c | |||
@@ -0,0 +1,23 @@ | |||
1 | #include "linux/module.h" | ||
2 | #include "linux/in6.h" | ||
3 | #include "linux/rwsem.h" | ||
4 | #include "asm/byteorder.h" | ||
5 | #include "asm/semaphore.h" | ||
6 | #include "asm/uaccess.h" | ||
7 | #include "asm/checksum.h" | ||
8 | #include "asm/errno.h" | ||
9 | |||
10 | EXPORT_SYMBOL(__down_failed); | ||
11 | EXPORT_SYMBOL(__down_failed_interruptible); | ||
12 | EXPORT_SYMBOL(__down_failed_trylock); | ||
13 | EXPORT_SYMBOL(__up_wakeup); | ||
14 | |||
15 | /*XXX: we need them because they would be exported by x86_64 */ | ||
16 | EXPORT_SYMBOL(__memcpy); | ||
17 | EXPORT_SYMBOL(strcmp); | ||
18 | EXPORT_SYMBOL(strcat); | ||
19 | EXPORT_SYMBOL(strcpy); | ||
20 | |||
21 | /* Networking helper routines. */ | ||
22 | /*EXPORT_SYMBOL(csum_partial_copy_from); | ||
23 | EXPORT_SYMBOL(csum_partial_copy_to);*/ | ||
diff --git a/arch/um/sys-x86_64/um_module.c b/arch/um/sys-x86_64/um_module.c new file mode 100644 index 000000000000..8b8eff1bd977 --- /dev/null +++ b/arch/um/sys-x86_64/um_module.c | |||
@@ -0,0 +1,19 @@ | |||
1 | #include <linux/vmalloc.h> | ||
2 | #include <linux/moduleloader.h> | ||
3 | |||
4 | /*Copied from i386 arch/i386/kernel/module.c */ | ||
5 | void *module_alloc(unsigned long size) | ||
6 | { | ||
7 | if (size == 0) | ||
8 | return NULL; | ||
9 | return vmalloc_exec(size); | ||
10 | } | ||
11 | |||
12 | /* Free memory returned from module_alloc */ | ||
13 | void module_free(struct module *mod, void *module_region) | ||
14 | { | ||
15 | vfree(module_region); | ||
16 | /* FIXME: If module_region == mod->init_region, trim exception | ||
17 | table entries. */ | ||
18 | } | ||
19 | |||