Comments (4)
@lecopzer, can you clarify?
from mini-arm-os.
In the comment linked by, it indicate r7 is for sp, but sp is r13 instead. Also quoting from Arm-Cortex-M3 technical reference:
Sorry I don't get the point, "store sp
in r7
" and "sp
is r13
" do not conflict with each other.
"After returning from the ISR, the processor automatically pops the eight registers from the stack. Interrupt return is passed as a data field in the LR, so ISR functions can be normal C/C++ functions, and do not require a veneer."
This talks about how exception return works.
Since PendSV
is not a _normal_ ISR
, it deals with context switch
and never return, we have to handle calling convention ourselves and avoid GCC store any thing at function prologue; otherwise GCC would corrupt our context switch
implementation.
So I wonder if we need naked attribute at all
Could you please disassemble for both function with and without naked
attribute, and explicitly point out anything you thought it's unreasonable?
If you have any question, feel free to ask.
Thanks
from mini-arm-os.
Hi @lecopzer,
Thanks for your illustration, the concept is clear after I compared the disassembled pendsv
function, the function without naked attribute modify the r7
without restoring it, thus might affect the user program.
Thank you
from mini-arm-os.
Answered.
from mini-arm-os.
Related Issues (10)
- 01-HelloWorld cannot use "Press Ctrl-A and then X to exit QEMU" in ubuntu 14.04 x86_64 guest by virtualbox HOT 1
- Irrational exception return behavior HOT 2
- Weird FIXME HOT 4
- Functions declared with the naked attribute also require basic asm HOT 1
- https://gcc.gnu.org/onlinedocs/gcc/ARM-Function-Attributes.html
- Wrong processor mode in first time exception return
- Should not force LR to specific EXC_RETURN value HOT 1
- Support for MPU HOT 2
- No actual guides for implementing and running OS HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mini-arm-os.