bsps/mips: Emulate rdhwr for the thread pointer
The compiler emits rdhwr 3,29 to read the thread pointer for every access to a thread-local object. It does this on every MIPS target, because the instruction exists since MIPS32r2 and the operating system is expected to emulate it where the processor lacks it. The R3900 of mips/jmr3904 lacks it, so thread-local storage did not work at all.
Emulate the instruction in the reserved instruction exception, which is the only way the processor reports it. A processor which has the instruction never raises the exception, so the emulation costs nothing there.
An instruction in a branch delay slot is left to the fatal handler: the exception program counter references the branch, so the emulation cannot resume by advancing it.
Close #5689.
Assisted-by: Claude:claude-opus-5 claude-code Signed-off-by: Sebastian Huber sebastian.huber@embedded-brains.de
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Real-Time Executive for Multiprocessing Systems
RTEMS is a real-time executive (kernel) which provides a high performance environment for embedded applications with the following features:
RTEMS Project:
Project git repositories are located at:
Online documentation is available at:
RTEMS Doxygen for CPUKit:
RTEMS POSIX 1003.1 Compliance Guide:
RTEMS Discourse User forum for questions, answers and examples:
RTEMS Discord for support:
RTEMS Mailing Lists for general purpose use the users list and for developers use the devel list.
The version number for this software in releases is located in the
VERSIONfile if present.