Changeset 128359eb in mainline for kernel/arch/ia32


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/ia32/include/arch
Files:
2 edited

Legend:

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

    r94e75cf r128359eb  
    348348
    349349#endif /* PROCESSOR_i486 */
    350 
    351 /** Return base address of current stack
    352  *
    353  * Return the base address of the current stack.
    354  * The stack is assumed to be STACK_SIZE bytes long.
    355  * The stack must start on page boundary.
    356  *
    357  */
    358 _NO_TRACE static inline uintptr_t get_stack_base(void)
    359 {
    360         uintptr_t v;
    361 
    362         asm volatile (
    363             "andl %%esp, %[v]\n"
    364             : [v] "=r" (v)
    365             : "0" (~(STACK_SIZE - 1))
    366         );
    367 
    368         return v;
    369 }
    370350
    371351/** Invalidate TLB Entry.
  • kernel/arch/ia32/include/arch/context.h

    r94e75cf r128359eb  
    4545 * First for pop of the saved register, second during ret instruction.
    4646 *
    47  * One item is put onto stack to support get_stack_base().
     47 * One item is put onto stack to support CURRENT.
    4848 */
    4949#define SP_DELTA  (8 + STACK_ITEM_SIZE)
Note: See TracChangeset for help on using the changeset viewer.