@@ -48,20 +48,7 @@ typedef uint32_t jmp_buf[17];
48
48
The ` hal_context_save ` function captures complete task state including both execution context and processor state.
49
49
The function saves all callee-saved registers as required by the RISC-V ABI,
50
50
plus essential pointers (gp, tp, sp, ra).
51
- For processor state, it performs sophisticated interrupt state reconstruction:
52
-
53
- ``` c
54
- /* mstatus reconstruction during timer interrupts */
55
- csrr t0, mstatus // Read current mstatus (MIE=0 in trap)
56
- srli t1, t0, 4 // Shift MPIE (bit 7) to bit 3 position
57
- andi t1, t1, 8 // Isolate the reconstructed MIE bit
58
- li t2, ~8 // Create mask to clear old MIE bit
59
- and t0, t0, t2 // Clear the current MIE bit
60
- or t0, t0, t1 // Set MIE to pre-trap value (from MPIE)
61
- sw t0, 16 *4 (%0 ) // Store in jmp_buf[16]
62
- ```
63
-
64
- This ensures that tasks resume with correct interrupt state,
51
+ For processor state, it performs sophisticated interrupt state reconstruction and ensures that tasks resume with correct interrupt state,
65
52
maintaining system responsiveness and preventing interrupt state corruption.
66
53
67
54
### 2. Select Next Task
0 commit comments