devlog 12-23
{ Today, I managed to implement CLINT, thought the process was a bit painful. First off, there's the mscartch register. While writing assembly, I kept forgetting that interrupts handler in the current mode, requiring a save point. Plus, I had to use the mscartch register as an intermediary.
When writing CLINT interrupt, they are not captured by S mode by default, even thought medeleg and mideleg delegate all interrupts to S mode.
Therefore, to achieve an engineering-standard implementation, you must set the mstatus register in M mode to enable global interrupts and configure clock interrupts in mie. Then, correspondingly enable the SIE interrupt in sstatus under S mode and activate the SSIE interrupt in SIE -- that is, the software interrupt. }