]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
or1k: Add support for numcores and coreid sprs
authorStafford Horne <shorne@gmail.com>
Sun, 1 Jun 2025 05:39:01 +0000 (06:39 +0100)
committerStafford Horne <shorne@gmail.com>
Sat, 14 Jun 2025 05:10:57 +0000 (06:10 +0100)
commit5eb0dd3623c49c9bd439b9435c35fe99ac026d39
tree59e8b2423a9a85605190e52f639045e32bd4cc96
parent942f6390e20f8454d167ad70ab26ffe596c6d0ad
or1k: Add support for numcores and coreid sprs

These are needed when running GCC tests for newlib toolchains built with
multicore support.  Without these SPRs we get the following warnings
when running tests.

    spawn or1k-elf-run ./20000112-1.exe^M
    WARNING: l.mfspr with invalid SPR address 0x80^M
    WARNING: l.mfspr with invalid SPR address 0x81^M
    WARNING: l.mfspr with invalid SPR address 0x81^M
    WARNING: l.mfspr with invalid SPR address 0x81^M

Support is added by defining the SPRs in the cgen machine definition and
regenerating the machine code.  In or1k/or1k.c we initialize NUMCORES to
1 and COREID to 0 as the sim has only one CPU.  In or1k/traps.c we allow
returning the NUMCORES and COREID spr values in the mfspr function.

Signed-off-by: Stafford Horne <shorne@gmail.com>
cpu/or1kcommon.cpu
opcodes/or1k-desc.c
opcodes/or1k-desc.h
sim/or1k/cpu.c
sim/or1k/cpu.h
sim/or1k/or1k.c
sim/or1k/traps.c