mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
irq: use up_interrupt_context to replace up_current_regs
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -61,7 +61,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler? */
|
/* Are we in an interrupt handler? */
|
||||||
|
|
||||||
if (up_current_regs())
|
if (up_interrupt_context())
|
||||||
{
|
{
|
||||||
/* Update scheduler parameters */
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler? */
|
/* Are we in an interrupt handler? */
|
||||||
|
|
||||||
if (up_current_regs())
|
if (up_interrupt_context())
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
* Just copy the current_regs into the OLD rtcb.
|
* Just copy the current_regs into the OLD rtcb.
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler? */
|
/* Are we in an interrupt handler? */
|
||||||
|
|
||||||
if (up_current_regs())
|
if (up_interrupt_context())
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
* Just copy the current_regs into the OLD rtcb.
|
* Just copy the current_regs into the OLD rtcb.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler? */
|
/* Are we in an interrupt handler? */
|
||||||
|
|
||||||
if (up_current_regs())
|
if (up_interrupt_context())
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
* Just copy the current_regs into the OLD rtcb.
|
* Just copy the current_regs into the OLD rtcb.
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
|
|||||||
|
|
||||||
/* Are we in an interrupt handler? */
|
/* Are we in an interrupt handler? */
|
||||||
|
|
||||||
if (up_current_regs())
|
if (up_interrupt_context())
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
* Just copy the g_current_regs into the OLD rtcb.
|
* Just copy the g_current_regs into the OLD rtcb.
|
||||||
|
|||||||
@@ -155,12 +155,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
|
|||||||
|
|
||||||
pdump->info.pid = tcb->pid;
|
pdump->info.pid = tcb->pid;
|
||||||
|
|
||||||
/* If current_regs is not NULL then we are in an interrupt context
|
if (up_interrupt_context())
|
||||||
* and the user context is in current_regs else we are running in
|
|
||||||
* the users context
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (up_current_regs())
|
|
||||||
{
|
{
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
pdump->info.stacks.interrupt.sp = sp;
|
pdump->info.stacks.interrupt.sp = sp;
|
||||||
|
|||||||
@@ -426,12 +426,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
|
|||||||
|
|
||||||
pdump->info.pid = tcb->pid;
|
pdump->info.pid = tcb->pid;
|
||||||
|
|
||||||
/* If current_regs is not NULL then we are in an interrupt context
|
if (up_interrupt_context())
|
||||||
* and the user context is in current_regs else we are running in
|
|
||||||
* the users context
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (up_current_regs())
|
|
||||||
{
|
{
|
||||||
pdump->info.stacks.interrupt.sp = sp;
|
pdump->info.stacks.interrupt.sp = sp;
|
||||||
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
||||||
|
|||||||
@@ -426,12 +426,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
|
|||||||
|
|
||||||
pdump->info.pid = tcb->pid;
|
pdump->info.pid = tcb->pid;
|
||||||
|
|
||||||
/* If current_regs is not NULL then we are in an interrupt context
|
if (up_interrupt_context())
|
||||||
* and the user context is in current_regs else we are running in
|
|
||||||
* the users context
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (up_current_regs())
|
|
||||||
{
|
{
|
||||||
pdump->info.stacks.interrupt.sp = sp;
|
pdump->info.stacks.interrupt.sp = sp;
|
||||||
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
||||||
|
|||||||
@@ -380,12 +380,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
|
|||||||
|
|
||||||
pdump->info.pid = tcb->pid;
|
pdump->info.pid = tcb->pid;
|
||||||
|
|
||||||
/* If current_regs is not NULL then we are in an interrupt context
|
if (up_interrupt_context())
|
||||||
* and the user context is in current_regs else we are running in
|
|
||||||
* the users context
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (up_current_regs())
|
|
||||||
{
|
{
|
||||||
pdump->info.stacks.interrupt.sp = sp;
|
pdump->info.stacks.interrupt.sp = sp;
|
||||||
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
||||||
|
|||||||
@@ -378,12 +378,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
|
|||||||
|
|
||||||
pdump->info.pid = tcb->pid;
|
pdump->info.pid = tcb->pid;
|
||||||
|
|
||||||
/* If current_regs is not NULL then we are in an interrupt context
|
if (up_interrupt_context())
|
||||||
* and the user context is in current_regs else we are running in
|
|
||||||
* the users context
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (up_current_regs())
|
|
||||||
{
|
{
|
||||||
pdump->info.stacks.interrupt.sp = sp;
|
pdump->info.stacks.interrupt.sp = sp;
|
||||||
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
|
||||||
|
|||||||
Reference in New Issue
Block a user