13#ifndef CMSIS_PLUS_ARM_SEMIHOSTING_H_
14#define CMSIS_PLUS_ARM_SEMIHOSTING_H_
18#if defined(OS_USE_OS_APP_CONFIG_H)
19#include <cmsis-plus/os-app-config.h>
24#if defined(__cplusplus)
69#define AngelSWI_ARM 0x123456
73#define AngelSWI AngelSWI_ARM
76#if defined(__ARM_ARCH_7M__) \
77 || defined(__ARM_ARCH_7EM__) \
78 || defined(__ARM_ARCH_6M__)
79#define AngelSWIInsn "bkpt"
80#define AngelSWIAsm bkpt
82#define AngelSWIInsn "swi"
83#define AngelSWIAsm swi
86#if defined(OS_DEBUG_SEMIHOSTING_FAULTS)
91#define AngelSWITestFault "setend be"
92#define AngelSWITestFaultOpCode (0xB658)
95#pragma GCC diagnostic push
96#pragma GCC diagnostic ignored "-Wunused-parameter"
99__attribute__ ((always_inline))
107#if defined(OS_DEBUG_SEMIHOSTING_FAULTS)
108 " " AngelSWITestFault
" \n"
115 : [rsn]
"r" (reason), [arg]
"r" (arg), [swi]
"i" (
AngelSWI)
116 :
"r0",
"r1",
"r2",
"r3",
"ip",
"lr",
"memory",
"cc"
128#pragma GCC diagnostic pop
134__attribute__ ((always_inline,noreturn))
145#if defined(__cplusplus)
static void report_exception(int reason)
@ SEMIHOSTING_SYS_TICKFREQ
@ ADP_Stopped_RunTimeError
@ SEMIHOSTING_ReportException
@ SEMIHOSTING_SYS_ISERROR
@ SEMIHOSTING_SYS_GET_CMDLINE
@ ADP_Stopped_ApplicationExit
@ SEMIHOSTING_SYS_HEAPINFO
@ SEMIHOSTING_SYS_ELAPSED
static int call_host(int reason, void *arg)