Closed Wren6991 closed 3 weeks ago
I'm afraid it is too late for such proposals, OpenOCD and QEMU, plus lots of applications already use these definitions.
Yes, its too late to change the semihosting instruction sequence which has been around 6+ years and lot of open source projects (OpenOCD, QEMU, U-Boot, OpenSBI, and others) already use it.
slli
andsrai
withrd
=x0
are listed in the ratified unprivileged ISA manual as custom hints, with the explicit phrase: Reserved for custom use. This spec codifies the use ofslli x0, x0, 0x1f
andsrai x0, x0, 7
as hints to the debugger, and obligates semihosted software to emit custom hints. This use of custom encodings is already described in an informative note, but this spec standardises their use.The custom hints may have unintended effects such as stalling the core for many cycles, or putting the core to sleep indefinitely. Practically speaking it's a bit late to eliminate the custom-hint NOPs, but would we at least consider allocating two standard hints for an alternative semihosting NOP sequence?
If debuggers complying with this spec were required to recognise the standard hints, then that leaves space to work around cores which have unintended behaviour when the custom hints are used, perhaps because the designers were not aware of this spec's surprising use of the custom hint space.