2 * PROJECT: ReactOS Kernel
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: ntoskrnl/ke/arm/ctxswtch.s
5 * PURPOSE: Context Switch and Idle Thread on ARM
6 * PROGRAMMERS: ReactOS Portable Systems Group
9 .title "ARM Context Switching"
10 .include "ntoskrnl/include/internal/arm/kxarm.h"
11 .include "ntoskrnl/include/internal/arm/ksarm.h"
14 NESTED_ENTRY KiSwapContext
15 PROLOG_END KiSwapContext
26 // Make space for the trap frame
28 sub sp, sp, #ExceptionFrameLength
31 // Build exception frame
32 // FIXME-PERF: Change to stmdb later
49 str sp, [a1, #ThKernelStack]
50 ldr sp, [a2, #ThKernelStack]
53 // Call the C context switch code
55 bl KiSwapContextInternal
58 // Get the SPSR and restore it
64 // Restore the registers
65 // FIXME-PERF: Use LDMIA later
80 add sp, sp, #ExceptionFrameLength
83 // Jump to saved restore address
87 ENTRY_END KiSwapContext
89 NESTED_ENTRY KiThreadStartup
90 PROLOG_END KiThreadStartup
99 // Set the start address and startup context
106 // Oh noes, we are back!
110 ENTRY_END KiThreadStartup
112 NESTED_ENTRY KiSwitchThreads
113 PROLOG_END KiSwitchThreads
118 ENTRY_END KiSwitchThreads
120 NESTED_ENTRY KiSwapContextInternal
121 PROLOG_END KiSwapContextInternal
126 ENTRY_END KiSwapContextInternal