Skip to content

arch: use up_current_regs/up_set_current_regs replace CURRENT_REGS#13423

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
hujun260:apache_4
Sep 13, 2024
Merged

arch: use up_current_regs/up_set_current_regs replace CURRENT_REGS#13423
xiaoxiang781216 merged 1 commit into
apache:masterfrom
hujun260:apache_4

Conversation

@hujun260
Copy link
Copy Markdown
Contributor

@hujun260 hujun260 commented Sep 13, 2024

Summary

reason:
1 On different architectures, we can utilize more optimized strategies
to implement up_current_regs/up_set_current_regs.
eg. use interrupt registers or percpu registers.

code size
before
text data bss dec hex filename
262848 49985 63893 376726 5bf96 nuttx

after
text data bss dec hex filename
262844 49985 63893 376722 5bf92 nuttx

size change -4

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic
-machine virt,virtualization=on,gic-version=3
-net none -chardev stdio,id=con,mux=on -serial chardev:con
-mon chardev=con,mode=readline -kernel ./nuttx

Impact

none

Testing

ostest

reason:
1 On different architectures, we can utilize more optimized strategies
  to implement up_current_regs/up_set_current_regs.
eg. use interrupt registersor percpu registers.

code size
before
    text    data     bss     dec     hex filename
 262848   49985   63893  376726   5bf96 nuttx

after
       text    data     bss     dec     hex filename
 262844   49985   63893  376722   5bf92 nuttx

size change -4

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
Copy link
Copy Markdown
Contributor

@GUIDINGLI GUIDINGLI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of are replacement, LGTM

@xiaoxiang781216 xiaoxiang781216 merged commit 908df72 into apache:master Sep 13, 2024
@tmedicci
Copy link
Copy Markdown
Contributor

Hi @hujun260 ,

This PR broke esp32s3-devkit:stack: the device halts during bring-up. Can you take a look, please?

It seems that @anjiahao1 made some changes for this same feature in #13457, but I don't know if it was supposed to fix something broke by this PR.

@hujun260
Copy link
Copy Markdown
Contributor Author

My patch has nothing to do with @anjiahao1's patch.
Thank you for your feedback, but I'm not sure how to reproduce the issue you've reported.
I've reviewed the code again and found that the changes specific to xtensa (esp32s3-devkit:stack) are quite limited,
focusing mainly on the following files, which are mostly simple replacements.
It doesn't seem these changes would cause any issues. Could you please try debugging by rolling back the changes step by step on your own?
I think this debugging is simple.

arch/xtensa/include/irq.h
arch/xtensa/src/common/xtensa.h
arch/xtensa/src/common/xtensa_assert.c
arch/xtensa/src/common/xtensa_backtrace.c
arch/xtensa/src/common/xtensa_cpupause.c
arch/xtensa/src/common/xtensa_initialize.c
arch/xtensa/src/common/xtensa_irqdispatch.c
arch/xtensa/src/common/xtensa_registerdump.c
arch/xtensa/src/common/xtensa_schedsigaction.c

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.

5 participants