]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/SemihostLib/Arm/GccSemihost.S
ARM Packages: Fixed line endings
[mirror_edk2.git] / ArmPkg / Library / SemihostLib / Arm / GccSemihost.S
CommitLineData
1e57a462 1#------------------------------------------------------------------------------ \r
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
15.text\r
16.align 2\r
17\r
18.globl ASM_PFX(GccSemihostCall)\r
19INTERWORK_FUNC(GccSemihostCall)\r
20\r
21/*\r
22 Semihosting operation request mechanism\r
23 \r
24 SVC 0x123456 in ARM state (for all architectures)\r
25 SVC 0xAB in Thumb state (excluding ARMv7-M)\r
26 BKPT 0xAB for ARMv7-M (Thumb-2 only)\r
27 \r
28 R0 - operation type \r
29 R1 - block containing all other parametes\r
30 \r
31 lr - must be saved as svc instruction will cause an svc exception and write \r
32 the svc lr register. That happens to be the one we are using, so we must\r
33 save it or we will not be able to return. \r
34 */\r
35ASM_PFX(GccSemihostCall):\r
7d952405 36 stmfd sp!, {lr} \r
1e57a462 37 svc #0x123456 \r
7d952405 38 ldmfd sp!, {lr}\r
1e57a462 39 bx lr\r
40\r
41\r