Commit Graph

62 Commits

Author SHA1 Message Date
5a7f615da1 kernel: Update to use atmosphere macros and correct Result (#7242)
* kernel: Switch to atmosphere style macros

* code: Rename ResultCode to Result

* code: Result constants are lower case

* Address review comments

* core: Remove CASCADE_CODE

* R_TRY replaces completely

* core: Run clang format
2023-12-31 09:01:40 -08:00
59df319f48 kernel: Improve accuracy of KResourceLimit emulation (#7221)
* core: Refactor resource limits

* svc: Implement SetResourceLimitLimitValues

* Also correct existing name and add missing error codes
2023-12-04 13:31:06 +02:00
998b9a9525 kernel: Add ticks to low priority threads that arbitrate zero threads (#7096) 2023-11-05 00:20:55 +02:00
7edc86a9bc code: Remove outdated comment style (#6640) 2023-06-25 15:22:41 +05:30
da908a9ed1 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-29 06:39:21 +01:00
6783289909 CR actions 2020-04-20 16:30:49 +01:00
55c9162d02 Clean up the Callback (don't store a shared_ptr to parent) 2020-04-20 16:29:50 +01:00
c5a3bf9728 Fix clang format 2020-04-18 15:14:01 +01:00
1fb3c9f08c Fix Address Arbiter serialization 2020-04-18 15:10:54 +01:00
116d22d562 Refactor out the wakeup_callback function pointer 2020-02-13 17:42:05 +08:00
7b846ffa98 clang-format fixes 2020-02-13 17:39:15 +08:00
6917eaf53b Use load_construct_data for kernel objects 2020-02-13 17:38:25 +08:00
3e752002c4 Replace g_kernel with Core::Global etc. 2020-02-13 17:38:21 +08:00
5035e68dad Added derived kernel objects 2020-02-13 17:38:15 +08:00
5f11c5f733 Kernel: replace boost::intrusive_ptr with std::shared_ptr 2019-03-24 14:32:11 -04:00
323990d402 Memory: move Read/Write8/16/32/64 and ReadCString into class 2018-12-05 20:21:14 -05:00
751ebe55e9 Kernel: pass ref down to Object and wrap ID counter into kernel state 2018-10-18 21:41:36 -04:00
734be98966 Kernel: pass Kernel reference into AddressArbiter 2018-10-18 21:41:00 -04:00
3ee9f669c1 Address review comments 2018-09-21 16:39:10 +02:00
5dfa7b74b5 thread: Convert ThreadStatus into an enum class
Makes the thread status strongly typed, so implicit conversions can't
happen. It also makes it easier to catch mistakes at compile time.
2018-09-15 17:02:44 +02:00
7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
a8110cfd3f hle/kernel: Migrate logging macros 2018-06-22 18:54:50 -04:00
8c16b90eae HLE/AddressArbiter: Remove threads that were awoken by timeout from the arbiter's waitlist when using WaitIfLessThanWithTimeout and DecrementAndWaitIfLessThanWithTimeout.
Fixes a regression introduced in #3096
2017-12-06 09:06:45 -05:00
c68adb787b Kernel/Arbiters: When doing ArbitrateAddress(Signal), always pick the highest priority thread, using the first one that was put to sleep if more than one thread with the same highest priority exists.
This is consistent with hardware behavior as shown by this test https://gist.github.com/ds84182/40e46129bd38b46a5100f15f96ba5eaf
2017-11-08 18:47:08 -05:00
499508389c core: clear format warnings 2017-11-01 12:35:32 +02:00
2cdb40d709 Kernel: Centralize error definitions in errors.h 2017-05-24 21:06:00 -07:00
4fc8b8229e core: Remove HLE module, consolidate code & various cleanups. 2016-12-21 23:48:13 -05:00
8634b8cb83 Threading: Reworked the way our scheduler works.
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.
2016-12-03 22:38:14 -05:00
84fbbe2629 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00
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
396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
29032ce9b6 SVC: Fixed ArbitrateAddress to behave as it does on hardware.
This was verified with hwtests that i plan to upload later on.
2015-12-27 18:44:42 -05:00
0b7d2941cf Kernel: Move reschedules from SVCs to actual mechanisms that reschedule. 2015-05-20 18:05:47 -04:00
7ada357b2d Memmap: Re-organize memory function in two files
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.
2015-05-15 00:04:38 -03:00
e1fbac3ca1 Common: Remove common.h 2015-05-07 15:45:22 -03:00
c077bcefa9 SVC: Update various SVCs to cause a reschedule.
- CreateMutex/ReleaseMutex/ReleaseSemaphore/SetTimer/CancelTimer/ArbitrateAddress
2015-04-09 19:06:42 -04:00
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
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
664c79ff47 Thread: Modernize two functions that slipped through previous rebases 2015-02-02 15:37:01 -02:00
38e7122f23 Kernel: Convert AddressArbiter to not use Handles 2015-01-30 11:47:06 -02:00
9a345de2bd Kernel: Remove useless/duplicated comments; mark functions static 2015-01-30 11:47:01 -02:00
254e4ebd58 AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that made no sense. 2015-01-21 20:47:45 -05:00
7faf2d8e06 WaitSynchronizationN: Implement return values 2015-01-21 19:09:03 -05:00
1f7a04f05a Thread: Keep track of multiple wait objects. 2015-01-21 18:42:04 -05:00
9e2ae289b8 AddrArbiter: Implement arbitration types 3 and 4. 2015-01-13 14:49:26 -05:00
8ad41775cc Kernel: Start using boost::intrusive_ptr for lifetime management 2015-01-09 19:43:52 -02:00
9bf8462b96 Thread: Reduce use of Handles and move some funcs to inside the class. 2015-01-09 04:02:15 -02:00
0276a75f24 AddressArbiter: Ported arbitration type 2 from 3dmoo.
(Thanks 3dmoo!)
2015-01-03 12:09:11 -05:00
7e2903cb74 Kernel: New handle manager
This handle manager more closely mirrors the behaviour of the CTR-OS
one. In addition object ref-counts and support for DuplicateHandle have
been added.

Note that support for DuplicateHandle is still experimental, since parts
of the kernel still use Handles internally, which will likely cause
troubles if two different handles to the same object are used to e.g.
wait on a synchronization primitive.
2014-12-28 11:52:55 -02:00