4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-20 05:19:21 +08:00
Georg Sauthoff 9b51beeb2a Only pass the minimum number of syscall arguments
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-02-11 09:41:52 +01:00
..
2018-10-31 11:14:57 +00:00
2017-06-14 14:51:22 +02:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2010-12-17 10:13:31 +00:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2008-04-04 21:52:01 +00:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2008-04-04 21:52:01 +00:00
2008-04-04 21:52:01 +00:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2008-04-04 21:52:01 +00:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2017-10-09 19:03:52 +02:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00

bfin	- Analog Devices Blackfin processor.
sparc	- Fujitsu Sparclite board. Works on the ex930, ex931, ex933
hp74x	- Hewlett Packard HP742 board. Also some support for the hp743.
m68hc11 - Motorola 68HC11 or 68HC12 support.
m68k	- Motorola MVME135 and IDP board. For CPU32 systems.
mep	- Toshiba Media Processor.
pa	- WinBond and Oki boards with a PA.
mips	- R3000 support. Array Tech LSI33k based RAID disk controller.
lm32    - Lattice Mico32 simulator.
epiphany - Adapteva Epiphany multicore processor.
or1k	- OpenRISC 1000 processor.