]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/SemihostLib/Arm/GccSemihost.S
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPkg / Library / SemihostLib / Arm / GccSemihost.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
4 #
5 # SPDX-License-Identifier: BSD-2-Clause-Patent
6 #
7 #------------------------------------------------------------------------------
8
9 #include <AsmMacroIoLib.h>
10
11 /*
12 Semihosting operation request mechanism
13
14 SVC 0x123456 in ARM state (for all architectures)
15 SVC 0xAB in Thumb state (excluding ARMv7-M)
16 BKPT 0xAB for ARMv7-M (Thumb-2 only)
17
18 R0 - operation type
19 R1 - block containing all other parametes
20
21 lr - must be saved as svc instruction will cause an svc exception and write
22 the svc lr register. That happens to be the one we are using, so we must
23 save it or we will not be able to return.
24 */
25 ASM_FUNC(GccSemihostCall)
26 stmfd sp!, {lr}
27 svc #0x123456
28 ldmfd sp!, {lr}
29 bx lr
30
31