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/arm64/include/arch/asm.h

    r94e75cf r128359eb  
    5252{
    5353        asm volatile ("wfe");
    54 }
    55 
    56 /** Return base address of current stack.
    57  *
    58  * Return the base address of the current stack.
    59  * The stack is assumed to be STACK_SIZE bytes long.
    60  * The stack must start on page boundary.
    61  */
    62 _NO_TRACE static inline uintptr_t get_stack_base(void)
    63 {
    64         uintptr_t v;
    65 
    66         asm volatile (
    67             "mov %[v], sp\n"
    68             "and %[v], %[v], %[size]\n"
    69             : [v] "=&r" (v)
    70             : [size] "r" (~((uint64_t) STACK_SIZE - 1))
    71         );
    72 
    73         return v;
    7454}
    7555
Note: See TracChangeset for help on using the changeset viewer.