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

RFC 1201 amendments: Naked function corrections #2774

Closed
wants to merge 2 commits into from
Closed

RFC 1201 amendments: Naked function corrections #2774

wants to merge 2 commits into from

Commits on Nov 22, 2019

  1. RFC 1201 amendments: naked functions are never inlined

    clang will automatically set the NoInline attribute for naked functions
    and the NoInline attribute wins over AlwaysInline attribute. Let's
    follow their lead and specify the same requiremet.
    
    As the compiller can't safely change/remove the prologue and epilogue
    for naked functions when it inlines them inlining the naked functions
    could result in strange bugs.
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    alistair23 committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    1bbab93 View commit details
    Browse the repository at this point in the history
  2. RFC 1201 amendments: Require assembly only inside naked functions

    Following the requirements of clang/LLVM let's do two things:
     - Require naked functions to only contain inline assembly
     - Require naked functions to not reference the parameters
    
    As the compiler doesn't make any guarentees about the stack the two
    above points would be unsafe to allow.
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    alistair23 committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    a2c6281 View commit details
    Browse the repository at this point in the history