Changeset 128359eb in mainline for kernel/generic/src


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/generic/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/cpu/cpu.c

    r94e75cf r128359eb  
    7171                memsetb(cpus, sizeof(cpu_t) * config.cpu_count, 0);
    7272
    73                 // NOTE: All kernel stacks must be aligned to STACK_SIZE,
    74                 //       see get_stack_base().
    75                 size_t i;
    76                 for (i = 0; i < config.cpu_count; i++) {
     73                /*
     74                 * NOTE: All kernel stacks must be aligned to STACK_SIZE,
     75                 *       see CURRENT.
     76                 */
     77                for (size_t i = 0; i < config.cpu_count; i++) {
    7778                        uintptr_t stack_phys = frame_alloc(STACK_FRAMES,
    7879                            FRAME_LOWMEM | FRAME_ATOMIC, STACK_SIZE - 1);
  • kernel/generic/src/main/main.c

    r94e75cf r128359eb  
    170170            ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE);
    171171
    172         // NOTE: All kernel stacks must be aligned to STACK_SIZE,
    173         //       see get_stack_base().
     172        /*
     173         * NOTE: All kernel stacks must be aligned to STACK_SIZE,
     174         *       see CURRENT.
     175         */
    174176
    175177        /* Place the stack after the kernel, init and ballocs. */
  • kernel/generic/src/proc/thread.c

    r94e75cf r128359eb  
    191191        kmflags &= ~FRAME_HIGHMEM;
    192192
    193         // NOTE: All kernel stacks must be aligned to STACK_SIZE,
    194         //       see get_stack_base().
     193        /*
     194         * NOTE: All kernel stacks must be aligned to STACK_SIZE,
     195         *       see CURRENT.
     196         */
    195197
    196198        uintptr_t stack_phys =
Note: See TracChangeset for help on using the changeset viewer.