aboutsummaryrefslogtreecommitdiff
path: root/libgloss/riscv
AgeCommit message (Collapse)AuthorFilesLines
2020-02-11Only pass the minimum number of syscall argumentsGeorg Sauthoff18-29/+48
Previously, __internal_syscall() compiled into asm-code that unconditionally sets the syscall argument registers a0 to a5. For example, the instruction sequence for a exit syscall looked like this: li a0, 1 # in ther caller of exit() # ... # in newlib: li a1, 0 # unused arguments li a2, 0 li a3, 0 li a4, 0 li a5, 0 li a7, 93 # exit syscall number (i.e. the binary contains then 5 superfluous instructions for this one argument syscall) This commit changes the RISC-V syscall code such that only the required syscall argument registers are set. GCC detects that argc is known at compile time and thus evaluates all the if-statements where argc is used at compile time (tested with -O2 and -Os).
2020-01-31RISC-V: Use newlib nano specific libm.Jim Wilson1-1/+1
The libm gamma functions use the _gamma_signgam field of the reentrant structure, which changes offset with the --enable-newlib-reent-small configure option, which means we need to use a newlib nano specific version of libm in addition to libc in the nano.specs file. Reported by Keith Packard. There is a riscv-gnu-toolchain patch that goes along with this to create the new libm_nano.a file. Signed-off-by: Jim Wilson <jimw@sifive.com>
2019-05-22RISC-V: Add _LITE_EXIT in crt0.S.Jim Wilson1-0/+13
This patch adds _LITE_EXIT in crt0.S to enable "lite exit" technique in RISC-V. The changes have been tested in riscv/riscv-gnu-toolchain by riscv-dejagnu with riscv-sim.exp/riscv-sim-nano.exp.
2018-08-29RISC-V: Fix _sbrk, it's failed only when return value is -1.Denis Ivanov2-7/+12
Signed-off-by: Kito Cheng <kito.cheng@gmail.com>
2018-08-29RISC-V: Fixed return code in _times syscall.Denis Ivanov1-2/+2
Upon successful completion, times() shall return the elapsed real time, in clock ticks, since an arbitrary point in the past (for example, system start-up time). Signed-off-by: Kito Cheng <kito.cheng@gmail.com>
2018-07-30RISC-V: Do not use _init/_finiSebastian Huber1-11/+0
Introduce new host configuration variable "have_init_fini" which is set to "yes" by default. Override it for RISC-V to "no". Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-01-18RISC-V: isatty: return 0 on errorChih-Mao Chen1-1/+1
2017-12-26RISC-V: Add gdb sim and newlib nano support. Fix a few misc minor bugs.Jim Wilson4-6/+111
2017-12-26RISC-V: Moved syscalls to separate files to fix aliasing problems.Jim Wilson37-450/+513
2017-12-26RISC-V: Updated syscall to take 6 argumentsJim Wilson2-22/+26
2017-12-26RISC-V: Add nanosleep functionalityJim Wilson2-0/+13
2017-08-21Change license to FreeBSD License for RISC-VKito Cheng3-3/+3
- For prevent confuse about what BSD license variant we used, 2- or 3-clause license, we change the license to FreeBSD license to make it unambiguously refers to the 2-clause license.
2017-08-17Add RISC-V port for libglossnewlib-snapshot-20170818Kito Cheng7-0/+4332
Contributor list: - Andrew Waterman <andrew@sifive.com> - Palmer Dabbelt <palmer@dabbelt.com> - Kito Cheng <kito.cheng@gmail.com> - Alex Suykov <alex.suykov@gmail.com>