- Timestamp:
- 2016-04-21T20:00:18Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 054476d
- Parents:
- 96521f2f
- Location:
- kernel/arch/arm32
- Files:
-
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/Makefile.inc
r96521f2f r73b3ecd 33 33 ATSIGN = % 34 34 35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access 35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access -mfpu=vfpv3 36 36 37 37 ifeq ($(CONFIG_FPU),y) … … 70 70 ifeq ($(CONFIG_FPU),y) 71 71 ARCH_SOURCES += arch/$(KARCH)/src/fpu_context.c 72 ARCH_SOURCES += arch/$(KARCH)/src/fpu. s72 ARCH_SOURCES += arch/$(KARCH)/src/fpu.S 73 73 endif 74 74 -
kernel/arch/arm32/src/asm.S
r96521f2f r73b3ecd 27 27 */ 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global memcpy_from_uspace 32 .global memcpy_to_uspace 33 .global memcpy_from_uspace_failover_address 34 .global memcpy_to_uspace_failover_address 35 .global early_putchar 36 37 memcpy_from_uspace: 38 memcpy_to_uspace: 33 FUNCTION_BEGIN(memcpy_from_uspace) 34 FUNCTION_BEGIN(memcpy_to_uspace) 39 35 add r3, r1, #3 40 36 bic r3, r3, #3 … … 94 90 bne 7b 95 91 b 3b 92 FUNCTION_END(memcpy_from_uspace) 93 FUNCTION_END(memcpy_to_uspace) 96 94 97 memcpy_from_uspace_failover_address: 98 memcpy_to_uspace_failover_address: 95 SYMBOL(memcpy_from_uspace_failover_address) 96 SYMBOL(memcpy_to_uspace_failover_address) 99 97 mov r0, #0 100 98 ldmia sp!, {r4, r5, pc} 101 99 102 early_putchar: 100 FUNCTION_BEGIN(early_putchar) 103 101 mov pc, lr 102 FUNCTION_END(early_putchar) 103 -
kernel/arch/arm32/src/context.S
r96521f2f r73b3ecd 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global context_save_arch 32 .global context_restore_arch 33 34 context_save_arch: 33 FUNCTION_BEGIN(context_save_arch) 35 34 stmfd sp!, {r1} 36 35 mrs r1, cpsr … … 44 43 mov r0, #1 45 44 mov pc, lr 45 FUNCTION_END(context_save_arch) 46 46 47 48 context_restore_arch: 47 FUNCTION_BEGIN(context_restore_arch) 49 48 ldmia r0!, {r4} 50 49 mrs r5, cpsr … … 58 57 mov r0, #0 59 58 mov pc, lr 59 FUNCTION_END(context_restore_arch) 60 -
kernel/arch/arm32/src/debug/stacktrace_asm.S
r96521f2f r73b3ecd 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global frame_pointer_get 32 .global program_counter_get 33 34 frame_pointer_get: 33 FUNCTION_BEGIN(frame_pointer_get) 35 34 mov r0, fp 36 35 mov pc, lr 36 FUNCTION_END(frame_pointer_get) 37 37 38 program_counter_get: 38 FUNCTION_BEGIN(program_counter_get) 39 39 mov r0, lr 40 40 mov pc, lr 41 FUNCTION_END(program_counter_get) 42 -
kernel/arch/arm32/src/dummy.S
r96521f2f r73b3ecd 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global calibrate_delay_loop 32 .global asm_delay_loop 33 FUNCTION_BEGIN(calibrate_delay_loop) 34 mov pc, lr 35 FUNCTION_END(calibrate_delay_loop) 33 36 34 .global sys_tls_set 35 .global dummy 36 37 calibrate_delay_loop: 37 FUNCTION_BEGIN(asm_delay_loop) 38 38 mov pc, lr 39 40 asm_delay_loop: 41 mov pc, lr 39 FUNCTION_END(asm_delay_loop) 42 40 43 41 # not used on ARM 44 sys_tls_set: 42 FUNCTION_BEGIN(sys_tls_set) 43 FUNCTION_BEGIN(dummy) 44 mov pc, lr 45 FUNCTION_END(dummy) 46 FUNCTION_END(sys_tls_set) 45 47 46 dummy:47 mov pc, lr -
kernel/arch/arm32/src/eabi.S
r96521f2f r73b3ecd 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global __aeabi_idiv 32 .global __aeabi_uidiv 33 34 .global __aeabi_idivmod 35 .global __aeabi_uidivmod 36 37 .global __aeabi_ldivmod 38 .global __aeabi_uldivmod 39 40 __aeabi_idiv: 33 FUNCTION_BEGIN(__aeabi_idiv) 41 34 push {lr} 42 35 bl __divsi3 43 36 pop {lr} 44 37 mov pc, lr 38 FUNCTION_END(__aeabi_idiv) 45 39 46 __aeabi_uidiv: 40 FUNCTION_BEGIN(__aeabi_uidiv) 47 41 push {lr} 48 42 bl __udivsi3 49 43 pop {lr} 50 44 mov pc, lr 45 FUNCTION_END(__aeabi_uidiv) 51 46 52 __aeabi_idivmod: 47 FUNCTION_BEGIN(__aeabi_idivmod) 53 48 push {lr} 54 49 sub sp, sp, #12 … … 59 54 pop {lr} 60 55 mov pc, lr 56 FUNCTION_END(__aeabi_idivmod) 61 57 62 __aeabi_uidivmod: 58 FUNCTION_BEGIN(__aeabi_uidivmod) 63 59 push {lr} 64 60 sub sp, sp, #12 … … 69 65 pop {lr} 70 66 mov pc, lr 67 FUNCTION_END(__aeabi_uidivmod) 71 68 72 __aeabi_ldivmod: 69 FUNCTION_BEGIN(__aeabi_ldivmod) 73 70 push {lr} 74 71 sub sp, sp, #24 … … 80 77 pop {lr} 81 78 mov pc, lr 79 FUNCTION_END(__aeabi_ldivmod) 82 80 83 __aeabi_uldivmod: 81 FUNCTION_BEGIN(__aeabi_uldivmod) 84 82 push {lr} 85 83 sub sp, sp, #24 … … 91 89 pop {lr} 92 90 mov pc, lr 91 FUNCTION_END(__aeabi_uldivmod) 92 -
kernel/arch/arm32/src/exc_handler.S
r96521f2f r73b3ecd 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 31 .global irq_exception_entry32 .global fiq_exception_entry33 .global data_abort_exception_entry34 .global prefetch_abort_exception_entry35 .global undef_instr_exception_entry36 .global swi_exception_entry37 .global reset_exception_entry38 39 32 40 33 # Switches to kernel stack and saves all registers there. … … 156 149 .endm 157 150 158 reset_exception_entry: 151 SYMBOL(reset_exception_entry) 159 152 SAVE_REGS_TO_STACK 160 153 mov r0, #0 … … 163 156 LOAD_REGS_FROM_STACK 164 157 165 irq_exception_entry: 158 SYMBOL(irq_exception_entry) 166 159 sub lr, lr, #4 167 160 SAVE_REGS_TO_STACK … … 171 164 LOAD_REGS_FROM_STACK 172 165 173 fiq_exception_entry: 166 SYMBOL(fiq_exception_entry) 174 167 sub lr, lr, #4 175 168 SAVE_REGS_TO_STACK … … 179 172 LOAD_REGS_FROM_STACK 180 173 181 undef_instr_exception_entry: 174 SYMBOL(undef_instr_exception_entry) 182 175 SAVE_REGS_TO_STACK 183 176 mov r0, #1 … … 186 179 LOAD_REGS_FROM_STACK 187 180 188 prefetch_abort_exception_entry: 181 SYMBOL(prefetch_abort_exception_entry) 189 182 sub lr, lr, #4 190 183 SAVE_REGS_TO_STACK … … 194 187 LOAD_REGS_FROM_STACK 195 188 196 data_abort_exception_entry: 189 SYMBOL(data_abort_exception_entry) 197 190 sub lr, lr, #8 198 191 SAVE_REGS_TO_STACK … … 202 195 LOAD_REGS_FROM_STACK 203 196 204 swi_exception_entry: 197 SYMBOL(swi_exception_entry) 205 198 ldr r13, =exc_stack 206 199 SAVE_REGS_TO_STACK -
kernel/arch/arm32/src/fpu.S
r96521f2f r73b3ecd 27 27 */ 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global fpsid_read 32 .global mvfr0_read 33 .global fpscr_read 34 .global fpscr_write 35 .global fpexc_read 36 .global fpexc_write 37 38 .global fpu_context_save_s32 39 .global fpu_context_restore_s32 40 .global fpu_context_save_d16 41 .global fpu_context_restore_d16 42 .global fpu_context_save_d32 43 .global fpu_context_restore_d32 44 45 fpsid_read: 33 FUNCTION_BEGIN(fpsid_read) 46 34 vmrs r0, fpsid 47 35 mov pc, lr 36 FUNCTION_END(fpsid_read) 48 37 49 mvfr0_read: 38 FUNCTION_BEGIN(mvfr0_read) 50 39 vmrs r0, mvfr0 51 40 mov pc, lr 41 FUNCTION_END(mvfr0_read) 52 42 53 fpscr_read: 43 FUNCTION_BEGIN(fpscr_read) 54 44 vmrs r0, fpscr 55 45 mov pc, lr 46 FUNCTION_END(fpscr_read) 56 47 57 fpscr_write: 48 FUNCTION_BEGIN(fpscr_write) 58 49 vmsr fpscr, r0 59 50 mov pc, lr 51 FUNCTION_END(fpscr_write) 60 52 61 fpexc_read: 53 FUNCTION_BEGIN(fpexc_read) 62 54 vmrs r0, fpexc 63 55 mov pc, lr 56 FUNCTION_END(fpexc_read) 64 57 65 fpexc_write: 58 FUNCTION_BEGIN(fpexc_write) 66 59 vmsr fpexc, r0 67 60 mov pc, lr 61 FUNCTION_END(fpexc_write) 68 62 69 fpu_context_save_s32: 63 FUNCTION_BEGIN(fpu_context_save_s32) 70 64 vmrs r1, fpexc 71 65 vmrs r2, fpscr … … 73 67 vstmia r0!, {s0-s31} 74 68 mov pc, lr 69 FUNCTION_END(fpu_context_save_s32) 75 70 76 fpu_context_restore_s32: 71 FUNCTION_BEGIN(fpu_context_restore_s32) 77 72 ldmia r0!, {r1, r2} 78 73 vmsr fpexc, r1 … … 80 75 vldmia r0!, {s0-s31} 81 76 mov pc, lr 77 FUNCTION_END(fpu_context_restore_s32) 82 78 83 fpu_context_save_d16: 79 FUNCTION_BEGIN(fpu_context_save_d16) 84 80 vmrs r1, fpexc 85 81 vmrs r2, fpscr … … 87 83 vstmia r0!, {d0-d15} 88 84 mov pc, lr 85 FUNCTION_END(fpu_context_save_d16) 89 86 90 fpu_context_restore_d16: 87 FUNCTION_BEGIN(fpu_context_restore_d16) 91 88 ldmia r0!, {r1, r2} 92 89 vmsr fpexc, r1 … … 94 91 vldmia r0!, {d0-d15} 95 92 mov pc, lr 93 FUNCTION_END(fpu_context_restore_d16) 96 94 97 fpu_context_save_d32: 95 FUNCTION_BEGIN(fpu_context_save_d32) 98 96 vmrs r1, fpexc 99 97 stmia r0!, {r1} … … 103 101 vstmia r0!, {d16-d31} 104 102 mov pc, lr 103 FUNCTION_END(fpu_context_save_d32) 105 104 106 fpu_context_restore_d32: 105 FUNCTION_BEGIN(fpu_context_restore_d32) 107 106 ldmia r0!, {r1, r2} 108 107 vmsr fpexc, r1 … … 111 110 vldmia r0!, {d16-d31} 112 111 mov pc, lr 112 FUNCTION_END(fpu_context_restore_d32) 113 113 114 115 -
kernel/arch/arm32/src/start.S
r96521f2f r73b3ecd 27 27 # 28 28 29 #include <abi/asmtool.h> 29 30 #include <arch/asm/boot.h> 30 31 31 32 .text 32 33 33 .global kernel_image_start 34 .global exc_stack 35 .global supervisor_sp 36 37 kernel_image_start: 38 34 SYMBOL(kernel_image_start) 39 35 # initialize Stack pointer for exception modes 40 36 mrs r4, cpsr … … 83 79 84 80 .space 1024 85 exc_stack: 81 SYMBOL(exc_stack) 86 82 87 supervisor_sp: 83 SYMBOL(supervisor_sp) 88 84 .space 4
Note:
See TracChangeset
for help on using the changeset viewer.