aboutsummaryrefslogtreecommitdiff
path: root/libgloss/arc
AgeCommit message (Collapse)AuthorFilesLines
2024-08-20arc: libgloss: Prepare for porting to ARCv3Yuriy Kolerov4-0/+38
There are 3 families of Synopsys DeisgnWare ARC processors: ARCompact/ARCv1 (32-bit), ARCv2 (32-bit) and ARCv3 (32-bit and 64-bit targets). Upstream Newlib supports only ARCv1/2. This commit prepares ARCv1/2 libgloss port to be reused by ARCv3 port (except crt* files). Note that __ARC64__ macro stands for all ARCv3 targets. Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
2024-08-20arc: libgloss: Use exit code in _exit_halt for nSIMYuriy Kolerov1-2/+2
nSIM simulator supports exit codes. However, it's necessary to pass an exit code to _exit_halt, otherwise it's undefined. Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
2024-08-20arc: libgloss: Accommodate MetaWare's standard symbol namesAlexey Brodkin8-25/+105
It makes it usable with standard symbol names defined in default linker scripts of the MetaWare toolchain. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2024-08-20arc: Remove @ from symbol references in assemblyAlexey Brodkin2-24/+24
There's no semantic change, it's only to make the same code compilable with MetaWare toolchian, which actually assumes @x as a full name, not omitting @. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2024-08-20arc: libgloss: Clean MetaWare hostlink documentationYuriy Kolerov1-67/+67
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
2024-08-20arc: libgloss: Switch from .balign to .alignAlexey Brodkin1-1/+1
.align is supported by both GCC & MetaWare compiler for ARC, yet implements the same semantics as .balign which only works with GCC. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2024-08-20arc: libgloss: Fix define guard in nsim-syscall.hYuriy Kolerov1-3/+3
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
2024-05-22arc: libgloss: Add build rules for new boardsYuriy Kolerov1-1/+91
Add build rules to support packages for development boards and nSIM hostlink. Makefile.in is generated this way: $ autoconf --version autoconf (GNU Autoconf) 2.69 $ automake --version automake (GNU automake) 1.15.1 $ cd libgloss $ autoreconf -i Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Add support of EM Starter Kit boardYuriy Kolerov25-0/+425
These specs files are introduced for EMSK board: * emsk1_em4.specs - EMSKv1 with EM4 core, everything in ICCM/DCCM memory * emsk1_em6.specs - EMSKv1 with EM6 core, everything in ICCM/DCCM memory * emsk1_em6_ram.specs - EMSKv1 with EM6 core, startup code in ICCM and everything else in RAM * emsk2.1_em5d.specs - EMSKv2.1 with EM5D core, everything in ICCM/DCCM memory * emsk2.1_em7d.specs - EMSKv2.1 with EM7D core, everything in ICCM/DCCM memory * emsk2.1_em7d_ram.specs - EMSKv2.1 with EM7D core, startup code in ICCM and everything else in RAM * emsk2.2_em7d.specs - EMSKv2.2+ with EM7D core, everything in ICCM/DCCM memory * emsk2.2_em7d_ram.specs - EMSKv2.2+ with EM7D core, startup code in ICCM and everything else in RAM * emsk2.2_em9d.specs - EMSKv2.2+ with EM9D core, everything in ICCM/DCCM memory * emsk2.2_em9d_ram.specs - EMSKv2.2+ with EM9D core, startup code in ICCM and everything else in RAM * emsk2.2_em11d.specs - EMSKv2.2+ with EM11D core, everything in ICCM/DCCM memory * emsk2.2_em11d_ram.specs - EMSKv2.2+ with EM11D core, startup code in ICCM and everything else in RAM An example of building an application: $ arc-elf32-gcc -mcpu=em -specs=emsk2.2_em11d_ram.specs main.c -o main Signed-off-by: Vladimir Isaev <vvisaev@gmail.com> Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Add support of EM SDP boardYuriy Kolerov9-0/+164
These specs files are introduced for EM SDP board: * emsdp1.1.specs - EM SDP 1.1, everything in ICCM/DCCM memory * emsdp1.1_ram.specs - EM SDP 1.1, startup code in ICCM memory and everything else in RAM * emsdp1.2.specs - EM SDP 1.2, everything in ICCM/DCCM memory * emsdp1.2_ram.specs - EM SDP 1.2, startup code in ICCM memory and everything else in RAM An example of building an application: $ arc-elf32-gcc -mcpu=em -specs=emsdp1.1_ram.specs main.c -o main Signed-off-by: Vladimir Isaev <vvisaev@gmail.com> Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Add support of HS Development Kit boardYuriy Kolerov3-0/+63
An example of building an application: $ arc-elf32-gcc -mcpu=hs -specs=hsdk.specs main.c -o main Signed-off-by: Vladimir Isaev <vvisaev@gmail.com> Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Add support of IoT Development Kit boardYuriy Kolerov3-0/+68
An example of building an application: $ arc-elf32-gcc -mcpu=em -specs=iotdk.specs main.c -o main Signed-off-by: Vladimir Isaev <vvisaev@gmail.com> Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Add a linker script common for all boardsYuriy Kolerov1-0/+233
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Add UART 8250 libraryYuriy Kolerov3-0/+457
This library implements libgloss input/output and setup routines for UART 8250 devices of ARC development boards: * EM Starter Kit * HS Development Kit * EM Software Development Platform * IoT Development Kit _uart_8250_setup function with proper parameteres must be called to setup UART 8250 device for a particular board (refer to a board's documentation). Signed-off-by: Vladimir Isaev <vvisaev@gmail.com> Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Clean registers before any useYuriy Kolerov1-0/+41
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Use atexit to setup fini routinesClaudiu Zissulescu1-20/+5
Use atexit funtion to setup fini routines to be called on exit instead of filling in __atexit structures manually. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2024-05-22arc: libgloss: Introduce hostlink interfaceVladimir Isaev27-11/+2111
There is a special interface built in ARC simulators (such as nSIM) called MetaWare hostlink IO which can be used to implement system calls. This commit adds support for this interface to the ARC port of libgloss. Here is an example of using this interface: $ arc-elf32-gcc -mcpu=hs -specs=hl.specs main.c -o main $ nsimdrv -tcf $NSIM_HOME/etc/tcf/templates/hs48_full.tcf main Hello, World! Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
2024-05-22arc: libgloss: Use fstat call instead of stat for nSIMLuis Silva1-1/+1
This change is needed to meet semi-hosting requirements for nSIM GNU I/O interface. Signed-off-by: Luis Silva <luis.m.silva99@hotmail.com>
2024-05-22arc: libc, libgloss: Remove .file directive from .S filesYuriy Kolerov1-2/+1
Assembler for ARCv2 always extends the name provided by .file directive to an absolute form. On ARCv3 targets .file directive forces assembler to put a provided string to DW_AT_name field as is without extending to an absolute path. Then GDB cannot find source files because of it. The best way to fix this issue is just delete lines with .file directive in .S files and let the compiler to decide what DW_AT_name must contain. Particularly, the compiler fills this filed by an absolute path to a .S file because only absolute paths are used in toolchain's build process. Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Use long calls attribute for exit_haltClaudiu Zissulescu1-2/+2
According to GCC documentation for ARC, a function marked with the long_call attribute is always called using register-indirect jump-and-link instructions, thereby enabling the called function to be placed anywhere within the 32-bit address space. exit_halt function is provided by crt0.S and it's used in nsim-syscalls.c. Thus, we want to ensure that a linkage issue will not arise. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2023-01-11libgloss: merge arc into top-level MakefileMike Frysinger2-122/+12
Avoid a recursive make to speed things up a bit.
2022-05-18Use global atexit data for all configurationsSebastian Huber1-5/+6
For the exit processing only members of _GLOBAL_REENT were used by default. If the _REENT_GLOBAL_ATEXIT option was enabled, then the data structures were provided through dedicated global objects. Make this option the default. Remove the option. Rename struct _reent members _atexit and _atexit0 to _reserved_6 and _reserved_7, respectively. Provide them only if _REENT_BACKWARD_BINARY_COMPAT is defined.
2022-01-26libgloss: merge stub arch configure scripts up a levelMike Frysinger4-4299/+3
For about half the ports, we don't need a subdir configure script. They're using the config/default.m[ht] rules, and they aren't doing any unique configure tests, so they exist just to pass top-level settings down to create the arch Makefile. We can just as easily do that from the top-level Mkaefile directly and skip configure. Most of the remaining configure scripts could be migrated up to the top-level too, but that would require care in each subdir. So let's be lazy and put that off to another day.
2022-01-17libgloss: clean up redundant shared lib warningsMike Frysinger2-8/+0
Use standard AC_MSG_WARN macro in the top-level configure, and delete the message from all the subdirs. There's no need to issue this more than once per libgloss build.
2022-01-14require autoconf-2.69 exactlyMike Frysinger3-20/+6
The newlib & libgloss dirs are already generated using autoconf-2.69. To avoid merging new code and/or accidental regeneration using diff versions, leverage config/override.m4 to pin to 2.69 exactly. This matches what gcc/binutils/gdb are already doing. The README file already says to use autoconf-2.69. To accomplish this, it's just as simple as adding -I flags to the top-level config/ dir when running aclocal. This is because the override.m4 file overrides AC_INIT to first require the specific autoconf version before calling the real AC_INIT.
2022-01-10libgloss: hardcode AC_CONFIG_AUX_DIR pathMike Frysinger2-25/+5
In order to transition to automake, we have to use hardcoded paths in the AC_CONFIG_AUX_DIR macro call (since automake evaluates the path itself, and doesn't expand vars), so simplify all the calls here.
2021-11-06libgloss: regenerate aclocal.m4 & configure w/newer versionsMike Frysinger3-168/+172
Regenerate the files using automake-1.15 & autoconf-2.69 to match the binutils/gdb/gcc projects. Ran: libgloss $ find -name configure.ac -printf '%h\n' | while read d; do (cd $d; export WANT_AUTOCONF=2.69 WANT_AUTOMAKE=1.15; aclocal-1.15 -I.. && autoconf-2.69); done
2021-09-13libgloss/newlib: rename configure.in to configure.acMike Frysinger1-0/+0
The .in name has been deprecated for a long time in favor of .ac.
2017-06-14Add JLI support.Claudiu Zissulescu1-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.
2017-06-14Add profile support.Claudiu Zissulescu4-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.
2016-08-11arc: Add align keyword.Claudiu Zissulescu1-2/+2
libgloss/ 2016-06-28 Claudiu Zissulescu <claziss@synopsys.com> * arc/crt0.S: Add align keyword.
2016-05-25arc: Have nops in _exit_halt only for ARCompactAnton Kolesov1-6/+9
ARCompact processors (ARC 600 and ARC 700) require three "nop"s after the "flag 1" instruction. Later ARC processors do not have this requirement, so it is possible to reduce size of "_exit_halt" for them. libgloss/ 2016-05-24 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S (_exit_halt): Insert nops only for ARCompact.
2016-05-25arc: Rework default exception handlers for ARC EM and HSAnton Kolesov1-73/+34
Initially crt0.S used a special function, declared as weak as a default exception handler in interrupt vector table. To let user override individual handlers, this function had multiple names - one for each IVT entry, which, however, was terribly confusing for the debugger and user - because it wasn't clear which symbol will be used as a function name in debugger. Defining multiple separate functions - one for each handler, would resolve the mess, but would increase code size of crt0.o. To clean this up, this patch defines exception handlers as weak symbols as well, but those are defined as just symbols, not functions, hence there would be less confusion over what is what. At the same time, users still can redefine exception handlers symbol by creating functions with respective names. libgloss/ 2016-05-24 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S: Convert memory_error and friends to non-function symbols.
2016-05-11Fix libgloss arc nsim specs file.Jeff Johnston1-1/+1
2016-05-06Fix libgloss/arc/nano.specs file.Jeff Johnston1-2/+2
2016-05-05Fix white-space in libgloss/arc/Makefile.in.Jeff Johnston1-3/+3
2016-05-02Fix support ARC processors without barrel-shifterJeff Johnston1-1/+6
crt0.S for ARC used to use instruction "asr.f lp_count, r3, 2" for all cores except ARC601. However instructions which shift more than 1 bit are optional, so this crt0.S didn't worked for all ARC cores. Luckily this is a shift just by 2 bits on all occassions, so fix is trivial - use two single-bit shifts. libgloss/ChangeLog 2016-04-29 Anton Kolesov <anton.kolesov@synopsys.com> * arc/crt0.S: Fix support for processors without barrel-shifter. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
2016-05-02Update crt0.S for ARC.Jeff Johnston1-9/+23
This is similar to commit 06537f05d4b6a0d2db01c6afda1d2a0ea2588126 to the newlib for ARC. GCC for ARC has been updated to provide consistent naming of preprocessor definitions for different optional architecture features: * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for -mbarrel-shifter * __ARCEM__ instead of __EM__ for ARC EM cores * __ARCHS__ instead of __HS__ for ARC HS cores * etc (not used in libgloss) This patch updates crt0.S for ARC to use new definitions instead of a deprecated ones. To ensure compatibility with older compiler new definitions are also defined in crt0.S if needed, based on presence of deprecated preprocessor definitions. libgloss/ChangeLog 2016-04-29 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S: Use new GCC defines to detect processor features.
2016-04-29Add necessary infrastructure to support "nano" build of newlib.Jeff Johnston3-3/+35
ARC aproach to this feature is similiar to ARM's one here. 2016-04-29 Anton Kolesov <anton.kolesov@synopsys.com> * arc/nano.specs: New file. * arc/Makefile.in: Support nano.specs. * arc/nsim.specs: Likewise.
2015-11-12Add support for ARC to libglossAnton Kolesov10-0/+5535
ChangeLog: 2015-11-12 Anton Kolesov <Anton.Kolesov@synopsys.com> * configure.in: Add ARC support to libgloss. * configure: Regenerate. libgloss/ChangeLog: 2015-11-12 Anton Kolesov <Anton.Kolesov@synopsys.com> * configure: Add ARC support. * configure.in: Likewise. * arc/Makefile.in: Likewise. * arc/aclocal.m4: Likewise. * arc/configure: Likewise. * arc/configure.in: Likewise. * arc/crt0.S: Likewise. * arc/libcfunc.c: Likewise. * arc/nsim-syscall.h: Likewise. * arc/nsim-syscalls.c: Likewise. * arc/nsim.specs: Likewise. * arc/sbrk.c: Likewise.