Changeset 128359eb in mainline for kernel/arch/mips32/include


Ignore:
Timestamp:
2020-06-12T16:46:32Z (5 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.

Location:
kernel/arch/mips32/include/arch
Files:
2 edited

Legend:

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

    r94e75cf r128359eb  
    4545}
    4646
    47 /** Return base address of current stack
    48  *
    49  * Return the base address of the current stack.
    50  * The stack is assumed to be STACK_SIZE bytes long.
    51  * The stack must start on page boundary.
    52  *
    53  */
    54 _NO_TRACE static inline uintptr_t get_stack_base(void)
    55 {
    56         uintptr_t base;
    57 
    58         asm volatile (
    59             "and %[base], $29, %[mask]\n"
    60             : [base] "=r" (base)
    61             : [mask] "r" (~(STACK_SIZE - 1))
    62         );
    63 
    64         return base;
    65 }
    66 
    6747_NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v)
    6848{
  • kernel/arch/mips32/include/arch/context.h

    r94e75cf r128359eb  
    4141
    4242/*
    43  * Put one item onto the stack to support get_stack_base() and align it up.
     43 * Put one item onto the stack to support CURRENT and align it up.
    4444 */
    4545#define SP_DELTA  (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
Note: See TracChangeset for help on using the changeset viewer.