aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300/kernel')
-rw-r--r--arch/mn10300/kernel/gdb-stub.c24
-rw-r--r--arch/mn10300/kernel/module.c35
2 files changed, 9 insertions, 50 deletions
diff --git a/arch/mn10300/kernel/gdb-stub.c b/arch/mn10300/kernel/gdb-stub.c
index 54be6afb5555..0ea7482c1522 100644
--- a/arch/mn10300/kernel/gdb-stub.c
+++ b/arch/mn10300/kernel/gdb-stub.c
@@ -522,17 +522,7 @@ static int gdbstub_single_step(struct pt_regs *regs)
522 } else { 522 } else {
523 switch (cur) { 523 switch (cur) {
524 /* Bxx (d8,PC) */ 524 /* Bxx (d8,PC) */
525 case 0xc0: 525 case 0xc0 ... 0xca:
526 case 0xc1:
527 case 0xc2:
528 case 0xc3:
529 case 0xc4:
530 case 0xc5:
531 case 0xc6:
532 case 0xc7:
533 case 0xc8:
534 case 0xc9:
535 case 0xca:
536 if (gdbstub_read_byte(pc + 1, (u8 *) &x) < 0) 526 if (gdbstub_read_byte(pc + 1, (u8 *) &x) < 0)
537 goto fault; 527 goto fault;
538 if (!__gdbstub_mark_bp(pc + 2, 0)) 528 if (!__gdbstub_mark_bp(pc + 2, 0))
@@ -543,17 +533,7 @@ static int gdbstub_single_step(struct pt_regs *regs)
543 break; 533 break;
544 534
545 /* LXX (d8,PC) */ 535 /* LXX (d8,PC) */
546 case 0xd0: 536 case 0xd0 ... 0xda:
547 case 0xd1:
548 case 0xd2:
549 case 0xd3:
550 case 0xd4:
551 case 0xd5:
552 case 0xd6:
553 case 0xd7:
554 case 0xd8:
555 case 0xd9:
556 case 0xda:
557 if (!__gdbstub_mark_bp(pc + 1, 0)) 537 if (!__gdbstub_mark_bp(pc + 1, 0))
558 goto fault; 538 goto fault;
559 if (regs->pc != regs->lar && 539 if (regs->pc != regs->lar &&
diff --git a/arch/mn10300/kernel/module.c b/arch/mn10300/kernel/module.c
index 8fa36893df7a..6b287f2e8e84 100644
--- a/arch/mn10300/kernel/module.c
+++ b/arch/mn10300/kernel/module.c
@@ -1,6 +1,6 @@
1/* MN10300 Kernel module helper routines 1/* MN10300 Kernel module helper routines
2 * 2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. 3 * Copyright (C) 2007, 2008 Red Hat, Inc. All Rights Reserved.
4 * Written by Mark Salter (msalter@redhat.com) 4 * Written by Mark Salter (msalter@redhat.com)
5 * - Derived from arch/i386/kernel/module.c 5 * - Derived from arch/i386/kernel/module.c
6 * 6 *
@@ -64,21 +64,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
64 return 0; 64 return 0;
65} 65}
66 66
67static uint32_t reloc_get16(uint8_t *p)
68{
69 return p[0] | (p[1] << 8);
70}
71
72static uint32_t reloc_get24(uint8_t *p)
73{
74 return reloc_get16(p) | (p[2] << 16);
75}
76
77static uint32_t reloc_get32(uint8_t *p)
78{
79 return reloc_get16(p) | (reloc_get16(p+2) << 16);
80}
81
82static void reloc_put16(uint8_t *p, uint32_t val) 67static void reloc_put16(uint8_t *p, uint32_t val)
83{ 68{
84 p[0] = val & 0xff; 69 p[0] = val & 0xff;
@@ -144,25 +129,19 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
144 relocation = sym->st_value + rel[i].r_addend; 129 relocation = sym->st_value + rel[i].r_addend;
145 130
146 switch (ELF32_R_TYPE(rel[i].r_info)) { 131 switch (ELF32_R_TYPE(rel[i].r_info)) {
147 /* for the first four relocation types, we add the 132 /* for the first four relocation types, we simply
148 * adjustment into the value at the location given */ 133 * store the adjustment at the location given */
149 case R_MN10300_32: 134 case R_MN10300_32:
150 value = reloc_get32(location); 135 reloc_put32(location, relocation);
151 value += relocation;
152 reloc_put32(location, value);
153 break; 136 break;
154 case R_MN10300_24: 137 case R_MN10300_24:
155 value = reloc_get24(location); 138 reloc_put24(location, relocation);
156 value += relocation;
157 reloc_put24(location, value);
158 break; 139 break;
159 case R_MN10300_16: 140 case R_MN10300_16:
160 value = reloc_get16(location); 141 reloc_put16(location, relocation);
161 value += relocation;
162 reloc_put16(location, value);
163 break; 142 break;
164 case R_MN10300_8: 143 case R_MN10300_8:
165 *location += relocation; 144 *location = relocation;
166 break; 145 break;
167 146
168 /* for the next three relocation types, we write the 147 /* for the next three relocation types, we write the