Datasheet

Semihosting
5-12 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI0058D
Note
When used with Angel, these SWIs use the serializer and the global register block, and
they can take a significant length of time to process.
5.4.1 SYS_OPEN (0x01)
Open a file on the host system. The file path is specified either as relative to the current
directory of the host process, or absolutely, using the path conventions of the host
operating system.
The ARM targets interpret the special path name
:tt
as meaning the console input
stream (for an open-read) or the console output stream (for an open-write). Opening
these streams is performed as part of the standard startup code for those applications
that reference the C stdio streams.
Entry
On entry, r1 contains a pointer to a three-word argument block:
word 1 This is a pointer to a null-terminated string containing a file or device
name.
word 2 This is an integer that specifies the file opening mode. Table 5-2 gives the
valid values for the integer, and their corresponding ANSI C
fopen()
mode.
word 3 This is an integer that gives the length of the string pointed to by word 1.
The length does not include the terminating null character that must be
present.
SYS_HEAPINFO (0x16) on page 5-25 Get the system heap parameters
SYS_ELAPSED (0x30) on page 5-26 Get the number of target ticks since execution started
SYS_TICKFREQ (0x31) on page 5-26 Determine the tick frequency
Table 5-1 Semihosting SWIs (continued)
SWI Description
Table 5-2 Value of mode
mode 01 2 3 4 5 6 7 89 10 11
ANSI C fopen mode r rb r+ r+b w wb w+ w+b a ab a+ a+b