aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/module.c
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2008-11-18 04:48:22 -0500
committerBryan Wu <cooloney@kernel.org>2008-11-18 04:48:22 -0500
commit8f65873e47784a390949f0d61e5692dbf2a8253e (patch)
tree4d9509bf5e52ebac190d79de04b783829d44f49e /arch/blackfin/kernel/module.c
parentb8a989893cbdeb6c97a7b5af5f38fb0e480235f9 (diff)
Blackfin arch: SMP supporting patchset: Blackfin kernel and memory management code
Blackfin dual core BF561 processor can support SMP like features. https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:smp-like In this patch, we provide SMP extend to Blackfin kernel and memory management code Singed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/module.c')
-rw-r--r--arch/blackfin/kernel/module.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index e1bebc80a5bf..2e14cadd4302 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -343,7 +343,13 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
343 pr_debug("location is %x, value is %x type is %d \n", 343 pr_debug("location is %x, value is %x type is %d \n",
344 (unsigned int) location32, value, 344 (unsigned int) location32, value,
345 ELF32_R_TYPE(rel[i].r_info)); 345 ELF32_R_TYPE(rel[i].r_info));
346 346#ifdef CONFIG_SMP
347 if ((unsigned long)location16 >= COREB_L1_DATA_A_START) {
348 printk(KERN_ERR "module %s: cannot relocate in L1: %u (SMP kernel)",
349 mod->name, ELF32_R_TYPE(rel[i].r_info));
350 return -ENOEXEC;
351 }
352#endif
347 switch (ELF32_R_TYPE(rel[i].r_info)) { 353 switch (ELF32_R_TYPE(rel[i].r_info)) {
348 354
349 case R_pcrel24: 355 case R_pcrel24:
@@ -436,6 +442,7 @@ module_finalize(const Elf_Ehdr * hdr,
436{ 442{
437 unsigned int i, strindex = 0, symindex = 0; 443 unsigned int i, strindex = 0, symindex = 0;
438 char *secstrings; 444 char *secstrings;
445 long err = 0;
439 446
440 secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 447 secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
441 448
@@ -460,8 +467,10 @@ module_finalize(const Elf_Ehdr * hdr,
460 (strcmp(".rela.l1.text", secstrings + sechdrs[i].sh_name) == 0) || 467 (strcmp(".rela.l1.text", secstrings + sechdrs[i].sh_name) == 0) ||
461 ((strcmp(".rela.text", secstrings + sechdrs[i].sh_name) == 0) && 468 ((strcmp(".rela.text", secstrings + sechdrs[i].sh_name) == 0) &&
462 (hdr->e_flags & (EF_BFIN_CODE_IN_L1|EF_BFIN_CODE_IN_L2))))) { 469 (hdr->e_flags & (EF_BFIN_CODE_IN_L1|EF_BFIN_CODE_IN_L2))))) {
463 apply_relocate_add((Elf_Shdr *) sechdrs, strtab, 470 err = apply_relocate_add((Elf_Shdr *) sechdrs, strtab,
464 symindex, i, mod); 471 symindex, i, mod);
472 if (err < 0)
473 return -ENOEXEC;
465 } 474 }
466 } 475 }
467 return 0; 476 return 0;