First of all, I'm new when it comes to ARM assembly. I actually have some pieces of code written for ARM instruction set, but my target is a Cortex-M4 architecture using Thumb-2 instruction set. Do I have to re-write the whole code, change some of it or keep it the way it is?
I actually have several files of approximately 250 lines each. Here is a sample
msr cpsr_c, #(CPSR_IRQ_LOCKED | CPSR_SVC_MODE)
stmfd sp!, {r0-r2,lr}
mrs r1, spsr
stmfd sp!, {r1}
ldr r1, =nested_kernel_entrance_counter
ldr r2, [r1]
add r2, r2, #1
str r2, [r1]
cmp r2, #1
bhi skip_kernel_enter
#if WITH_MEMORY_PROTECTION == YES
stmfd sp!, {r3}
bl tpl_mp_kernel_enter
ldmfd sp!, {r3}
#endif
ldr r1, =tpl_kern
mov r2, #NO_NEED_SWITCH
strb r2, [r1, #TPL_KERN_OFFSET_NEED_SWITCH]