Proper masking of the mtvec CSR word using macros.
This commit is contained in:
parent
75264e130d
commit
ed9505ae12
2 changed files with 12 additions and 2 deletions
|
|
@ -77,8 +77,8 @@ timerinit()
|
|||
scratch[4] = interval;
|
||||
w_mscratch((u64)scratch);
|
||||
|
||||
// Set the machine-mode trap handler.
|
||||
w_mtvec((u64)timervec);
|
||||
// Set the machine-mode trap handler. Set to direct, since scause is examined in the handler.
|
||||
w_mtvec(MTVEC_VALUE((u64)timervec, MTVEC_MODE_DIRECT));
|
||||
|
||||
// Enable machine-mode interrupts.
|
||||
w_mstatus(r_mstatus() | MSTATUS_MIE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue