- Jan 05, 2017
- Jan 04, 2017
-
-
Subv authored
Kernel: Use different thread statuses when a thread calls WaitSynchronization1 and WaitSynchronizationN with wait_all = true. This commit removes the overly general THREADSTATUS_WAIT_SYNCH and replaces it with two more granular statuses: THREADSTATUS_WAIT_SYNCH_ANY when a thread waits on objects via WaitSynchronization1 or WaitSynchronizationN with wait_all = false. THREADSTATUS_WAIT_SYNCH_ALL when a thread waits on objects via WaitSynchronizationN with wait_all = true.
-
Subv authored
Kernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes
-
Subv authored
This will be useful when implementing mutex priority inheritance.
-
- Dec 22, 2016
- Dec 17, 2016
-
-
wwylele authored
-
- Dec 14, 2016
-
-
Subv authored
-
- Dec 09, 2016
-
-
Subv authored
Define a variable with the value of the sync timeout error code. Use a boost::flat_map instead of an unordered_map to hold the equivalence of objects and wait indices in a WaitSynchN call.
-
- Dec 04, 2016
-
-
Subv authored
-
Subv authored
Threads will now be awakened when the objects they're waiting on are signaled, instead of repeating the WaitSynchronization call every now and then. The scheduler is now called once after every SVC call, and once after a thread is awakened from sleep by its timeout callback. This new implementation is based off reverse-engineering of the real kernel. See https://gist.github.com/Subv/02f29bd9f1e5deb7aceea1e8f019c8f4 for a more detailed description of how the real kernel handles rescheduling.
-
- Sep 22, 2016
-
-
wwylele authored
-
- Sep 21, 2016
-
-
Emmanuel Gil Peyrot authored
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
-
- Sep 18, 2016
-
-
Emmanuel Gil Peyrot authored
-
- May 07, 2016
-
-
Subv authored
Kernel/Threads: Dynamically allocate the TLS region for threads in the BASE region of the linear heap. Each thread gets a 0x200-byte area from the 0x1000-sized page, when all 8 thread slots in a single page are used up, the kernel allocates a new page to hold another 8 entries. This is consistent with what the real kernel does.
-
- Sep 10, 2015
-
-
Lioncash authored
-
- Jun 27, 2015
-
-
Emmanuel Gil Peyrot authored
-
- Jun 17, 2015
-
-
bunnei authored
-
- May 29, 2015
-
-
Emmanuel Gil Peyrot authored
-
- May 15, 2015
-
-
Yuri Kunde Schlesner authored
memory.cpp/h contains definitions related to acessing memory and configuring the address space mem_map.cpp/h contains higher-level definitions related to configuring the address space accoording to the kernel and allocating memory.
-
- May 12, 2015
-
-
Yuri Kunde Schlesner authored
Instead just use nullptr to represent no thread is active.
-
Subv authored
-
- May 11, 2015
-
-
Subv authored
-
Yuri Kunde Schlesner authored
-
- May 10, 2015
- May 09, 2015
-
-
Yuri Kunde Schlesner authored
-
- Apr 09, 2015
- Feb 10, 2015
-
-
Kevin Hartman authored
* Simplifies scheduling logic, specifically regarding thread status. It should be much clearer which statuses are valid for a thread at any given point in the system. * Removes dead code from thread.cpp. * Moves the implementation of resetting a ThreadContext to the corresponding core's implementation. Other changes: * Fixed comments in arm interfaces. * Updated comments in thread.cpp * Removed confusing, useless, functions like MakeReady() and ChangeStatus() from thread.cpp. * Removed stack_size from Thread. In the CTR kernel, the thread's stack would be allocated before thread creation.
-
- Feb 02, 2015
-
-
Yuri Kunde Schlesner authored
During normal operation, a thread waiting on an WaitObject and the object hold mutual references to each other for the duration of the wait. If a process is forcefully terminated (The CTR kernel has a SVC to do this, TerminateProcess, though no equivalent exists for threads.) its threads would also be stopped and destroyed, leaving dangling pointers in the WaitObjects. The solution is to simply have the Thread remove itself from WaitObjects when it is stopped. The vector of Threads in WaitObject has also been changed to hold SharedPtrs, just in case. (Better to have a reference cycle than a crash.)
-
Yuri Kunde Schlesner authored
This should speed up compile times a bit, as well as enable more liberal use of forward declarations. (Due to SharedPtr not trying to emit the destructor anymore.)
-
Yuri Kunde Schlesner authored
-
Yuri Kunde Schlesner authored
This is to support the removal of GetHandle soon
-
Yuri Kunde Schlesner authored
-
- Jan 30, 2015
-
-
Yuri Kunde Schlesner authored
-
- Jan 22, 2015