Ignore:
Timestamp:
2020-06-12T16:46:32Z (4 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ffccdff0
Parents:
94e75cf
Message:

Replace get_stack_base() with builtin_frame_address(0)

The usage of an intrinsic function to obtain the current stack pointer
should provide the compuler more room for performance optimizations than
the hand-written (and volatile) inline assembly block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/arch/asm.h

    r94e75cf r128359eb  
    382382}
    383383
    384 /** Return base address of current stack.
    385  *
    386  * Return the base address of the current stack.
    387  * The stack is assumed to be STACK_SIZE bytes long.
    388  * The stack must start on page boundary.
    389  *
    390  */
    391 _NO_TRACE static inline uintptr_t get_stack_base(void)
    392 {
    393         uintptr_t unbiased_sp;
    394 
    395         asm volatile (
    396             "add %%sp, %[stack_bias], %[unbiased_sp]\n"
    397             : [unbiased_sp] "=r" (unbiased_sp)
    398             : [stack_bias] "i" (STACK_BIAS)
    399         );
    400 
    401         return ALIGN_DOWN(unbiased_sp, STACK_SIZE);
    402 }
    403 
    404384/** Read Version Register.
    405385 *
Note: See TracChangeset for help on using the changeset viewer.