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
arm/arch: using __builtin_frame_address(0) implement up_getsp(). #6079
Conversation
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This seems to be GCC specific implementation. |
Yes, but |
Yeah, most of other compilers have |
I mean what is the benefit of this change? Is it clang related or current implementation brings some issues? |
Yes, but the assembly grammar is dramatically different, and is hard to share the same assembly code between different compiler.
Not relate to clang(has the same support of |
I'd like to notice that the the new chip can not use the arm common context switch code because the different assembly grammar. The reason we want to put this chip in arch/arm is most of the common code can be shared. |
Yeah. Also |
Maybe a solution can be to create a new arch folder and symlink the common files instead of modifying ARM to fit non-ARM? |
It's too heavy to create new arch for a specific chip which share many common implementation with arch/arm
There is no symlink in nuttx git repo, only the build script create some symlink dynamically, so:
BTW, this isn't the first time that arch layer use the toolchain specific function. For example, stdarg do the same thing here: |
Ok. Let's proceed with this pr |
Summary
using compile builtin function __builtin_frame_address(0) to implement the up_getsp()
Test
stm32f7