Skip to content

Commit

Permalink
sparc: unify module.c
Browse files Browse the repository at this point in the history
o Copy module_64.c to module.c
o Add all sparc specific bits to module.c
o delete module_32.c
o update Makefile

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sam Ravnborg authored and David S. Miller committed Dec 26, 2008
1 parent 627bf2f commit e6b04fe
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 164 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ obj-$(CONFIG_SPARC64_SMP) += hvtramp.o
obj-y += auxio_$(BITS).o
obj-$(CONFIG_SUN_PM) += apc.o pmc.o

obj-$(CONFIG_MODULES) += module_$(BITS).o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_MODULES) += sparc_ksyms_$(BITS).o
obj-$(CONFIG_SPARC_LED) += led.o
obj-$(CONFIG_KGDB) += kgdb_$(BITS).o
Expand Down
24 changes: 24 additions & 0 deletions arch/sparc/kernel/module_64.c → arch/sparc/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/vmalloc.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/slab.h>
#include <linux/mm.h>

Expand All @@ -36,6 +37,21 @@ static char *dot2underscore(char *name)
{
return name;
}
#else
static void *module_map(unsigned long size)
{
return vmalloc(size);
}

/* Replace references to .func with _Func */
static char *dot2underscore(char *name)
{
if (name[0] == '.') {
name[0] = '_';
name[1] = toupper(name[1]);
}
return name;
}
#endif /* CONFIG_SPARC64 */

void *module_alloc(unsigned long size)
Expand Down Expand Up @@ -170,6 +186,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
#endif /* CONFIG_SPARC64 */

case R_SPARC_32:
case R_SPARC_UA32:
location[0] = v >> 24;
location[1] = v >> 16;
location[2] = v >> 8;
Expand Down Expand Up @@ -224,6 +241,13 @@ int module_finalize(const Elf_Ehdr *hdr,

return 0;
}
#else
int module_finalize(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
struct module *me)
{
return 0;
}
#endif /* CONFIG_SPARC64 */

void module_arch_cleanup(struct module *mod)
Expand Down
163 changes: 0 additions & 163 deletions arch/sparc/kernel/module_32.c

This file was deleted.

0 comments on commit e6b04fe

Please sign in to comment.