Commit Graph

97 Commits

Author SHA1 Message Date
Michael Scire
52e51c0634 kern: implement additional randomness in KPageHeap allocations 2022-03-23 09:16:05 -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
SciresM
823c0df6b9 kern: avoid constexpr init for many objects (avoids unnecessary memory clear) (#1668) 2021-10-26 01:11:13 -07:00
Michael Scire
390ce66da1 svc: refactor/rename MemoryInfo fields 2021-10-07 23:06:28 -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
ecb607bade kern/svc: implement IoPool/Region svc support 2021-09-19 10:35:39 -07:00
Michael Scire
b579a6d75e svc/kern/dd: remove MapDeviceAddressSpace() 2021-09-19 10:35:39 -07:00
Michael Scire
f103b6876b kern: KMemoryManager/KPageGroup use physical addresses instead of virtual, now 2021-09-19 10:35:38 -07:00
Michael Scire
1ac249dd13 kern: support dynamic resource expansion for system heaps/events/sessions. 2021-09-19 10:35:38 -07:00
Michael Scire
22bb619873 kern: add new KMemoryState 2021-09-19 10:35:37 -07:00
Michael Scire
e9d44eb71a kern: fuck the KPolice^H^H^H^H^H^HPageGroups 2021-04-11 03:59:20 -07:00
Michael Scire
3ebf91304e kern: update Initialize0 for new changes 2021-04-11 03:59:15 -07:00
Michael Scire
2b10401498 kern: if a page table region is zero-size, nothing overlaps it 2021-04-11 03:59:13 -07:00
Michael Scire
50ce41adf2 kern: use KScopedLightLockPair helper for page table pair-locks 2021-04-11 03:59:12 -07:00
Michael Scire
43900d4765 kern: track mapped ipc server memory in page table 2021-04-11 03:59:12 -07:00
Michael Scire
8df6062a1d kern: add KPageTableBase::Read/WriteDebugIoMemory 2021-04-11 03:59:12 -07:00
Michael Scire
a9f81928f7 kern: flush memory before reading in KPageTableBase::ReadDebugMemory 2021-04-11 03:59:11 -07:00
Michael Scire
6eda131ab6 kern: update KMemoryBlockManagerUpdaterAllocator for new ctor/init semantics 2021-04-11 03:59:11 -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
eb621c6aae kern: implement memory debug 2020-12-11 03:49:02 -08:00
Michael Scire
de5341ecde kern: fix inverted conditional in UnmapProcessCodeMemory 2020-12-03 12:48:16 -08:00
Michael Scire
9586142e90 kern: tweak optimization settings for hot paths 2020-12-02 06:53:22 -08:00
Michael Scire
b9504f356f microkernel: hot paths are pretty fucking hot 2020-12-02 06:53:20 -08:00
Michael Scire
0eb6e0a963 kern: add new overflow checks on KMemoryRegions 2020-12-02 06:53:17 -08:00
Michael Scire
f8999a2318 kern: remove KPageTableBase::MakeAndOpenContiguousPageGroup 2020-12-02 06:53:10 -08:00
Michael Scire
397d317a6c kern: implement DisableDeviceAddressSpaceMerge 2020-12-02 06:53:10 -08:00
Michael Scire
396dc066e9 kern: KMemoryManager::Allocate -> AllocateAndOpen 2020-12-02 06:53:09 -08:00
Michael Scire
1260d85bb9 kern: implement kmemoryblock/kmemoryinfo merge disable 2020-12-02 06:53:09 -08:00
Michael Scire
dd799d3909 kern: remove KMemoryAttribute_AnyLocked 2020-12-02 06:53:09 -08:00
Michael Scire
f152b16639 kern: update KMemoryBlockManagerUpdateAllocator api 2020-12-02 06:53:09 -08:00
Michael Scire
5f885a3b22 kern: implement new software-reserved page table bits 2020-12-02 06:53:08 -08:00
Michael Scire
394112f9ac kern: update KPageTableBase for new disable-merge attrs 2020-12-02 06:53:08 -08:00
Michael Scire
f02868d886 kern: simplify SetupForIpcClient cleanup 2020-09-07 10:51:41 -07:00
Michael Scire
4cafc6acb9 kern: rename CacheHelper operation for accuracy 2020-09-07 10:51:40 -07:00
Michael Scire
23864afe32 kern: KPageTableBase::WriteDebugMemory stores/invalidates cache 2020-09-07 10:51:40 -07:00
Michael Scire
f0b455de83 kern: refactor KMemoryLayout 2020-09-07 10:51:39 -07:00
Michael Scire
dc59a2d2e5 kern: build with -Wextra 2020-09-07 10:51:36 -07:00
Michael Scire
bb044b1934 kern: clean up majority of TODOs 2020-08-01 15:31:44 -07:00
Michael Scire
c7f108082b kern: resolve MESOSPHERE_UNIMPLEMENTEDs other than UserException 2020-08-01 15:31:44 -07:00
Michael Scire
a5d7e8328b kern: SvcQueryPhysicalAddress 2020-08-01 15:31:42 -07:00
Michael Scire
ef6ede3aeb kern: SvcReadDebugProcessMemory, SvcWriteDebugProcessMemory 2020-08-01 15:31:40 -07:00
Michael Scire
fcee459e40 kern: add KCodeMemory code left out of previous commit 2020-08-01 15:31:36 -07:00
Michael Scire
a7de710f09 kern: implement KCodeMemory (and SVCs) 2020-08-01 15:31:36 -07:00
Michael Scire
6935929c33 kern: SvcMapPhysicalMemoryUnsafe, SvcUnmapPhysicalMemoryUnsafe 2020-08-01 15:31:33 -07:00
Michael Scire
a56e8ca4b0 kern: General system stability improvements to enhance the user's experience. 2020-08-01 15:31:32 -07:00
Michael Scire
10415aefee kern: SvcUnmapPhysicalMemory, cleanup thread pinning 2020-08-01 15:31:31 -07:00
Michael Scire
dc8fccd168 kern: implement SvcMapPhysicalMemory 2020-08-01 15:31:31 -07:00
Michael Scire
16ce69e333 kern: SvcInvalidateProcessDataCache 2020-08-01 15:31:30 -07:00