aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/relocate_kernel.S78
1 files changed, 40 insertions, 38 deletions
diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S
index a3f0d00c133..87481f916a6 100644
--- a/arch/mips/kernel/relocate_kernel.S
+++ b/arch/mips/kernel/relocate_kernel.S
@@ -14,67 +14,69 @@
14#include <asm/stackframe.h> 14#include <asm/stackframe.h>
15#include <asm/addrspace.h> 15#include <asm/addrspace.h>
16 16
17 .globl relocate_new_kernel 17LEAF(relocate_new_kernel)
18relocate_new_kernel: 18 PTR_L s0, kexec_indirection_page
19 19 PTR_L s1, kexec_start_address
20 PTR_L s0, kexec_indirection_page
21 PTR_L s1, kexec_start_address
22 20
23process_entry: 21process_entry:
24 PTR_L s2, (s0) 22 PTR_L s2, (s0)
25 PTR_ADD s0, s0, SZREG 23 PTR_ADD s0, s0, SZREG
26 24
27 /* destination page */ 25 /* destination page */
28 and s3, s2, 0x1 26 and s3, s2, 0x1
29 beq s3, zero, 1f 27 beq s3, zero, 1f
30 and s4, s2, ~0x1 /* store destination addr in s4 */ 28 and s4, s2, ~0x1 /* store destination addr in s4 */
31 move a0, s4 29 move a0, s4
32 b process_entry 30 b process_entry
33 31
341: 321:
35 /* indirection page, update s0 */ 33 /* indirection page, update s0 */
36 and s3, s2, 0x2 34 and s3, s2, 0x2
37 beq s3, zero, 1f 35 beq s3, zero, 1f
38 and s0, s2, ~0x2 36 and s0, s2, ~0x2
39 b process_entry 37 b process_entry
40 38
411: 391:
42 /* done page */ 40 /* done page */
43 and s3, s2, 0x4 41 and s3, s2, 0x4
44 beq s3, zero, 1f 42 beq s3, zero, 1f
45 b done 43 b done
461: 441:
47 /* source page */ 45 /* source page */
48 and s3, s2, 0x8 46 and s3, s2, 0x8
49 beq s3, zero, process_entry 47 beq s3, zero, process_entry
50 and s2, s2, ~0x8 48 and s2, s2, ~0x8
51 li s6, (1 << PAGE_SHIFT) / SZREG 49 li s6, (1 << PAGE_SHIFT) / SZREG
52 50
53copy_word: 51copy_word:
54 /* copy page word by word */ 52 /* copy page word by word */
55 REG_L s5, (s2) 53 REG_L s5, (s2)
56 REG_S s5, (s4) 54 REG_S s5, (s4)
57 INT_ADD s4, s4, SZREG 55 PTR_ADD s4, s4, SZREG
58 INT_ADD s2, s2, SZREG 56 PTR_ADD s2, s2, SZREG
59 INT_SUB s6, s6, 1 57 LONG_SUB s6, s6, 1
60 beq s6, zero, process_entry 58 beq s6, zero, process_entry
61 b copy_word 59 b copy_word
62 b process_entry 60 b process_entry
63 61
64done: 62done:
65 /* jump to kexec_start_address */ 63 /* jump to kexec_start_address */
66 j s1 64 j s1
65 END(relocate_new_kernel)
67 66
68 .globl kexec_start_address
69kexec_start_address: 67kexec_start_address:
70 .long 0x0 68 EXPORT(kexec_start_address)
69 PTR 0x0
70 .size kexec_start_address, PTRSIZE
71 71
72 .globl kexec_indirection_page
73kexec_indirection_page: 72kexec_indirection_page:
74 .long 0x0 73 EXPORT(kexec_indirection_page)
74 PTR 0
75 .size kexec_indirection_page, PTRSIZE
75 76
76relocate_new_kernel_end: 77relocate_new_kernel_end:
77 78
78 .globl relocate_new_kernel_size
79relocate_new_kernel_size: 79relocate_new_kernel_size:
80 .long relocate_new_kernel_end - relocate_new_kernel 80 EXPORT(relocate_new_kernel_size)
81 PTR relocate_new_kernel_end - relocate_new_kernel
82 .size relocate_new_kernel_size, PTRSIZE