diff options
Diffstat (limited to 'arch/arm/kernel/entry-armv.S')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 106 |
1 files changed, 55 insertions, 51 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a39cfc2a1f90..9cbe70c8b0ef 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -357,7 +357,8 @@ ENDPROC(__pabt_svc) | |||
357 | .endm | 357 | .endm |
358 | 358 | ||
359 | .macro kuser_cmpxchg_check | 359 | .macro kuser_cmpxchg_check |
360 | #if !defined(CONFIG_CPU_32v6K) && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) | 360 | #if !defined(CONFIG_CPU_32v6K) && defined(CONFIG_KUSER_HELPERS) && \ |
361 | !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) | ||
361 | #ifndef CONFIG_MMU | 362 | #ifndef CONFIG_MMU |
362 | #warning "NPTL on non MMU needs fixing" | 363 | #warning "NPTL on non MMU needs fixing" |
363 | #else | 364 | #else |
@@ -742,6 +743,18 @@ ENDPROC(__switch_to) | |||
742 | #endif | 743 | #endif |
743 | .endm | 744 | .endm |
744 | 745 | ||
746 | .macro kuser_pad, sym, size | ||
747 | .if (. - \sym) & 3 | ||
748 | .rept 4 - (. - \sym) & 3 | ||
749 | .byte 0 | ||
750 | .endr | ||
751 | .endif | ||
752 | .rept (\size - (. - \sym)) / 4 | ||
753 | .word 0xe7fddef1 | ||
754 | .endr | ||
755 | .endm | ||
756 | |||
757 | #ifdef CONFIG_KUSER_HELPERS | ||
745 | .align 5 | 758 | .align 5 |
746 | .globl __kuser_helper_start | 759 | .globl __kuser_helper_start |
747 | __kuser_helper_start: | 760 | __kuser_helper_start: |
@@ -832,18 +845,13 @@ kuser_cmpxchg64_fixup: | |||
832 | #error "incoherent kernel configuration" | 845 | #error "incoherent kernel configuration" |
833 | #endif | 846 | #endif |
834 | 847 | ||
835 | /* pad to next slot */ | 848 | kuser_pad __kuser_cmpxchg64, 64 |
836 | .rept (16 - (. - __kuser_cmpxchg64)/4) | ||
837 | .word 0 | ||
838 | .endr | ||
839 | |||
840 | .align 5 | ||
841 | 849 | ||
842 | __kuser_memory_barrier: @ 0xffff0fa0 | 850 | __kuser_memory_barrier: @ 0xffff0fa0 |
843 | smp_dmb arm | 851 | smp_dmb arm |
844 | usr_ret lr | 852 | usr_ret lr |
845 | 853 | ||
846 | .align 5 | 854 | kuser_pad __kuser_memory_barrier, 32 |
847 | 855 | ||
848 | __kuser_cmpxchg: @ 0xffff0fc0 | 856 | __kuser_cmpxchg: @ 0xffff0fc0 |
849 | 857 | ||
@@ -916,13 +924,14 @@ kuser_cmpxchg32_fixup: | |||
916 | 924 | ||
917 | #endif | 925 | #endif |
918 | 926 | ||
919 | .align 5 | 927 | kuser_pad __kuser_cmpxchg, 32 |
920 | 928 | ||
921 | __kuser_get_tls: @ 0xffff0fe0 | 929 | __kuser_get_tls: @ 0xffff0fe0 |
922 | ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init | 930 | ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init |
923 | usr_ret lr | 931 | usr_ret lr |
924 | mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code | 932 | mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code |
925 | .rep 4 | 933 | kuser_pad __kuser_get_tls, 16 |
934 | .rep 3 | ||
926 | .word 0 @ 0xffff0ff0 software TLS value, then | 935 | .word 0 @ 0xffff0ff0 software TLS value, then |
927 | .endr @ pad up to __kuser_helper_version | 936 | .endr @ pad up to __kuser_helper_version |
928 | 937 | ||
@@ -932,14 +941,16 @@ __kuser_helper_version: @ 0xffff0ffc | |||
932 | .globl __kuser_helper_end | 941 | .globl __kuser_helper_end |
933 | __kuser_helper_end: | 942 | __kuser_helper_end: |
934 | 943 | ||
944 | #endif | ||
945 | |||
935 | THUMB( .thumb ) | 946 | THUMB( .thumb ) |
936 | 947 | ||
937 | /* | 948 | /* |
938 | * Vector stubs. | 949 | * Vector stubs. |
939 | * | 950 | * |
940 | * This code is copied to 0xffff0200 so we can use branches in the | 951 | * This code is copied to 0xffff1000 so we can use branches in the |
941 | * vectors, rather than ldr's. Note that this code must not | 952 | * vectors, rather than ldr's. Note that this code must not exceed |
942 | * exceed 0x300 bytes. | 953 | * a page size. |
943 | * | 954 | * |
944 | * Common stub entry macro: | 955 | * Common stub entry macro: |
945 | * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC | 956 | * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC |
@@ -986,8 +997,17 @@ ENDPROC(vector_\name) | |||
986 | 1: | 997 | 1: |
987 | .endm | 998 | .endm |
988 | 999 | ||
989 | .globl __stubs_start | 1000 | .section .stubs, "ax", %progbits |
990 | __stubs_start: | 1001 | __stubs_start: |
1002 | @ This must be the first word | ||
1003 | .word vector_swi | ||
1004 | |||
1005 | vector_rst: | ||
1006 | ARM( swi SYS_ERROR0 ) | ||
1007 | THUMB( svc #0 ) | ||
1008 | THUMB( nop ) | ||
1009 | b vector_und | ||
1010 | |||
991 | /* | 1011 | /* |
992 | * Interrupt dispatcher | 1012 | * Interrupt dispatcher |
993 | */ | 1013 | */ |
@@ -1082,6 +1102,16 @@ __stubs_start: | |||
1082 | .align 5 | 1102 | .align 5 |
1083 | 1103 | ||
1084 | /*============================================================================= | 1104 | /*============================================================================= |
1105 | * Address exception handler | ||
1106 | *----------------------------------------------------------------------------- | ||
1107 | * These aren't too critical. | ||
1108 | * (they're not supposed to happen, and won't happen in 32-bit data mode). | ||
1109 | */ | ||
1110 | |||
1111 | vector_addrexcptn: | ||
1112 | b vector_addrexcptn | ||
1113 | |||
1114 | /*============================================================================= | ||
1085 | * Undefined FIQs | 1115 | * Undefined FIQs |
1086 | *----------------------------------------------------------------------------- | 1116 | *----------------------------------------------------------------------------- |
1087 | * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC | 1117 | * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC |
@@ -1094,45 +1124,19 @@ __stubs_start: | |||
1094 | vector_fiq: | 1124 | vector_fiq: |
1095 | subs pc, lr, #4 | 1125 | subs pc, lr, #4 |
1096 | 1126 | ||
1097 | /*============================================================================= | 1127 | .globl vector_fiq_offset |
1098 | * Address exception handler | 1128 | .equ vector_fiq_offset, vector_fiq |
1099 | *----------------------------------------------------------------------------- | ||
1100 | * These aren't too critical. | ||
1101 | * (they're not supposed to happen, and won't happen in 32-bit data mode). | ||
1102 | */ | ||
1103 | |||
1104 | vector_addrexcptn: | ||
1105 | b vector_addrexcptn | ||
1106 | |||
1107 | /* | ||
1108 | * We group all the following data together to optimise | ||
1109 | * for CPUs with separate I & D caches. | ||
1110 | */ | ||
1111 | .align 5 | ||
1112 | |||
1113 | .LCvswi: | ||
1114 | .word vector_swi | ||
1115 | |||
1116 | .globl __stubs_end | ||
1117 | __stubs_end: | ||
1118 | |||
1119 | .equ stubs_offset, __vectors_start + 0x200 - __stubs_start | ||
1120 | 1129 | ||
1121 | .globl __vectors_start | 1130 | .section .vectors, "ax", %progbits |
1122 | __vectors_start: | 1131 | __vectors_start: |
1123 | ARM( swi SYS_ERROR0 ) | 1132 | W(b) vector_rst |
1124 | THUMB( svc #0 ) | 1133 | W(b) vector_und |
1125 | THUMB( nop ) | 1134 | W(ldr) pc, __vectors_start + 0x1000 |
1126 | W(b) vector_und + stubs_offset | 1135 | W(b) vector_pabt |
1127 | W(ldr) pc, .LCvswi + stubs_offset | 1136 | W(b) vector_dabt |
1128 | W(b) vector_pabt + stubs_offset | 1137 | W(b) vector_addrexcptn |
1129 | W(b) vector_dabt + stubs_offset | 1138 | W(b) vector_irq |
1130 | W(b) vector_addrexcptn + stubs_offset | 1139 | W(b) vector_fiq |
1131 | W(b) vector_irq + stubs_offset | ||
1132 | W(b) vector_fiq + stubs_offset | ||
1133 | |||
1134 | .globl __vectors_end | ||
1135 | __vectors_end: | ||
1136 | 1140 | ||
1137 | .data | 1141 | .data |
1138 | 1142 | ||