Closed XiaPZ closed 5 years ago
On Fri, Nov 23, 2018 at 12:02 AM D.pz notifications@github.com wrote:
What does asm volatile ("unimp" : : "r"(a0), "r"(a1)); mean? It sinces there is no unimp in riscv specs.
unimp is an unimplemented instruction, guaranteed to cause an illegal instruction trap. It is encoded as all ones.
Jim
@jim-wilson that is clear, thanks a lot for your reply
@decentsheep are you seeing a bug around here? The code you listed is horrible but usually works.
@palmer-dabbelt no bug yet, I am just reading the source code
Is there a reason mtvec is used to write the PAYLOAD_DEST and then a trap (unimp) is used to jump to this address for each hart? Instead of just jumping to it like from ZSBL -> FSBL??
I am reading fsbl/main.c, and I see some code at line 404-424:
What does
asm volatile ("unimp" : : "r"(a0), "r"(a1));
mean? It sinces there is no unimp in riscv specs.