summaryrefslogtreecommitdiffstats
path: root/libgloss
Commit message (Collapse)AuthorAgeFilesLines
* RISC-V: Fix _sbrk, it's failed only when return value is -1.Denis Ivanov2018-08-292-7/+12
| | | | Signed-off-by: Kito Cheng <kito.cheng@gmail.com>
* RISC-V: Fixed return code in _times syscall.Denis Ivanov2018-08-291-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>
* Add BSP and semihosting library for nios2-generic-nommu QEMU emulation.Sandra Loosemore2018-08-0828-0/+5848
|
* Patch from Richard Earnshaw <Richard.Earnshaw@arm.com>newlib-snapshot-20180802Jeff Johnston2018-08-011-4/+8
| | | | | * aarch64/cpu-init/rdimon-aem-el3.S (cpu_init_hook): Simplify entry/exit sequences. Add CFI unwind rules.
* RISC-V: Do not use _init/_finiSebastian Huber2018-07-301-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>
* Fix AArch32 semihosting SYS_EXIT call on semihosting v1.Tamar Christina2018-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | The current SYS_EXIT has a bug that when making the call it always uses the v2 calling convention. This is undefined behavior according to the semihosting specification: https://developer.arm.com/docs/100863/latest/semihosting-operations/sys_exit-0x18 This patch fixes it by making sure v1 passes the argument directly in the register instead of in a block. And for v2 it does the same if the v2 extension isn't supported. The sequence generated now is 12424: ebfffecd bl 11f60 <_has_ext_exit_extended> 12428: e3500000 cmp r0, #0 1242c: 11a0500d movne r5, sp 12430: 059d5000 ldreq r5, [sp] 12434: e1a00004 mov r0, r4 12438: e1a01005 mov r1, r5 1243c: ef00f000 svc 0x0000f000 Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* libgloss: microblaze: adjust handlers to be weak.Ben Levinsky2018-05-032-2/+4
| | | | | | | Previously, hw exception handler stub and interrupt handler stub for microbaze were unable to be overwritten. Change to weak to fix this. Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
* add forward declaration to main() to prevent warningsJaap de Wolff2018-02-161-0/+2
|
* adapt prototypes arm/syscalls.c to usual prototypes, and do not rely on ↵Jaap de Wolff2018-02-161-48/+49
| | | | implicit conversions
* RISC-V: isatty: return 0 on errorChih-Mao Chen2018-01-181-1/+1
|
* ansification: remove _HAVE_STDCYaakov Selkowitz2018-01-171-4/+0
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ansification: remove _EXFUN, _EXFUN_NOTHROWYaakov Selkowitz2018-01-175-6/+6
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ansification: remove _DEFUNYaakov Selkowitz2018-01-17107-233/+118
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ansification: remove _VOIDYaakov Selkowitz2018-01-172-2/+2
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ansification: remove _DEFUN_VOIDYaakov Selkowitz2018-01-174-7/+7
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ansification: remove _PARAMSYaakov Selkowitz2018-01-178-73/+73
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ansification: remove _NOARGSYaakov Selkowitz2018-01-173-3/+3
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ansification: remove _ANDYaakov Selkowitz2018-01-1764-85/+85
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* RISC-V: Add gdb sim and newlib nano support. Fix a few misc minor bugs.Jim Wilson2017-12-264-6/+111
|
* RISC-V: Moved syscalls to separate files to fix aliasing problems.Jim Wilson2017-12-2637-450/+513
|
* RISC-V: Updated syscall to take 6 argumentsJim Wilson2017-12-262-22/+26
|
* RISC-V: Add nanosleep functionalityJim Wilson2017-12-262-0/+13
|
* RISC-V: Fix libnosys build.Jim Wilson2017-12-262-0/+4
|
* Fixed semihosting for AArch64 when heapinfo parameters are not provided by ↵Alexander Fedotov2017-10-242-26/+59
| | | | debugger
* Fix multido compilation on ARMTamar Christina2017-10-091-2/+2
| | | | | | | | | | | | | The previous multi-build implementation was copying the config.status from the parent multilib directory when building the different semihosting variants. It did so because the configuration doesn't change. However when you use a relative path to configure it turns out that the paths inside the config.status are also relative. To fix this, the srcdir is adjusted from the initial configuration instead of copying it. Tested on aarch64-none-elf and arm-none-eabi. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* adjust libnosys config for aarch64 to avoid linker error when switching from ↵Alexander Fedotov2017-10-092-0/+4
| | | | rdimon.specs to nosys.specs
* move ILP32 sanity check on heap base code under ARM_RDI_MONITORAlexander Fedotov-B556132017-08-241-4/+5
|
* Change license to FreeBSD License for RISC-VKito Cheng2017-08-213-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.
* Add RISC-V port for libglossnewlib-snapshot-20170818Kito Cheng2017-08-179-0/+4340
| | | | | | | | Contributor list: - Andrew Waterman <andrew@sifive.com> - Palmer Dabbelt <palmer@dabbelt.com> - Kito Cheng <kito.cheng@gmail.com> - Alex Suykov <alex.suykov@gmail.com>
* Fix crt0 init fini codeSzabolcs Nagy2017-08-171-4/+0
| | | | | __USES_INITFINI__ ifdef was incorrectly copied from arm (it's an arm backend thing in gcc, not meaningful on aarch64)
* fix typo in AArch64 crt0Alexander Fedotov-B556132017-08-151-1/+1
|
* use stack from linker script when nosysAlexander Fedotov-B556132017-08-141-1/+18
|
* Don't fetch command line options without semi-hostingYao Qi2017-08-091-0/+6
| | | | | | | | | | | | | | | | | Nowadays, the code fetching command line options via semi-hosting are unconditionally pulled in, so that the semi-hosting code is still there even I compile with option --specs=nosys.specs. gdb ./aarch64-none-elf/libgloss/aarch64/crt0.o (gdb) disassemble _start 0x0000000000000050 <+80>: ldr x1, 0x128 <_cpu_init_hook+48> 0x0000000000000054 <+84>: mov w0, #0x15 0x0000000000000058 <+88>: hlt #0xf000 This patch fixes this problem by wrapping the code by ARM_RDI_MONITOR. When semi-hosting is not used, set command line options to NULL.
* Fix crt0 overwriting.Tamar Christina2017-08-094-1/+10
| | | | | | | | | | | On AArch64 we currently always link in crt0 regardless of if another one is being provided by something else, like rdimon.a. This was never an issue before as nosys was not supported on AArch64. This updates the specs to supply a different crt0 when a semihosting call is required. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Previous patch to support nosys.specs accidentally broke validation specs ↵Tamar Christina2017-07-211-1/+1
| | | | | | | | | | | | because ARM_RDI_MONITOR was never passed to the build rule for crt0. This fixed the compile for nosys and validation specs but nosys won't run because of existing limitations to aarch64's syscalls.c, it requires semihosting to get commandline arguments and heap info without having a fallback method as ARM does. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Support building in a different directory than the default output directory ↵Tamar Christina2017-07-171-1/+1
| | | | | | by preserving DESTDIR value in recursive calls. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Fix link when nosys.specs is used to linkTamar Christina2017-07-141-0/+2
| | | | | | | | This patch fixes the issue where nosys.specs is used to link. e.g. The use of crt0 without any support for semihosting requested. The AArch64 crt0 was missing an #ifdef for the initialise_monitor_handles which was causing the link to fail. Sorry for missing this before.
* Replace the perl character classes with POSIX ones to fix the build when sed ↵Tamar Christina2017-07-061-4/+4
| | | | | | is a BSD sed instead of GNU. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Add support for Semihosting v2 support for AArch64 in libgloss.Tamar Christina2017-07-054-47/+186
| | | | | | | | | | Semihosting v2 changes are documented here: https://developer.arm.com/docs/100863/latest/ The biggest change is the addition of an extensions mechanism to add more extensions in the future. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Add support for Semihosting v2 support for ARM in libgloss.Tamar Christina2017-07-053-65/+231
| | | | | | | | | | Semihosting v2 changes are documented here: https://developer.arm.com/docs/100863/latest/ The biggest change is the addition of an extensions mechanism to add more extensions in the future. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Add the needed build system changes in order to compile and create the new ↵Tamar Christina2017-07-059-17/+147
| | | | | | | | | | | | | | | | | | libraries for Semihosting v2 for ARM. This uses the new recursive build target in multi-build.in The new spec files are: For AArch32/ARM (m for mixed mode): - rdimon-v2m.specs - aprofile-validation-v2m.specs - aprofile-ve-v2m.specs These spec files will be using the new libraries generated by multi-build.in. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Adds the needed build system changes in order to compile and create the new ↵Tamar Christina2017-07-054-16/+49
| | | | | | | | | | | libraries for Semihosting v2. This uses the new recursive build target in multi-build.in For AArch64 no new spec files are needed but the makefiles are modified to keep them in sync with the ARM ones. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Create a recursive make target that is modeled after the existing multilib ↵Tamar Christina2017-07-051-0/+61
| | | | | | | | | makefile config-ml.in which can be used to build the same files within a target multiple ways. e.g. from the same source file produce multiple libs by varying the options passed to the compiler. Signed-off-by: Tamar Christina <tamar.christina@arm.com>
* Add JLI support.Claudiu Zissulescu2017-06-141-1/+6
| | | | | | | | | Initialize the jli_base registers for ARCv2 cpus. libgloss/ 2017-05-23 Claudiu Zissulescu <claziss@synopsys.com> * arc/crt0.S: Initialize the jli_base registers for ARCv2 cpus.
* Add profile support.Claudiu Zissulescu2017-06-144-8/+527
| | | | | | | | | | | | | | Add profile support for ARC processors. libgloss/ 2016-07-28 Claudiu Zissulescu <claziss@synopsys.com> * arc/crt0.S: Add calls to profiler support routines. * Makefile.in (CRT0): Add gcrt0. (NSIM_OBJS): Add mcount. (CRT0_INSTALL): Install gcrt0, and crt0. * arc/gcrt0.S: New file. * arc/mcount.c: Likewise.
* Fix thinko in MSP430 libgloss implementation of write() system call.Martin Young2017-05-261-1/+1
|
* ARM/AArch64: Fix GetCmdLine semihosting directivesnewlib-snapshot-20170519Laurent ALFONSI2017-05-192-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When simulating arm code, the target program startup code (crt0) uses semihosting invocations to get the command line from the simulator. The simulator returns the command line and its size into the area passed in parameter. (ARM 32-bit specifications : http://infocenter.arm.com/help/topic/com.arm.doc.dui0058d/DUI0058.pdf chapter "5.4.19 SYS_GET_CMDLINE"). The memory area pointed by the semihosting register argument is located in .text section (usually not writtable (RX)). If we run this code on a simulator that respects this rights properties (qemu user-mode for instance), the command line will not be written to the .text program memory, in particular the length of the string. The program runs with an empty command line. This problem hasn't been seen earlier probably because qemu user-mode is not so much used, but this can happen with another simulator that refuse to write in a read-only segment. With this modification, the command line can be correctly passed to the target program. Changes: - libgloss/arm/crt0.S : Arguments passed to the AngelSWI_Reason_GetCmdLine semihosting invocation are placed into .data section instead of .text - libgloss/aarch64/crt0.S : Idem for aarch64 AngelSVC_Reason_GetCmdLine semihosting.
* Fix relocation type for _bsssize being R_MSP430X_ABS16 when large memory ↵Jozef Lawrynowicz2017-04-191-2/+2
| | | | model is used
* libgloss/arm: fix discovery of "eabihf" toolchainsCarlos Santos2017-04-182-2/+2
| | | | | | | | | | | | | ARM EABI toolchains can optionally use the "hf" suffix to identify hardware floating point support. Use the "*-*-eabi*" pattern to match these toolchains. Original patch by Bryan Hundven for the Crosstool-NG project. Improved by Alexey Neyman. Signed-off-by: Carlos Santos <casantos@datacom.ind.br> CC: Bryan Hundven <bryanhundven@gmail.com CC: Alexey Neyman <stilor@att.net>
* Fix elf-nano.specs to work without -save-tempsThomas Preud'homme2017-02-151-3/+3
| | | | | | | | | | | | The changes in af272aca591fe1dc0f1be64ae5bda147ea98a047 only works when using gcc/g++ with -E or -save-temps, otherwise newlib's newlib.h gets used even if -specs=nano.specs is specified. This is because the driver only use cpp_options spec for the external cpp tool, not for the integrated one. This patch uses instead cpp_unique_options which is used in all cases: it is used directly when the integrated preprocessor is used, and indirectly by expansion of cpp_options otherwise.