Changeset 29029ac0 in mainline


Ignore:
Timestamp:
2024-01-18T16:31:40Z (4 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master
Children:
1c1767f
Parents:
ed7e057
Message:

Call after_thread_ran_arch() before context switch

This is only used on sparc, and requires an additional window flush
before the register is sampled. Doing it this way allows switching
from one thread to another without the intermediary step of
a special scheduler context.

Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/proc/sun4u/scheduler.c

    red7e057 r29029ac0  
    7676{
    7777        if (THREAD->uspace) {
     78                asm volatile ("flushw");
     79
    7880                /* sample the state of the userspace window buffer */
    7981                THREAD->arch.uspace_window_buffer =
  • kernel/arch/sparc64/src/proc/sun4v/scheduler.c

    red7e057 r29029ac0  
    6868{
    6969        if (THREAD->uspace) {
     70                asm volatile ("flushw");
     71
    7072                /* sample the state of the userspace window buffer */
    7173                THREAD->arch.uspace_window_buffer =
  • kernel/generic/src/proc/scheduler.c

    red7e057 r29029ac0  
    443443        THREAD->kcycles += get_cycle() - THREAD->last_cycle;
    444444
     445        /*
     446         * On Sparc, this saves some extra userspace state that's not
     447         * covered by context_save()/context_restore().
     448         */
     449        after_thread_ran_arch();
     450
    445451        if (new_state == Sleeping) {
    446452                /* Prefer the thread after it's woken up. */
     
    499505
    500506        if (THREAD) {
    501                 /*
    502                  * On Sparc, this saves some extra userspace state that's not
    503                  * covered by context_save()/context_restore().
    504                  */
    505                 after_thread_ran_arch();
    506 
    507507                state_t state = THREAD->state;
    508508                irq_spinlock_unlock(&THREAD->lock, false);
Note: See TracChangeset for help on using the changeset viewer.