diff options
Diffstat (limited to 'arch/arm/kernel/entry-armv.S')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a52baedf6262..874e6bb79405 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 1996,1997,1998 Russell King. | 4 | * Copyright (C) 1996,1997,1998 Russell King. |
5 | * ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk) | 5 | * ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk) |
6 | * nommu support by Hyok S. Choi (hyok.choi@samsung.com) | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -104,14 +105,24 @@ common_invalid: | |||
104 | /* | 105 | /* |
105 | * SVC mode handlers | 106 | * SVC mode handlers |
106 | */ | 107 | */ |
108 | |||
109 | #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) | ||
110 | #define SPFIX(code...) code | ||
111 | #else | ||
112 | #define SPFIX(code...) | ||
113 | #endif | ||
114 | |||
107 | .macro svc_entry | 115 | .macro svc_entry |
108 | sub sp, sp, #S_FRAME_SIZE | 116 | sub sp, sp, #S_FRAME_SIZE |
117 | SPFIX( tst sp, #4 ) | ||
118 | SPFIX( bicne sp, sp, #4 ) | ||
109 | stmib sp, {r1 - r12} | 119 | stmib sp, {r1 - r12} |
110 | 120 | ||
111 | ldmia r0, {r1 - r3} | 121 | ldmia r0, {r1 - r3} |
112 | add r5, sp, #S_SP @ here for interlock avoidance | 122 | add r5, sp, #S_SP @ here for interlock avoidance |
113 | mov r4, #-1 @ "" "" "" "" | 123 | mov r4, #-1 @ "" "" "" "" |
114 | add r0, sp, #S_FRAME_SIZE @ "" "" "" "" | 124 | add r0, sp, #S_FRAME_SIZE @ "" "" "" "" |
125 | SPFIX( addne r0, r0, #4 ) | ||
115 | str r1, [sp] @ save the "real" r0 copied | 126 | str r1, [sp] @ save the "real" r0 copied |
116 | @ from the exception stack | 127 | @ from the exception stack |
117 | 128 | ||
@@ -302,7 +313,14 @@ __pabt_svc: | |||
302 | 313 | ||
303 | /* | 314 | /* |
304 | * User mode handlers | 315 | * User mode handlers |
316 | * | ||
317 | * EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE | ||
305 | */ | 318 | */ |
319 | |||
320 | #if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7) | ||
321 | #error "sizeof(struct pt_regs) must be a multiple of 8" | ||
322 | #endif | ||
323 | |||
306 | .macro usr_entry | 324 | .macro usr_entry |
307 | sub sp, sp, #S_FRAME_SIZE | 325 | sub sp, sp, #S_FRAME_SIZE |
308 | stmib sp, {r1 - r12} | 326 | stmib sp, {r1 - r12} |
@@ -538,7 +556,11 @@ ENTRY(__switch_to) | |||
538 | add ip, r1, #TI_CPU_SAVE | 556 | add ip, r1, #TI_CPU_SAVE |
539 | ldr r3, [r2, #TI_TP_VALUE] | 557 | ldr r3, [r2, #TI_TP_VALUE] |
540 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack | 558 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack |
559 | #ifndef CONFIG_MMU | ||
560 | add r2, r2, #TI_CPU_DOMAIN | ||
561 | #else | ||
541 | ldr r6, [r2, #TI_CPU_DOMAIN]! | 562 | ldr r6, [r2, #TI_CPU_DOMAIN]! |
563 | #endif | ||
542 | #if __LINUX_ARM_ARCH__ >= 6 | 564 | #if __LINUX_ARM_ARCH__ >= 6 |
543 | #ifdef CONFIG_CPU_MPCORE | 565 | #ifdef CONFIG_CPU_MPCORE |
544 | clrex | 566 | clrex |
@@ -556,7 +578,9 @@ ENTRY(__switch_to) | |||
556 | mov r4, #0xffff0fff | 578 | mov r4, #0xffff0fff |
557 | str r3, [r4, #-15] @ TLS val at 0xffff0ff0 | 579 | str r3, [r4, #-15] @ TLS val at 0xffff0ff0 |
558 | #endif | 580 | #endif |
581 | #ifdef CONFIG_MMU | ||
559 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register | 582 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register |
583 | #endif | ||
560 | #ifdef CONFIG_VFP | 584 | #ifdef CONFIG_VFP |
561 | @ Always disable VFP so we can lazily save/restore the old | 585 | @ Always disable VFP so we can lazily save/restore the old |
562 | @ state. This occurs in the context of the previous thread. | 586 | @ state. This occurs in the context of the previous thread. |