llvm-capstone/libc/include
Mikhail R. Gadelha 0f6fd1b704 [libc] Add support for setjmp and longjmp in riscv
This patch implements setjmp and longjmp in riscv using inline asm. The
following changes were required:

* Omit frame pointer: otherwise gcc won't allow us to use s0
* Use __attribute__((naked)): otherwise both gcc and clang will generate
function prologue and epilogue in both functions. This doesn't happen
in x86_64, so we guard it to only riscv

Furthermore, using __attribute__((naked)) causes two problems: we
can't use `return 0` (both gcc and clang) and the function arguments in
the function body (clang only), so we had to use a0 and a1 directly.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145584
2023-03-24 16:16:31 -03:00
..
arpa [libc] Implement htonl and htons 2023-02-16 10:12:18 -08:00
llvm-libc-macros [libc] add basic wide char functions 2023-03-20 16:36:21 -07:00
llvm-libc-types [libc] Add support for setjmp and longjmp in riscv 2023-03-24 16:16:31 -03:00
sys [libc] Introduce sys/socket.h 2023-02-23 07:11:20 +00:00
__llvm-libc-common.h [libc] add noexcept to external function headers 2023-01-06 11:43:43 -08:00
assert.h.def
CMakeLists.txt [libc][obvious] fix missing type headers 2023-03-20 16:43:09 -07:00
ctype.h.def
dirent.h.def [libc] Add dirent.h functions opendir, readdir, closedir and dirfd. 2022-07-25 20:23:25 +00:00
errno.h.def [libc] Simplify generation of errno.h. 2022-12-20 19:04:13 +00:00
fcntl.h.def [libc] Add POSIX close, fsync, open, read and write functions. 2022-01-27 20:32:02 +00:00
fenv.h.def [libc] Move math.h and fenv.h macro definitions to llvm-libc-macros. 2023-03-07 18:08:52 +00:00
inttypes.h.def [libc] add inttypes header 2021-08-26 18:04:21 +00:00
math.h.def [libc] Move math.h and fenv.h macro definitions to llvm-libc-macros. 2023-03-07 18:08:52 +00:00
pthread.h.def [libc] Add implementation of pthread_once. 2022-09-28 06:54:48 +00:00
sched.h.def [libc] add CPU_COUNT macro and backing function 2022-10-04 15:22:55 -07:00
setjmp.h.def [libc] Add x86_64 implementation of setjmp and longjmp. 2022-11-01 22:58:35 +00:00
signal.h.def [libc] Re-enable functions from signal.h and re-enable abort. 2022-09-30 07:31:50 +00:00
spawn.h.def [libc] Add POSIX functions posix_spawn_file_actions_*. 2022-10-11 04:54:44 +00:00
stdio.h.def [libc] Add definitions of a few missing macros and types. 2022-11-02 07:17:33 +00:00
stdlib.h.def [libc] implement basic rand and srand 2022-10-04 13:31:26 -07:00
string.h.def [libc][NFC] Simplify how the definiton of NULL macro is added to string.h. 2022-12-20 19:14:27 +00:00
strings.h.def [libc] Move b* string functions to strings.h 2023-01-09 20:16:20 +00:00
termios.h.def [libc] Add termios.h and the implementation of functions declared in it. 2022-10-18 20:53:00 +00:00
threads.h.def [libc] Move the remaining public types to their own type headers. 2022-01-20 23:04:26 +00:00
time.h.def [libc] add clock_gettime 2022-09-29 10:23:21 -07:00
unistd.h.def [libc] Add implementation of POSIX function "access". 2022-09-14 07:44:47 +00:00
wchar.h.def [libc] add basic wide char functions 2023-03-20 16:36:21 -07:00