summaryrefslogtreecommitdiff
path: root/kern/thread.c
AgeCommit message (Collapse)Author
2019-08-16Remove useless commentRichard Braun
2019-08-16Replace some barrier()s with local atomic fencesRichard Braun
2019-05-19kern/sref: reworkRichard Braun
Remove CPU registration, optimize manager weak-ups, replace the global review queue with local review queues. CPU registration and the global review queue were motivated by low power consumption, but considering how the kernel is evolving, this was likely overengineering.
2019-01-17Replace "awaken" with "awoken"Richard Braun
See https://www.merriam-webster.com/words-at-play/usage-awaken-awoken-awakened.
2018-11-17kern/thread: fix suspend on dead threadsRichard Braun
2018-11-05kern/thread: implement suspend/resume operationsAgustina Arzille
2018-08-12kern/thread: make thread-specific data optionalRichard Braun
2018-07-30Rework assertive functionsRichard Braun
Instead of combining assertions and checking into single functions, rework those into pure checking functions usable with assert(). Those functions were introduced because of warnings about unused functions/variables caused by an earlier implementation of assert().
2018-07-25kern/{fmt,shell}: update from upstreamRichard Braun
The shell module has been "objectified" and now supports multiple instances with shareable command sets.
2018-06-25kern/perfmon: new moduleRichard Braun
2018-06-25kern/thread: new thread_cpu functionRichard Braun
2018-06-25kern/thread: slightly rework thread state handlingRichard Braun
2018-05-14kern/thread: make thread_create slightly more convenientRichard Braun
Don't require the caller to pass a pointer to the newly created thread.
2018-02-24kern/{cbuf,fmt,hash,hlist,list,plist,rdxtree,shell,slist}: update from upstreamRichard Braun
Note that this commit changes the order of some list operations without triggering warnings.
2018-02-24New errno.h standard headerRichard Braun
Use standard errno codes. This change also adds strerror to string.h.
2018-02-22kern/spinlock: add ownership tracking as a debugging featureRichard Braun
2018-02-20kern/llsync: remove moduleRichard Braun
2018-02-20kern/rcu: new moduleRichard Braun
This module implements preemptible RCU.
2018-02-20kern/thread: remove sref registration callsRichard Braun
The upcoming RCU implementation requires scalable reference counters to be usable in interrupt context, and in particular, in the periodic tick handler, when an idle thread may be running, and the local processor is not registered.
2018-02-12kern/thread: minor changesRichard Braun
Make thread_runq_schedule() slightly more resilient by setting the next thread pointer to NULL after the context switch.
2018-01-30Fix condition variable broadcastingRichard Braun
The broadcast implementation is based on an invalid assumption, namely that the first mutex_unlock call following condition_wait would be invoked on the same mutex. Fixing this while guarding against the thundering herd effect requires augmenting mutexes with a pointer to the condition variable they may be associated with. Since the size of mutexes is currently more important than broadcast scalability, the implementation is simplified into one which suffers from the thundering herd effect.
2018-01-29Fix undefined behavior in conditional macro replacementRichard Braun
See C11 6.10.3 ยง11 : If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives, the behavior is undefined.
2018-01-10kern/thread: minor name changesRichard Braun
Call the various thread-local nesting counters "levels".
2018-01-07kern/thread: fix initialization raceRichard Braun
2017-12-03Revert "Make assert have no side effects"Richard Braun
This reverts commit d18d0e85596f90e0bd597b33d58209d0b3973c95.
2017-09-21Merge branch 'xbuild'Richard Braun
2017-09-21New build systemRichard Braun
The new build system, called xbuild, is a minimalistic kbuild-like make-based build system, also using kconfig for scalable configurations.
2017-09-20kern/thread: restore comment about thread destructionRichard Braun
2017-09-07Use accessors when referring to global kernel objectsRichard Braun
The kernel_map/kernel_pmap/kernel_task/etc... names were reused as they were in the Mach source code. They've been a (mostly harmless) long-standing violation of the coding rules.
2017-09-07kern/thread: fix thread stack guard selectionRichard Braun
2017-09-06Use new thread_check_intr_context function consistentlyRichard Braun
2017-09-05x86/{pmap,tcb}: don't use tsd for the update oplistRichard Braun
2017-09-02Rework the build systemRichard Braun
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-08-31kern/thread: fix atomic accesses to a thread's run queueRichard Braun
2017-08-27Add TODO entriesRichard Braun
2017-08-27kern/thread: add the thread_delay functionRichard Braun
2017-08-27kern/thread: implement timed sleepsRichard Braun
2017-08-27kern/clock: new moduleRichard Braun
2017-08-25kern/thread: add a stack debugging assertion on schedulingRichard Braun
2017-08-23kern/thread: really fix terminationRichard Braun
Change the semantics of thread_join so that it not only waits for thread_exit but also for the last reference to be dropped.
2017-08-21kern/thread: fix and improve terminationRichard Braun
2017-07-30kern/thread: replace the reaper with deferred worksRichard Braun
2017-07-21Merge branch 'adaptive_spinning'Richard Braun
2017-07-21kern/mutex: new adaptive spinning mutex implementationAgustina Arzille
2017-07-13kern/thread: fix thread stack guard supportRichard Braun
Since the introduction of the kernel VM object, page referencing has become more strict, preventing the thread stack guard code to function. Work around the issue by keeping the physical pages at the stack boundaries.
2017-07-13Switch to initialization operationsRichard Braun
2017-06-25Use the C11 alignas and noreturn macrosRichard Braun
2017-06-25Remove the param moduleRichard Braun
Move the page properties into the new x86/page module, and the virtual memory layout macros into the x86/pmap module.