summaryrefslogtreecommitdiff
path: root/kern/spinlock.h
AgeCommit message (Collapse)Author
2018-03-02kern/spinlock: fix and optimizeRichard Braun
Making the unlock operation block allows tricky deadlocks to occur in case a thread is interrupted right before announcing itself as the first waiter in the queue. Since locking is expected to block, the spinlock implementation is reworked to move the hand-off performed by the unlock operation into the lock operation. As a side effect, the common case of a single waiter is also optimized.
2018-02-24New errno.h standard headerRichard Braun
Use standard errno codes. This change also adds strerror to string.h.
2018-02-24Don't use reserved identifiersRichard Braun
2018-02-22kern/spinlock: add ownership tracking as a debugging featureRichard Braun
2017-12-03Revert "Make assert have no side effects"Richard Braun
This reverts commit d18d0e85596f90e0bd597b33d58209d0b3973c95.
2017-09-02kern/thread: new preemption control macrosRichard Braun
These new macros take care of disabling/restoring interrupts in the appropriate order.
2017-09-02Make assert have no side effectsRichard Braun
This makes sure symbols referenced by assert uses may not be generated if unused. The recently introduced __unused macro is used to suppress compiler warnings resulting from this change.
2017-07-13Switch to initialization operationsRichard Braun
2017-04-09kern/{mutex,rtmutex,spinlock}: optimize fast pathsRichard Braun
Rework so that fast paths occupy the first indentation level, and use the unlikely macro on the relevant conditions.
2017-04-03kern/spinlock: new fair and scalable implementationRichard Braun
This new implementation, based on the MCS locks, provides rigorous fairness and excellent scalability.
2017-02-20kern/spinlock: make spinlock_trylock return ERROR_BUSY instead of 1Richard Braun
2017-02-04kern/types: split into module-specific type headersRichard Braun
Using a single header for all types causing inclusion circular dependencies isn't very elegant and doesn't scale.
2016-12-09Force brackets around one-line conditional statementsRichard Braun
This change was done using astyle, with a few manual editing here and there.
2014-08-15Remove static initializer macrosRichard Braun
These initializers are unnecessary, unused, and cumbersome to maintain.
2014-06-18kern/thread: add thread_joinRichard Braun
This change affects more files than it apparently would at first glance. This is because circular dependencies can easily be created between the thread, mutex, condition and spinlock modules. As a result, some of the types of these modules are now defined in kern/types.h.
2013-05-15x86/cpu: pass flags by address to cpu_intr_saveRichard Braun
Not a necessary change, but done for consistency.
2013-04-06kern/spinlock: rewrite spinlock_assert_locked as a macroRichard Braun
Using a macro makes panic display the function where the assertion actually failed.
2013-04-03kern/spinlock: change the interface of trylock functionsRichard Braun
Make trylock functions behave as error-returning functions.
2013-02-26kern/spinlock: add interrupt-handling locking primitivesRichard Braun
2012-12-11kern/spinlock: minor changesRichard Braun
2012-12-10kern/spinlock: describe implied memory barriersRichard Braun
2012-12-10kern/spinlock: make spinlocks disable preemptionRichard Braun
2012-11-29kern/spinlock: fix spinlock_assert_locked return typeRichard Braun
2012-11-17kern/spinlock: new spinlock_assert_locked functionRichard Braun
2012-11-17kern/spinlock: don't disable interruptsRichard Braun
Let the users deal with interrupts themselves. It allows greater freedom to modules that need to carefully change the machine state.
2012-11-02kern/spinlock: new moduleRichard Braun
This module provides spin locks.