9.131 __semihost intrinsic
This intrinsic inserts an
BKPT instruction into the instruction stream generated by the compiler. It enables you to make semihosting calls from C or C++ that are independent of the target architecture.
, const void
Is the request code for the semihosting request.
Is a pointer to an argument/result block.
The results of semihosting calls are passed either as an explicit
return value or as a pointer to a data block.
Use this intrinsic from C or C++ to generate the appropriate semihosting call for
your target and instruction set:
In ARM state for all architectures.
In Thumb state, excluding M-profile architectures. This behavior is not
guaranteed on all debug targets from
ARM or from third parties.
For M-profile architectures (Thumb only).
ARM processors earlier than ARMv7 use
SVC instructions to make
semihosting calls. However, if you are compiling for a Cortex M-profile processor,
semihosting is implemented using the
__semihost(0x01, (const void *)buf); // equivalent in thumb state to
// int __svc(0xAB) my_svc(int, int *);
// result = my_svc(0x1, &buffer);
Compiling this code with the option