mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-01 14:34:31 +00:00
vfs: add support for semihosting on ESP32-C3
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -141,34 +141,6 @@ static inline void cpu_ll_break(void)
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int cpu_ll_syscall(int sys_nr, int arg1, int arg2, int arg3, int arg4, int* ret_errno)
|
||||
{
|
||||
int host_ret, host_errno;
|
||||
|
||||
asm volatile ( \
|
||||
".option push\n" \
|
||||
".option norvc\n" \
|
||||
"mv a0, %[sys_nr]\n" \
|
||||
"mv a1, %[arg1]\n" \
|
||||
"mv a2, %[arg2]\n" \
|
||||
"mv a3, %[arg3]\n" \
|
||||
"mv a4, %[arg4]\n" \
|
||||
"slli zero,zero,0x1f\n" \
|
||||
"ebreak\n" \
|
||||
"srai zero,zero,0x7\n" \
|
||||
"mv %[host_ret], a0\n" \
|
||||
"mv %[host_errno], a1\n" \
|
||||
".option pop\n" \
|
||||
:[host_ret]"=r"(host_ret),[host_errno]"=r"(host_errno)
|
||||
:[sys_nr]"r"(sys_nr),[arg1]"r"(arg1),[arg2]"r"(arg2),[arg3]"r"(arg3),[arg4]"r"(arg4)
|
||||
:"a0","a1","a2","a3","a4");
|
||||
|
||||
if (ret_errno) {
|
||||
*ret_errno = host_errno;
|
||||
}
|
||||
return host_ret;
|
||||
}
|
||||
|
||||
static inline void cpu_ll_set_vecbase(const void* vecbase)
|
||||
{
|
||||
uintptr_t vecbase_int = (uintptr_t)vecbase;
|
||||
|
Reference in New Issue
Block a user