Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backtrace: use CURRENT_REGS when in interrupt context #8192

Merged
merged 1 commit into from
Jan 29, 2023

Conversation

zyfeier
Copy link
Contributor

@zyfeier zyfeier commented Jan 19, 2023

Summary

Backtrace CURRENT_REGS when in interrupt context.

Because when panic occurs in the interrupt context, xcp.regs for the running task is not updated, so need use CURRENT_REGS

Impact

NA

Testing

BES2003

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
@davids5
Copy link
Contributor

davids5 commented Jan 19, 2023

@zyfeier Can you add some background here explaining why and the value of the change?

@zyfeier
Copy link
Contributor Author

zyfeier commented Jan 28, 2023

@zyfeier Can you add some background here explaining why and the value of the change?

@davids5
When panic occurs in the interrupt context, xcp.regs for the running task is not updated, so need use CURRENT_REGS to replace.

@davids5
Copy link
Contributor

davids5 commented Jan 29, 2023

@zyfeier - That make sense. Thank you.

@xiaoxiang781216
Copy link
Contributor

@zyfeier is this patch ready for review?

@zyfeier zyfeier marked this pull request as ready for review January 29, 2023 08:08
@davids5 davids5 merged commit e6d2f06 into apache:master Jan 29, 2023
@zyfeier zyfeier deleted the backtrace branch February 14, 2023 03:08
anchao added a commit to anchao/nuttx that referenced this pull request Oct 25, 2024
modify the prototype of up_putc(): remove the return value

The architecture code does not care about the return value of up_putc(), so removing it saves two statements:

Before:                                                    After:
de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)    |  de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)
de50: e24dd014  sub sp, sp, apache#20                         |  de50: e24dd014  sub sp, sp, apache#20
de54: e58d0004  str r0, [sp, #4]                        |  de54: e58d0004  str r0, [sp, #4]
de58: e30030f8  movw  r3, apache#248  @ 0xf8                  |  de58: e30030f8  movw  r3, apache#248  @ 0xf8
de5c: e3423000  movt  r3, apache#8192 @ 0x2000                |  de5c: e3423000  movt  r3, apache#8192 @ 0x2000
de60: e58d300c  str r3, [sp, apache#12]                       |  de60: e58d300c  str r3, [sp, apache#12]
de64: e59d1004  ldr r1, [sp, #4]                        |  de64: e59d1004  ldr r1, [sp, #4]
de68: e59d000c  ldr r0, [sp, apache#12]                       |  de68: e59d000c  ldr r0, [sp, apache#12]
de6c: ebfffe66  bl  d80c <pl011_putc>                   |  de6c: ebfffe66  bl  d80c <pl011_putc>
de70: e59d3004  ldr r3, [sp, #4]                        |  de70: e28dd014  add sp, sp, apache#20
de74: e1a0000  mov r0, r3                              |  de74: e49df004  pop {pc}    @ (ldr pc, [sp], #4)
de78: e28dd014  add sp, sp, apache#20                         |
de7c: e49df004  pop {pc}    @ (ldr pc, [sp], #4)        |

Signed-off-by: chao an <anchao@lixiang.com>
anchao added a commit to anchao/nuttx that referenced this pull request Oct 25, 2024
modify the prototype of up_putc(): remove the return value

The architecture code does not care about the return value of up_putc(), so removing it saves two statements:

Before:                                                    After:
de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)    |  de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)
de50: e24dd014  sub sp, sp, apache#20                         |  de50: e24dd014  sub sp, sp, apache#20
de54: e58d0004  str r0, [sp, #4]                        |  de54: e58d0004  str r0, [sp, #4]
de58: e30030f8  movw  r3, apache#248  @ 0xf8                  |  de58: e30030f8  movw  r3, apache#248  @ 0xf8
de5c: e3423000  movt  r3, apache#8192 @ 0x2000                |  de5c: e3423000  movt  r3, apache#8192 @ 0x2000
de60: e58d300c  str r3, [sp, apache#12]                       |  de60: e58d300c  str r3, [sp, apache#12]
de64: e59d1004  ldr r1, [sp, #4]                        |  de64: e59d1004  ldr r1, [sp, #4]
de68: e59d000c  ldr r0, [sp, apache#12]                       |  de68: e59d000c  ldr r0, [sp, apache#12]
de6c: ebfffe66  bl  d80c <pl011_putc>                   |  de6c: ebfffe66  bl  d80c <pl011_putc>
de70: e59d3004  ldr r3, [sp, #4]                        |  de70: e28dd014  add sp, sp, apache#20
de74: e1a0000  mov r0, r3                              |  de74: e49df004  pop {pc}    @ (ldr pc, [sp], #4)
de78: e28dd014  add sp, sp, apache#20                         |
de7c: e49df004  pop {pc}    @ (ldr pc, [sp], #4)        |

Signed-off-by: chao an <anchao@lixiang.com>
anchao added a commit to anchao/nuttx that referenced this pull request Oct 26, 2024
modify the prototype of up_putc(): remove the return value

The architecture code does not care about the return value of up_putc(), so removing it saves two statements:

Before:                                                    After:
de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)    |  de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)
de50: e24dd014  sub sp, sp, apache#20                         |  de50: e24dd014  sub sp, sp, apache#20
de54: e58d0004  str r0, [sp, #4]                        |  de54: e58d0004  str r0, [sp, #4]
de58: e30030f8  movw  r3, apache#248  @ 0xf8                  |  de58: e30030f8  movw  r3, apache#248  @ 0xf8
de5c: e3423000  movt  r3, apache#8192 @ 0x2000                |  de5c: e3423000  movt  r3, apache#8192 @ 0x2000
de60: e58d300c  str r3, [sp, apache#12]                       |  de60: e58d300c  str r3, [sp, apache#12]
de64: e59d1004  ldr r1, [sp, #4]                        |  de64: e59d1004  ldr r1, [sp, #4]
de68: e59d000c  ldr r0, [sp, apache#12]                       |  de68: e59d000c  ldr r0, [sp, apache#12]
de6c: ebfffe66  bl  d80c <pl011_putc>                   |  de6c: ebfffe66  bl  d80c <pl011_putc>
de70: e59d3004  ldr r3, [sp, #4]                        |  de70: e28dd014  add sp, sp, apache#20
de74: e1a0000  mov r0, r3                              |  de74: e49df004  pop {pc}    @ (ldr pc, [sp], #4)
de78: e28dd014  add sp, sp, apache#20                         |
de7c: e49df004  pop {pc}    @ (ldr pc, [sp], #4)        |

Signed-off-by: chao an <anchao@lixiang.com>
xiaoxiang781216 pushed a commit that referenced this pull request Oct 26, 2024
modify the prototype of up_putc(): remove the return value

The architecture code does not care about the return value of up_putc(), so removing it saves two statements:

Before:                                                    After:
de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)    |  de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)
de50: e24dd014  sub sp, sp, #20                         |  de50: e24dd014  sub sp, sp, #20
de54: e58d0004  str r0, [sp, #4]                        |  de54: e58d0004  str r0, [sp, #4]
de58: e30030f8  movw  r3, #248  @ 0xf8                  |  de58: e30030f8  movw  r3, #248  @ 0xf8
de5c: e3423000  movt  r3, #8192 @ 0x2000                |  de5c: e3423000  movt  r3, #8192 @ 0x2000
de60: e58d300c  str r3, [sp, #12]                       |  de60: e58d300c  str r3, [sp, #12]
de64: e59d1004  ldr r1, [sp, #4]                        |  de64: e59d1004  ldr r1, [sp, #4]
de68: e59d000c  ldr r0, [sp, #12]                       |  de68: e59d000c  ldr r0, [sp, #12]
de6c: ebfffe66  bl  d80c <pl011_putc>                   |  de6c: ebfffe66  bl  d80c <pl011_putc>
de70: e59d3004  ldr r3, [sp, #4]                        |  de70: e28dd014  add sp, sp, #20
de74: e1a0000  mov r0, r3                              |  de74: e49df004  pop {pc}    @ (ldr pc, [sp], #4)
de78: e28dd014  add sp, sp, #20                         |
de7c: e49df004  pop {pc}    @ (ldr pc, [sp], #4)        |

Signed-off-by: chao an <anchao@lixiang.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants