46
46
* Public Functions
47
47
****************************************************************************/
48
48
49
- void arm64_init_signal_process (struct tcb_s * tcb )
49
+ void arm64_init_signal_process (struct tcb_s * tcb , struct regs_context * regs )
50
50
{
51
- struct regs_context * pctx = (struct regs_context * )tcb -> xcp .regs ;
51
+ /****************************************************************************
52
+ * if regs != NULL We are interrupting the context,
53
+ * we should modify the regs
54
+ ****************************************************************************/
55
+
56
+ struct regs_context * pctx = (regs != NULL ) ? regs :
57
+ (struct regs_context * )tcb -> xcp .regs ;
52
58
struct regs_context * psigctx ;
53
59
char * stack_ptr = (char * )pctx -> sp_elx ;
54
60
@@ -162,11 +168,12 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
162
168
163
169
/* create signal process context */
164
170
165
- tcb -> xcp .saved_reg = tcb -> xcp . regs ;
171
+ tcb -> xcp .saved_reg = ( uint64_t * ) CURRENT_REGS ;
166
172
#ifdef CONFIG_ARCH_FPU
167
173
tcb -> xcp .saved_fpu_regs = tcb -> xcp .fpu_regs ;
168
174
#endif
169
- arm64_init_signal_process (tcb );
175
+ arm64_init_signal_process (tcb ,
176
+ (struct regs_context * )CURRENT_REGS );
170
177
171
178
/* trigger switch to signal process */
172
179
@@ -193,7 +200,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
193
200
/* create signal process context */
194
201
195
202
tcb -> xcp .saved_reg = tcb -> xcp .regs ;
196
- arm64_init_signal_process (tcb );
203
+ arm64_init_signal_process (tcb , NULL );
197
204
}
198
205
}
199
206
}
@@ -276,7 +283,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
276
283
/* create signal process context */
277
284
278
285
tcb -> xcp .saved_reg = tcb -> xcp .regs ;
279
- arm64_init_signal_process (tcb );
286
+ arm64_init_signal_process (tcb , NULL );
280
287
}
281
288
else
282
289
{
@@ -292,11 +299,12 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
292
299
293
300
/* create signal process context */
294
301
295
- tcb -> xcp .saved_reg = tcb -> xcp . regs ;
302
+ tcb -> xcp .saved_reg = ( uint64_t * ) CURRENT_REGS ;
296
303
#ifdef CONFIG_ARCH_FPU
297
304
tcb -> xcp .saved_fpu_regs = tcb -> xcp .fpu_regs ;
298
305
#endif
299
- arm64_init_signal_process (tcb );
306
+ arm64_init_signal_process (tcb ,
307
+ (struct regs_context * )CURRENT_REGS );
300
308
301
309
/* trigger switch to signal process */
302
310
@@ -347,7 +355,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
347
355
348
356
/* create signal process context */
349
357
350
- arm64_init_signal_process (tcb );
358
+ arm64_init_signal_process (tcb , NULL );
351
359
352
360
/* Increment the IRQ lock count so that when the task is restarted,
353
361
* it will hold the IRQ spinlock.
0 commit comments