Skip to content
Snippets Groups Projects
Commit 5d6783a9 authored by cnlohr's avatar cnlohr
Browse files

Add note about the nop in the self-modifying code

parent 16a7a47a
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ uint32_t ReadCSRSelfModify( uint16_t whichcsr )
// instructions in this way. Otherwise, the compiler will try
// to optimize the code and inline the assembly int something where
// our global handle into assembly code becomes meaningless.
// Annoyingly, it has to contain at least one instruction :(
asm volatile( "nop" );
// 000026f3 is csrrs a3, 0x000, x0; So, we modify it, placing the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment