Git Product home page Git Product logo

Comments (4)

jserv avatar jserv commented on September 28, 2024

@lecopzer, can you clarify?

from mini-arm-os.

lecopzer avatar lecopzer commented on September 28, 2024

HI @ryanpatiency

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.

ryanpatiency avatar ryanpatiency commented on September 28, 2024

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.

jserv avatar jserv commented on September 28, 2024

Answered.

from mini-arm-os.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.