From 1c03ab9f4bdf19d1ac7afc157788bd0102ccd969 Mon Sep 17 00:00:00 2001 From: Kautuk Consul Date: Wed, 7 Dec 2022 17:12:34 +0530 Subject: lib: Add common semihosting library We factor out the arch-independent parts of the ARM semihosting implementation as a common library so that it can be shared with RISC-V. Signed-off-by: Kautuk Consul Reviewed-by: Leo Yu-Chi Liang --- include/semihosting.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/semihosting.h b/include/semihosting.h index f1f73464e4f..4e844cbad87 100644 --- a/include/semihosting.h +++ b/include/semihosting.h @@ -17,6 +17,17 @@ #define SMH_T32_SVC 0xDFAB #define SMH_T32_HLT 0xBABC +/** + * smh_trap() - ARCH-specific semihosting call. + * + * Semihosting library/driver can use this function to do the + * actual semihosting calls. + * + * Return: Error code defined by semihosting spec. + */ + +long smh_trap(unsigned int sysnum, void *addr); + #if CONFIG_IS_ENABLED(SEMIHOSTING_FALLBACK) /** * semihosting_enabled() - Determine whether semihosting is supported -- cgit v1.3.1