Commit graph

27 commits

Author SHA1 Message Date
Yuri Kunde Schlesner 64ecf81a3c Kernel: Move WaitObject to a separate file
Now that HandleTable doesn't directly depend on WaitObject anymore, this
can be separated from the main kernel.h header.
2017-05-29 16:16:46 -07:00
bunnei 84d72fd92f Merge pull request #2397 from Subv/pulse
Kernel: Implemented Pulse event and timers.
2017-01-10 10:45:00 -05:00
Subv e52ca85711 Kernel: Implemented Pulse event and timers.
Closes #1904
2017-01-05 13:06:17 -05:00
Subv e6a7723f2f Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.
This will be useful when implementing mutex priority inheritance.
2017-01-04 15:58:45 -05:00
wwylele 85a83158fb move ResetType to kernel.h 2016-09-22 13:52:52 +08:00
Emmanuel Gil Peyrot ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
Lioncash 856a1d0386 svc: Move ResetType enum to the kernel event header 2016-03-12 21:47:41 -05:00
Yuri Kunde Schlesner d9556912b4 Kernel: Remove unused member from Event 2015-07-11 23:49:51 -03:00
Yuri Kunde Schlesner 88a4a808c6 Kernel: Stop creating useless Handles during object creation
They're finally unnecessary, and will stop cluttering the application's
handle table.
2015-02-02 15:37:09 -02:00
Yuri Kunde Schlesner 7725256f64 Explicitly instantiate constructors/destructors for Kernel objects
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.)
2015-02-02 15:37:07 -02:00
Yuri Kunde Schlesner d917a9bf77 Kernel: Mark all appropriate kernel objects as "final" 2015-01-30 11:49:46 -02:00
Yuri Kunde Schlesner d52d859936 Kernel: Convert Event to not use Handles 2015-01-30 11:49:43 -02:00
bunnei e4a5d8ad4f Event: Fixed some bugs and cleanup (Subv) 2015-01-21 18:43:50 -05:00
bunnei 14cbbf4d9b Event: Get rid of permanent_lock hack. 2015-01-21 18:42:04 -05:00
purpasmart96 ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Yuri Kunde Schlesner 22c86824a4 Remove duplicated docs/update them for changed parameters. 2014-11-24 17:08:36 -02:00
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.
2014-11-24 17:08:36 -02:00
Emmanuel Gil Peyrot f5d38649c7 Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated 2014-11-19 09:03:07 +00:00
bunnei 5365ca157d Kernel: Updated various kernel function "name" arguments to be const references. 2014-06-13 09:51:12 -04:00
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.
2014-06-13 09:51:02 -04:00
bunnei b78aff8585 svc: added optional name field to Event and Mutex (used for debugging) 2014-06-02 20:38:34 -04:00
bunnei f7cececc5c event: added a hackish ability to set an event as "locked" to its current state, cleaned up some comments 2014-06-01 10:33:55 -04:00
bunnei d51c84dde2 event: added support for ClearEvent, fixed a bug with CreateEvent, fixed some comments 2014-05-29 20:00:44 -04:00
bunnei ea8627d536 event: fixed typos and updated CMakeLists 2014-05-27 22:14:38 -04:00
bunnei beea6f054a event: added SetEventLocked method to change status an events lock 2014-05-27 22:14:00 -04:00
bunnei fd69fd0325 kernel: added event module to support creation of CTR "Event" objects 2014-05-27 20:16:13 -04:00