Commit Graph

61 Commits (cdfe665a2108fee226d6ab0cca29dec508214de3)

Author SHA1 Message Date
bunnei 4fcdbed9f6 Thread: Wait current thread on svc_SleepThread
- Removed unused VBLANK sleep mode
- Added error log for bad context switch
- Renamed VerifyWait to CheckWaitType to be more clear
10 years ago
Yuri Kunde Schlesner adee775f44 Kernel: Implement support for current thread pseudo-handle
This boots a few (mostly Nintendo 1st party) games further.
10 years ago
Yuri Kunde Schlesner 0600e2d8b5 Convert old logging calls to new logging macros 10 years ago
bunnei 3a75c8069e Merge pull request #256 from Subv/mutex
Kernel/Mutex: Properly lock the mutex when a thread enters it
10 years ago
bunnei dd203f7068 Thread: Fixed to wait on address when in arbitration. 10 years ago
Subv 64128aa61a Mutex: Release all held mutexes when a thread exits. 10 years ago
Subv 6fac2bf0ab Threads: Remove a redundant function.
Use the next_thread_id variable directly.
11 years ago
Subv ef1d5cda06 Threads: Implemented a sequential thread id 11 years ago
Subv 029ff9f1fd SVC: Implemented GetThreadId.
For now threads are using their Handle value as their Id, it should not really cause any problems because Handle values are unique in Citra, but it should be changed. I left a ToDo there because this is not correct behavior as per hardware.
11 years ago
bunnei de851ba1a1 Thread: Check that thread is actually in "wait state" when verifying wait. 11 years ago
Yuri Kunde Schlesner 8189593255 Use pointers instead of passing handles around in some functions. 11 years ago
Yuri Kunde Schlesner 22c86824a4 Remove duplicated docs/update them for changed parameters. 11 years ago
Yuri Kunde Schlesner c2588403c0 HLE: Revamp error handling throrough the HLE code
All service calls in the CTR OS return result codes indicating the
success or failure of the call. Previous to this commit, Citra's HLE
emulation of services and the kernel universally either ignored errors
or returned dummy -1 error codes.

This commit makes an initial effort to provide an infrastructure for
error reporting and propagation which can be use going forward to make
HLE calls accurately return errors as the original system. A few parts
of the code have been updated to use the new system where applicable.

One part of this effort is the definition of the `ResultCode` type,
which provides facilities for constructing and parsing error codes in
the structured format used by the CTR.

The `ResultVal` type builds on `ResultCode` by providing a container for
values returned by function that can report errors. It enforces that
correct error checking will be done on function returns by preventing
the use of the return value if the function returned an error code.

Currently this change is mostly internal since errors are still
suppressed on the ARM<->HLE border, as a temporary compatibility hack.
As functionality is implemented and tested this hack can be eventually
removed.
11 years ago
bunnei c0cd0fa78e Merge pull request #211 from linkmauve/master
Remove trailing spaces from the entire project
11 years ago
Emmanuel Gil Peyrot f5d38649c7 Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated 11 years ago
Lioncash 7cbecde2ca Add static to some variables 11 years ago
Yuri Kunde Schlesner d72708c1f5 Add `override` keyword through the code.
This was automated using `clang-modernize`.
11 years ago
archshift 6e606c515f core: Prune redundant includes 11 years ago
bunnei 304999dfeb Threading: Fix thread starting to execute first instruction correctly. 11 years ago
Lioncash 98fa3f7cba Core: Alter the kernel string functions to use std::string instead of const char*.
Most functions already operate on std::strings. This also removes the need to manually null terminate thread names.
11 years ago
bunnei d4bd2f2e5d Thread: Added more descriptive comment to WaitCurrentThread. 11 years ago
bunnei ba840d3200 Thread: Added functions to resume threads from address arbitration.
Thread: Cleaned up arbitrate address functions.

Thread: Cleaned up ArbitrateAllThreads function.
11 years ago
bunnei b62ef4bbd2 Thread: Renamed occurrences of "t" to "thread" to improve readability. 11 years ago
bunnei 5b7cf50a77 Thread: Cleaned up VerifyWait, fixed issue where nullptr msg could unnecessarily be logged. 11 years ago
bunnei 4620e2a741 HLE: Removed usnused EatCycles function. 11 years ago
bunnei bfdd874b1f Thread: Moved position of * in arguments. 11 years ago
bunnei 12e2a59565 Thread: Updated VerifyWait to be more readable (but functionally the same). 11 years ago
bunnei c95972275e HLE: Updated all uses of NULL to nullptr (to be C++11 compliant) 11 years ago
bunnei d7363322c7 HLE: Updated various handle debug assertions to be more clear. 11 years ago
bunnei 8cac527c94 Kernel: Updated several member functions to be const 11 years ago
bunnei b774b8b04e Thread: Fixed bug with ResetThread where cpu_registers[15] was being incorrectly set 11 years ago
bunnei aae9fcf4a4 Kernel: Made SyncRequest not pure virtual, with a default implementation of error (as this is not required for all kernel objects) 11 years ago
bunnei f5c7c15434 Kernel: Added real support for thread and event blocking
- SVC: Added ExitThread support
- SVC: Added SignalEvent support
- Thread: Added WAITTYPE_EVENT for waiting threads for event signals
- Thread: Added support for blocking on other threads to finish (e.g. Thread::Join)
- Thread: Added debug function for printing current threads ready for execution
- Thread: Removed hack/broken thread ready state code from Kernel::Reschedule
- Mutex: Moved WaitCurrentThread from SVC to Mutex::WaitSynchronization
- Event: Added support for blocking threads on event signalling

Kernel: Added missing algorithm #include for use of std::find on non-Windows platforms.
11 years ago
bunnei 3fb31fbc57 svc: added GetThreadPriority and SetThreadPriority, added (incomplete) DuplicateHandle support 11 years ago
bunnei 10447d1f48 kernel: changed main thread priority to default, updated Kernel::Reschedule to use PrepareReschedule 11 years ago
bunnei ba98e25e97 thread: updated Reschedule to sit at a synchronization barrier when no other threads are ready for execution 11 years ago
bunnei a432dc8f39 kernel: added WaitSynchronization method to Kernel::Object 11 years ago
bunnei 58a3adcdd2 kernel: updated SyncRequest to take boolean thread wait result as a parameter 11 years ago
bunnei d73d782ba7 kernel: add a SyncRequest method to KernelObject for use with svcSendSyncRequest 11 years ago
bunnei b99ac2c3d6 thread: renamed "WaitCurThread" to "WaitCurrentThread", removed unused "reason" argument 11 years ago
bunnei 7c0b006076 thread: removed unused SwitchContext/Reschedule reason field, added missing arg parameter to SVC CreateThread 11 years ago
bunnei d26f3d4c1f kernel: refactored function naming to remove "__" prefix 11 years ago
bunnei 14bd37c5dc thread: moved ThreadStatus/WaitType to header, added support for arg on CreateThread, added correct CPSR reset 11 years ago
bunnei 6a78be5930 thread: fixed bug where result of __NextThread was not being properly checked when NULL 11 years ago
bunnei 203541da11 thread: added correct lowest thread priority, added a thread priority check, and added some comments 11 years ago
bunnei bed4e920fa thread: exposed ResumeThreadFromWait function for use in other kernel modules 11 years ago
bunnei 75c6d2a8fa thread: moved threading calls to the Kernel namespace 11 years ago
bunnei 49dc2ce8ac ARM_Interface: added SaveContext and LoadContext functions for HLE thread switching 11 years ago
bunnei 143bba2045 renamed "syscall" module to "svc" (more accurate naming) 11 years ago
bunnei f654a03f1f thread: whitespace change - fixed * and & placement 11 years ago