Commit graph

72 commits

Author SHA1 Message Date
Fernando S
4e0c4e9929 Merge pull request #8172 from bunnei/kernel-mutex
hle: kernel: Use std::mutex instead of spin locks for most kernel locking.
2022-04-16 00:05:04 +02:00
bunnei
74c36ad85f core: hle: service: Allocate a service thread. 2022-04-11 21:13:40 -07:00
tech-ticks
53f7a78e9e hle: kernel: Invalidate entire icache in UnmapProcessMemory and UnmapCodeMemory (fixes #8174) 2022-04-09 13:29:19 +02:00
ameerj
22e01068e1 core: Reduce unused includes 2022-03-19 02:23:32 -04:00
bunnei
86eaedbf19 hle: service: ldr: Use deterministic addresses when mapping NROs.
- Instead of randomization, choose in-order addresses for where to map NROs into memory.
- This results in predictable behavior when debugging and consistent behavior when reproducing issues.
2022-03-08 17:38:20 -08:00
bunnei
d45b65b4d9 hle: kernel: k_page_table: Update SetProcessMemoryPermission. 2022-01-11 16:28:11 -08:00
bunnei
7526489b8b hle: service: ldr: UnmapCodeMemory BSS only when set. 2022-01-11 16:28:11 -08:00
bunnei
84a61db25b hle: kernel: k_page_table: ReadAndWrite -> UserReadWrite. 2022-01-11 16:28:11 -08:00
bunnei
0942533d2f hle: kernel: k_page_table: Rename *ProcessCodeMemory -> *CodeMemory. 2022-01-11 16:28:11 -08:00
Morph
d9bfc2d546 kernel: KPageTable: Rename SetCodeMemoryPermission to SetProcessMemoryPermission 2021-11-20 22:18:56 -05:00
Morph
41a0c088ba general: Get the current process program id directly from the system
This allows us to avoid including KProcess' header file in files that only need to get the current process' program id.
2021-11-04 16:59:39 -04:00
Morph
10508e7af2 general: Rename GetTitleID to GetProgramID 2021-11-04 16:57:16 -04:00
Morph
fddd57db61 general: Remove MakeResult helpers
This is made obsolete by the presence of implicit constructors.
2021-11-02 17:23:19 -04:00
Morph
7ebc38a6d1 general: Replace RESULT_SUCCESS with ResultSuccess
Transition to PascalCase for result names.
2021-06-02 00:39:27 -04:00
bunnei
80460d421e Merge pull request #6266 from bunnei/kautoobject-refactor
Kernel Rework: Migrate kernel objects to KAutoObject
2021-05-07 23:30:17 -07:00
Lioncash
6890201733 ldr: Simplify memory copy within LoadNro()
We can use the dedicated memory function for performing copies instead
of reading into a temporary buffer and then immediately writing it back
out to memory.

Eliminates a bit of heap memory churn.
2021-05-06 19:18:14 -04:00
bunnei
ad048de3d6 hle: kernel: Rename Process to KProcess. 2021-05-05 16:40:52 -07:00
german77
da6fd04f92 ldr: Use proper names 2021-04-08 19:40:25 -06:00
bunnei
5dbcaa2970 hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
bunnei
a4c5e6d964 hle: kernel: Migrate to KMemoryBlock, KMemoryBlockManager, and others. 2021-02-18 16:16:25 -08:00
bunnei
f82b15089b hle: kernel: KSystemControl does not belong in Memory namespace. 2021-02-18 16:16:24 -08:00
Chloe
e62886ead0 kernel: Unify result codes (#5890)
* kernel: Unify result codes

Drop the usage of ERR_NAME convention in kernel for ResultName. Removed seperation between svc_results.h & errors.h as we mainly include both most of the time anyways.

* oops

* rename errors to svc_results
2021-02-12 15:43:01 -08:00
bunnei
a5b73195c9 core: arm: Implement InvalidateCacheRange for CPU cache invalidation. 2020-11-29 01:31:52 -08:00
Lioncash
346271b80b service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
2020-11-26 20:03:11 -05:00
Lioncash
e7fe020ace ipc_helpers: Remove usage of the global system instance
Resolves numerous deprecation warnings throughout the codebase due to
inclusion of this header. Now building core should be significantly less
noisy (and also relying on less global state).

This also uncovered quite a few modules that were relying on indirect
includes, which have also been fixed.
2020-11-08 15:58:11 -05:00
bunnei
4c09a6399c hle: service: ldr: Implement UnloadNrr.
- Used by Final Fantasy X/X-2 HD Remaster.
2020-10-31 01:22:53 -07:00
Lioncash
c7b6027f34 core: Fix clang build pt.3
Should finally resolve building with clang.
2020-10-21 22:14:23 -04:00
bunnei
deb3536936 Revert "core: Fix clang build" 2020-10-20 19:07:39 -07:00
Lioncash
18636013c9 core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.

Fixes #4795
2020-10-17 19:50:39 -04:00
Lioncash
78ff298d6d service/ldr: Resolve sign mismatch warnings
We were performing an int < size_t comparison. We can just correct the
type of the induction variable.
2020-08-03 11:48:16 -04:00
David Marcec
3804c6d1c0 ldr: Cleanup NRO & NRR structs 2020-06-28 20:54:37 +10:00
VolcaEM
8cd49f28a3 Move SHA256Hash to its original position
It's not needed to have it in its previous position anymore
2020-06-18 15:45:47 +02:00
VolcaEM
85a247d6cf Remove unnecessary pragmas 2020-06-16 20:28:44 +02:00
VolcaEM
1f2f16c656 Revert IsValidNRO refactor but make it more readable 2020-06-16 20:24:58 +02:00
VolcaEM
18b88119d2 Update assert string 2020-06-16 15:57:02 +02:00
VolcaEM
68a7d8fb09 Clang-format again 2020-06-14 19:41:28 +02:00
VolcaEM
26b0ef5ce0 Use consistent variable names 2020-06-14 19:37:44 +02:00
VolcaEM
a01b0de19a Clang-format 2020-06-14 19:34:58 +02:00
VolcaEM
2ae60c8949 Make assert strings consistent 2020-06-14 19:30:08 +02:00
VolcaEM
f801c273eb Attempt to fix crashes in SSBU and refactor IsValidNRO 2020-06-14 19:28:39 +02:00
VolcaEM
50bf4c70cd Address review comments 2020-06-02 17:54:10 +02:00
VolcaEM
6f126bb803 Add comment to nrr_kind
According to Atmosphére (c7026b9094/libraries/libstratosphere/include/stratosphere/ro/ro_types.hpp), nrr_kind (Atmosphére calls it "type") is 7.0.0+
2020-05-31 19:12:09 +02:00
VolcaEM
9390c0c271 ldr: Update NRR/NRO structs
This was based on Switchbrew pages:

https://switchbrew.org/wiki/NRR

https://switchbrew.org/wiki/NRO
2020-05-31 18:49:51 +02:00
Lioncash
d73e0ef309 service: Update function tables
Keeps the service function tables up to date.

Updated based off information on SwitchBrew.
2020-04-20 15:53:49 -04:00
bunnei
4cdbd44f51 core: hle: Address various feedback & code cleanup.
- Should be no functional changes.
2020-04-17 00:59:36 -04:00
bunnei
0707404f34 service: ldr: Updates for new VMM.
- Includes removing some service impls. that are untested.
2020-04-17 00:59:35 -04:00
bunnei
7ee7aa21b1 services: ldr: Fix MemoryState for read/write regions of NROs.
- Fixes #3541, used by Final Fantasy VIII Remastered.
2020-03-26 15:52:59 -04:00
Lioncash
cc3d6fdf73 core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory class
With all of the trivial parts of the memory interface moved over, we can
get right into moving over the bits that are used.

Note that this does require the use of GetInstance from the global
system instance to be used within hle_ipc.cpp and the gdbstub. This is
fine for the time being, as they both already rely on the global system
instance in other functions. These will be removed in a change directed
at both of these respectively.

For now, it's sufficient, as it still accomplishes the goal of
de-globalizing the memory code.
2019-11-26 21:55:39 -05:00
Lioncash
4c6cd8b9e8 core: Migrate off deprecated mbedtls functions
These functions are marked for deprecation and it's recommended that the
*_ret variants be used instead.
2019-11-12 08:45:56 -05:00
Lioncash
e4e4af80e8 hle/service: Replace global system instance calls with instance-based ones
Migrates the HLE service code off the use of directly accessing the
global system instance where trivially able to do so.

This removes all usages of Core::CurrentProcess from the service code,
only 8 occurrences of this function exist elsewhere. There's still quite
a bit of "System::GetInstance()" being used, however this was able to
replace a few instances.
2019-10-06 13:42:23 -04:00