citra-emu/citra — pull request #9 by bunnei (2014-05-23 03:09:02+00:00)
Title: Add initial kernel HLE, includes thread creation and context switching

This branch started as my attempt to support threads - the next prerequisite for booting more advanced applications. I quickly realized that to do this, I really needed to approach the problem as emulating the CTROS kernel. As such, this adds support for:

* Allocating/managing kernel objects
* Creating threads and thread queuing
* Context switching - albeit on very primitive mechanisms (right now, we switch on waitSynchronization SVC and on simulated VBLANK)
* Mutex handle creation, and supporting framework code (mutexes just pass through right now, however)
* Decoding of several new SVC calls
* Various cleanups/framework improvements to support the above

At this time, the primitive threading is sufficient to (at the very least) execute multiple threads used in current homebrew. Without events, mutexes, and semaphores implemented, (among other issues) non-homebrew does not show much improvement yet. However, these changes should be stable, so I'd like to incrementally merge into master so that it does not come all at once.