18#ifndef MBED_SEMIHOST_H
19#define MBED_SEMIHOST_H
27#if MBED_CONF_TARGET_SEMIHOSTING_ENABLED
29#if !defined(__ARMCC_VERSION)
31#if defined(__ICCARM__)
32static inline int __semihost(
int reason,
const void *arg)
34 return __semihosting(reason, (
void *)arg);
40# define AngelSWIInsn "bkpt"
41# define AngelSWIAsm bkpt
43# define AngelSWI 0x123456
44# define AngelSWIInsn "swi"
45# define AngelSWIAsm swi
48static inline int __semihost(
int reason,
const void *arg)
55 AngelSWIInsn
" %a3" "\n\t"
58 :
"r"(reason),
"r"(arg),
"i"(AngelSWI)
59 :
"r0",
"r1",
"r2",
"r3",
"ip",
"lr",
"memory",
"cc"
67FILEHANDLE semihost_open(
const char *name,
int openmode);
68int semihost_close(FILEHANDLE fh);
69int semihost_read(FILEHANDLE fh,
unsigned char *buffer,
unsigned int length,
int mode);
70int semihost_write(FILEHANDLE fh,
const unsigned char *buffer,
unsigned int length,
int mode);
71int semihost_ensure(FILEHANDLE fh);
72long semihost_flen(FILEHANDLE fh);
73int semihost_seek(FILEHANDLE fh,
long position);
74int semihost_istty(FILEHANDLE fh);
76int semihost_remove(
const char *name);
77int semihost_rename(
const char *old_name,
const char *new_name);
79int semihost_uid(
char *uid);
80int semihost_reset(
void);
81int semihost_vbus(
void);
82int semihost_powerdown(
void);
83int semihost_exit(
void);
85int semihost_connected(
void);
86int semihost_disabledebug(
void);