12#ifndef CMSIS_PLUS_ARM_SEMIHOSTING_H_
13#define CMSIS_PLUS_ARM_SEMIHOSTING_H_
17#if defined(OS_USE_OS_APP_CONFIG_H)
18#include <cmsis-plus/os-app-config.h>
23#if defined(__cplusplus)
68#define AngelSWI_ARM 0x123456
72#define AngelSWI AngelSWI_ARM
75#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) \
76 || defined(__ARM_ARCH_6M__)
77#define AngelSWIInsn "bkpt"
78#define AngelSWIAsm bkpt
80#define AngelSWIInsn "swi"
81#define AngelSWIAsm swi
84#if defined(OS_DEBUG_SEMIHOSTING_FAULTS)
89#define AngelSWITestFault "setend be"
90#define AngelSWITestFaultOpCode (0xB658)
93#pragma GCC diagnostic push
94#pragma GCC diagnostic ignored "-Wunused-parameter"
96 static inline int __attribute__ ((always_inline))
104#if defined(OS_DEBUG_SEMIHOSTING_FAULTS)
105 " " AngelSWITestFault
" \n"
112 : [rsn]
"r"(reason), [arg]
"r"(arg), [swi]
"i"(
AngelSWI)
113 :
"r0",
"r1",
"r2",
"r3",
"ip",
"lr",
"memory",
"cc"
125#pragma GCC diagnostic pop
130 static inline void __attribute__ ((always_inline, noreturn))
141#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)