Skip to contentSkip to conversation

sparc: unify module.c

PATCH Applied Sam Ravnborg 2 participants 2 messages Dec 22, 2008 – Dec 26, 2008 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 5/5 sparc: unify module.c

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

---
 arch/sparc/kernel/Makefile                  |    2 +-
 arch/sparc/kernel/{module_64.c => module.c} |   24 ++++
 arch/sparc/kernel/module_32.c               |  163 ---------------------------
 3 files changed, 25 insertions(+), 164 deletions(-)
 rename arch/sparc/kernel/{module_64.c => module.c} (91%)
 delete mode 100644 arch/sparc/kernel/module_32.c
arch/sparc/kernel/Makefile +1 -1
index 59aab6a..53adcaa 100644
@@ -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
arch/sparc/kernel/module.c renamed from arch/sparc/kernel/module_64.c +24 -0
similarity index 91%
rename from arch/sparc/kernel/module_64.c
rename to arch/sparc/kernel/module.c
index 4deb887..9027376 100644
@@ -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>
 
@@ -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)
@@ -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;
@@ -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)
arch/sparc/kernel/module_32.c deleted +0 -163

163 lines not on this page · raw message

Signature · 1 line
1.6.0.2.GIT