]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/SemihostLib/Arm/GccSemihost.S
ArmPkg/SemihostLib: switch to ASM_FUNC() asm macro
[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
5# This program and the accompanying materials\r
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12#\r
13#------------------------------------------------------------------------------\r
14\r
22b080c7 15#include <AsmMacroIoLib.h>\r
1e57a462 16\r
17/*\r
18 Semihosting operation request mechanism\r
3402aac7 19\r
1e57a462 20 SVC 0x123456 in ARM state (for all architectures)\r
21 SVC 0xAB in Thumb state (excluding ARMv7-M)\r
22 BKPT 0xAB for ARMv7-M (Thumb-2 only)\r
3402aac7
RC
23\r
24 R0 - operation type\r
1e57a462 25 R1 - block containing all other parametes\r
3402aac7
RC
26\r
27 lr - must be saved as svc instruction will cause an svc exception and write\r
1e57a462 28 the svc lr register. That happens to be the one we are using, so we must\r
3402aac7 29 save it or we will not be able to return.\r
1e57a462 30 */\r
22b080c7 31ASM_FUNC(GccSemihostCall)\r
3402aac7
RC
32 stmfd sp!, {lr}\r
33 svc #0x123456\r
7d952405 34 ldmfd sp!, {lr}\r
1e57a462 35 bx lr\r
36\r
37\r