Changeset 2b264c4 in mainline


Ignore:
Timestamp:
2023-02-02T21:58:36Z (15 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b076dfb
Parents:
f43d8ce
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-01-20 18:16:32)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-02 21:58:36)
Message:

Add architecture-specific spinlock optimization

Location:
kernel
Files:
5 edited

Legend:

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

    rf43d8ce r2b264c4  
    5858        }
    5959}
     60
     61#define ARCH_SPIN_HINT() asm volatile ("pause\n")
    6062
    6163/** Byte from port
  • kernel/arch/arm32/include/arch/asm.h

    rf43d8ce r2b264c4  
    6565}
    6666
     67#ifdef PROCESSOR_ARCH_armv7_a
     68#define ARCH_SPIN_HINT() asm volatile ("yield")
     69#endif
     70
    6771_NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v)
    6872{
  • kernel/arch/arm64/include/arch/asm.h

    rf43d8ce r2b264c4  
    6060                ;
    6161}
     62
     63#define ARCH_SPIN_HINT() asm volatile ("yield")
    6264
    6365/** Output byte to port.
  • kernel/arch/ia32/include/arch/asm.h

    rf43d8ce r2b264c4  
    6363        );
    6464}
     65
     66#define ARCH_SPIN_HINT() asm volatile ("pause\n")
    6567
    6668#define GEN_READ_REG(reg) _NO_TRACE static inline sysarg_t read_ ##reg (void) \
  • kernel/generic/src/synch/spinlock.c

    rf43d8ce r2b264c4  
    3737 */
    3838
     39#include <arch/asm.h>
    3940#include <synch/spinlock.h>
    4041#include <atomic.h>
     
    4748#include <stacktrace.h>
    4849#include <cpu.h>
     50
     51#ifndef ARCH_SPIN_HINT
     52#define ARCH_SPIN_HINT() ((void)0)
     53#endif
    4954
    5055/** Initialize spinlock
     
    7782
    7883        while (atomic_flag_test_and_set_explicit(&lock->flag, memory_order_acquire)) {
     84                ARCH_SPIN_HINT();
     85
    7986#ifdef CONFIG_DEBUG_SPINLOCK
    8087                /*
Note: See TracChangeset for help on using the changeset viewer.