Commit Graph

73 Commits

Author SHA1 Message Date
Michael Scire
7042cd28a1 kern: refactor priority inheritance to represent locks as C++ objects 2023-02-23 09:00:32 -07:00
Michael Scire
a3cbed96d0 kern: update for new exception flag semantics 2022-10-12 09:15:51 -07:00
Michael Scire
9fc57cbbbb kern: move SecureAppletMemory/KPageBuffer heap into the ResourceRegion 2022-10-12 09:15:50 -07:00
Michael Scire
8022175f5f kern: implement revised IPI/SGI semantics 2022-03-23 09:16:07 -07:00
Michael Scire
d066ac3d69 kern: update for new hw maintenance semantics 2022-03-23 09:16:06 -07:00
Michael Scire
f38d589516 kern: implement new thread context/fpu semantics 2022-03-23 09:16:06 -07:00
SciresM
00203fd7c3 Integrate new result macros. (#1780)
* result: try out some experimental shenanigans

* result: sketch out some more shenanigans

* result: see what it looks like to convert kernel to use result conds instead of guards

* make rest of kernel use experimental new macro-ing
2022-03-23 09:15:40 -07:00
Léo Lam
2916512fb7 Minor header fixes to reduce parsing issues with Clang (#1700)
* Work around Clang's incomplete C++20 support for omitting typename

* vapours: fix Clang error about missing return in constexpr function

* stratosphere: fix call to non-constexpr strlen in constexpr function

strlen being constexpr is a non-compliant GCC extension; Clang
explicitly rejects it: https://reviews.llvm.org/D23692

* stratosphere: add a bunch of missing override specifiers

* stratosphere: work around Clang consteval bug

Minimal example: https://godbolt.org/z/MoM64v93M

The issue seems to be that Clang does not consider f(x) to be a
constant expression if x comes from a template argument that isn't
a non-type auto template argument (???)

We can work around this by relaxing GetMessageHeaderForCheck (by using
constexpr instead of consteval). This produces no functional changes
because the result of GetMessageHeaderForCheck() is assigned to a
constexpr variable, so the result is guaranteed to be computed
at compile-time.

* stratosphere: fix missing require clauses in definitions

GCC not requiring the require clauses to be repeated for member
definitions is actually a compiler bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96830

Clang rejects declarations with missing require clauses.

* Fix ALWAYS_INLINE_LAMBDA and parameter list relative order

While GCC doesn't seem to care about the position of the always_inline
attribute relative to the parameter list, Clang is very picky
and requires the attribute to appear after the parameter list
(and before a trailing return type)

* stratosphere: fix static constexpr member variable with incomplete type

GCC accepts this for some reason (because of the lambda?) but Clang
correctly rejects this.
2021-11-30 16:34:43 -08:00
Michael Scire
17ceca9140 kern: fix minor assembly bugs, avoid unnecessary function call in KScheduler hotloop 2021-10-29 17:47:13 -07:00
Michael Scire
1713d12946 kern: devirtualize KReadableEvent::Reset, KWorkerTask::DoWorkerTask 2021-10-26 01:11:15 -07:00
Michael Scire
6dbdfa0384 kern: use optimized red black tree finds for remaining holdouts 2021-10-26 01:11:14 -07:00
Michael Scire
7749ecabc4 kern: devirtualize several KAutoObject functions 2021-10-26 01:11:14 -07:00
SciresM
823c0df6b9 kern: avoid constexpr init for many objects (avoids unnecessary memory clear) (#1668) 2021-10-26 01:11:13 -07:00
Michael Scire
00353a05e9 kern: use new AtomicRef, use Atomic<bool> 2021-10-26 01:11:13 -07:00
Michael Scire
0d1ec0739f util: better match true std::atomic semantics 2021-10-26 01:11:13 -07:00
Michael Scire
d3b358bbb9 kern/util: use custom atomics wrapper to substantially improve codegen 2021-10-26 01:11:12 -07:00
Michael Scire
573769303b kern: update scheduler for 13.0.0 change, fix some ctz/clz bugs 2021-10-26 01:11:11 -07:00
Michael Scire
2827f6300e kern: fix use of plr vs plr_heap, fix close/unlock order in ArbitrateLock 2021-10-26 01:11:11 -07:00
Michael Scire
05c7ba6439 kern/util: update structure layouts to match Nintendo (saves 0x10 per KThread/KSession) 2021-10-26 01:11:09 -07:00
Michael Scire
3b5f56ab9f ams: replace most remaining operator & with std::addressof 2021-10-15 23:54:34 -07:00
Michael Scire
002422d5dc ams: the copyright^H^H^H^H^H^H^Hmplex plane is the algebraic closure of the reals 2021-10-07 23:06:25 -07:00
Michael Scire
993ffbfdcd kern: unify all waiting semantics to use single api 2021-09-19 10:35:39 -07:00
Michael Scire
d8e35f2277 exo/meso: update for gcc 11 compatibility 2021-04-29 03:04:54 -07:00
Michael Scire
0162133f1e kern: update pinning semantics for terminating threads 2021-04-11 03:59:19 -07:00
Michael Scire
7c35303c62 kern: KAutoObject destruction is now scheduled for next dpc-time 2021-04-11 03:59:16 -07:00
Michael Scire
ec7e3fb07f kern: update process/thread for new running/termination semantics 2021-04-11 03:59:10 -07:00
Michael Scire
d31612974a kern: update kernel waiter management rules 2021-04-11 03:59:09 -07:00
Michael Scire
f11f6ec313 kern: update pinned thread priority rules 2021-04-11 03:59:09 -07:00
Michael Scire
e40ccfb4ca kern: add new checks to SetThreadPriority/CoreMask 2021-04-11 03:59:08 -07:00
Michael Scire
ca5e69f16d kern: greatly improve codegen for atomics, scheduler 2021-01-13 10:41:26 -08:00
Michael Scire
4ddacf3384 kern: refactor to use m_ for member variables 2020-12-19 10:21:52 -08:00
Michael Scire
a7b7dd1257 kern: add debug thread dump 2020-12-11 03:49:00 -08:00
Michael Scire
9d51004a9b kern: fix bugs caused by UB + transition to -Os 2020-12-02 06:53:19 -08:00
Michael Scire
0eb6e0a963 kern: add new overflow checks on KMemoryRegions 2020-12-02 06:53:17 -08:00
Michael Scire
e4774a2685 kern: implement 64-virtual-core interface 2020-12-02 06:53:15 -08:00
Michael Scire
a57c7f7a48 kern: cleanup KThread, optimize/normalize KThreadQueue/KWaitObject 2020-12-02 06:53:14 -08:00
Michael Scire
a01f7ab1c9 kern: improve KSynchronizationObject, kill KSynchronization 2020-12-02 06:53:14 -08:00
Michael Scire
0c73792282 kern: Kill KCoreLocalRegion 2020-12-02 06:53:12 -08:00
Michael Scire
1007d8756a kern: correct thread termination atomicity 2020-09-07 10:51:44 -07:00
Michael Scire
6f177e3e84 kern: fix missing scheduler updates in KLightLock/Exception, fix RequestScheduleOnInterrupt 2020-09-07 10:51:38 -07:00
Michael Scire
ff9d3ee1d6 kern: SvcGetDebugThreadParam 2020-08-01 15:31:45 -07:00
Michael Scire
bb044b1934 kern: clean up majority of TODOs 2020-08-01 15:31:44 -07:00
Michael Scire
83020ce2c4 kern: SvcGetThreadList 2020-08-01 15:31:41 -07:00
Michael Scire
e8021705d8 kern: SendSyncRequestLight, ReplyAndReceiveLight 2020-08-01 15:31:37 -07:00
Michael Scire
c64e490663 kern: implement SvcGetThreadContext3 2020-08-01 15:31:35 -07:00
Michael Scire
2cee81697c kern: correct behavior when setting activity/core mask for pinned thread 2020-08-01 15:31:35 -07:00
Michael Scire
be1314cb88 kern: implement thread pinning/SvcSynchronizePreemptionState 2020-08-01 15:31:34 -07:00
Michael Scire
e096d11e3a kern: fix assertion in KThread::(Try)Suspend 2020-08-01 15:31:33 -07:00
Michael Scire
10415aefee kern: SvcUnmapPhysicalMemory, cleanup thread pinning 2020-08-01 15:31:31 -07:00
Michael Scire
4c5bab3a5b kern: fix resource leak bugs 2020-08-01 15:31:29 -07:00