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