You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -127,12 +127,14 @@ Why full context save in ISR?
127
127
128
128
### ISR Stack Requirements
129
129
130
-
Each task stack must reserve space for the ISR frame:
130
+
Each task requires space for the ISR frame:
131
131
```c
132
-
#defineISR_STACK_FRAME_SIZE 144 /*33 words × 4 bytes, 16-byte aligned */
132
+
#defineISR_STACK_FRAME_SIZE 144 /*36 words × 4 bytes, 16-byte aligned */
133
133
```
134
134
135
-
This "red zone" is reserved at the top of every task stack to guarantee ISR safety.
135
+
**M-mode tasks**: This "red zone" is reserved at the top of the task stack to guarantee ISR safety.
136
+
137
+
**U-mode tasks**: The ISR frame is allocated on the per-task kernel stack (1024 bytes), not on the user stack. This provides stack isolation and prevents user tasks from corrupting kernel trap handling state.
136
138
137
139
## Function Calling in Linmo
138
140
@@ -200,7 +202,9 @@ void task_function(void) {
200
202
201
203
### Stack Layout
202
204
203
-
Each task has its own stack with this layout:
205
+
#### Machine Mode Tasks
206
+
207
+
Each M-mode task has its own stack with this layout:
204
208
205
209
```
206
210
High Address
@@ -216,6 +220,43 @@ High Address
216
220
Low Address
217
221
```
218
222
223
+
#### User Mode Tasks (Per-Task Kernel Stack)
224
+
225
+
U-mode tasks maintain separate user and kernel stacks for isolation:
0 commit comments