Commit graph

1336 commits

Author SHA1 Message Date
David Marcec
df001e73c2 Mark invalid IPC buffers as ASSERT_OR_EXECUTE_MSG
Previously if applications would send faulty buffers(example homebrew) it would lead to us returning uninitalized data. Switching from ASSERT_MSG to ASSERT_OR_EXECUTE_MSG allows us to have a fail safe to prevent crashes but also continue execution without introducing undefined behavior
2020-06-24 22:50:27 +10:00
MerryMage
23d63c30e1 memory_manager: Explicitly specifcy std::min<size_t> 2020-06-18 15:47:44 +01:00
bunnei
c8c4bdf3c1 Merge pull request #4069 from ogniK5377/total-phys-mem
kernel: Account for system resource size for memory usage
2020-06-14 00:44:34 -04:00
bunnei
b717bb09f2 Merge pull request #4010 from ogniK5377/reserve-always-break
kernel: ResourceLimit::Reserve remove useless while loop
2020-06-12 22:30:19 -04:00
David Marcec
97ad3cd3ee kernel: Account for system resource size for memory usage
GetTotalPhysicalMemoryAvailableWithoutSystemResource & GetTotalPhysicalMemoryUsedWithoutSystemResource seem to subtract the resource size from the usage.
2020-06-10 14:49:00 +10:00
David Marcec
07db67b406 Downgrade "handle not signaled" error to trace
clogs logs quite a bit
2020-06-04 22:27:15 +10:00
David Marcec
55b534c5a0 kernel: ResourceLimit::Reserve remove useless while loop
Timeout is a u64, it will always be >= 0
2020-05-29 13:48:01 +10:00
bunnei
58bda1c7b8 Merge pull request #3879 from lioncash/global2
hle_ipc: Eliminate core memory globals
2020-05-07 19:13:34 -04:00
bunnei
09789af434 Merge pull request #3881 from lioncash/mem-warning
kernel/memory: Resolve several compiler warnings
2020-05-05 15:41:18 -04:00
Lioncash
12b81f2581 kernel/memory: Remove #pragma once within cpp file
This isn't necessary in a cpp file and will cause warnings on clang.
2020-05-03 13:42:07 -04:00
Lioncash
0bf0d27552 kernel/memory: Remove unused includes
Prevents header churn and needing to recompile these files if these
headers are ever changed in the future.
2020-05-03 13:41:18 -04:00
Lioncash
0bb99454ed kernel/memory: Remove unused variables in memory_block_manager
Prevents unused variable warnings.
2020-05-03 13:36:20 -04:00
Lioncash
42d43335c9 kernel/memory: Make use of std::array consistently in address_space_info
This allows tuning standard library implementations to enable or disable
range checks at runtime, which is nicer for debugging.
2020-05-03 13:34:24 -04:00
Lioncash
e09098b981 kernel/memory: Resolve -Wshadow warnings
Prevents variable name clashing.
2020-05-03 13:29:42 -04:00
Lioncash
a93929b23a kernel/memory: Amend potential encoding warnings
While èis generally representable in some language encodings, in some
it isn't and will result in compilation warnings occurring. To remain
friendly with other language's codepages on Windows, we normalize it to
an ASCII e.
2020-05-03 13:01:03 -04:00
Lioncash
ccfac6d992 hle_ipc: Eliminate core memory globals
We can just pass the required instances into the constructor of the
request, eliminating all usages of the global system accessor.
2020-05-03 12:57:40 -04:00
Lioncash
918b439e26 readable_event: Remove unnecessary semicolon in Signal()
Resolves a -Wextra-semi warning.

While we're at it, we can invert the branch to form a guard clause,
unindenting all of the contained code.
2020-05-02 14:07:31 -04:00
David Marcec
4f69eb7061 kernel: Don't fail silently 2020-04-29 14:53:53 +10:00
Mat M
661193a566 Merge pull request #3783 from lioncash/pointer
physical_core: Make use of std::make_unique instead of std::make_shared in ctor
2020-04-28 21:38:02 -04:00
David Marcec
45ece975bf kernel: Bad GetInfo ids should not be marked as stubs
As we currently match hardware and don't return a successful result, these should be marked as errors instead of warnings and as stubs.
2020-04-29 01:17:59 +10:00
bunnei
01c26ad131 Merge pull request #3780 from lioncash/process
svc: Re-add MapProcessCodeMemory/UnmapProcessCodeMemory
2020-04-24 23:22:26 -04:00
Lioncash
dca9c90af3 physical_core: Make use of std::make_unique instead of std::make_shared in ctor
We can also allow unicorn to be constructed in 32-bit mode or 64-bit
mode to satisfy the need for both interpreter instances.

Allows this code to compile successfully of non x86-64 architectures.
2020-04-24 00:20:58 -04:00
Rodrigo Locatti
25bd2ba359 Merge pull request #3777 from lioncash/warn
page_table: Remove unused captures
2020-04-23 21:47:54 -03:00
Rodrigo Locatti
eef3218a82 Merge pull request #3778 from lioncash/unused-var
svc: Remove unused variable
2020-04-23 21:47:24 -03:00
Lioncash
9a5a6ebe0a shared_memory: Amend doxygen reference
Amends the parameter to match the documentation reference.

Resolves a -Wdocumentation warning with clang.
2020-04-23 18:42:14 -04:00
Lioncash
224d3c6b9d svc: Re-add MapProcessCodeMemory/UnmapProcessCodeMemory
These were lost in the re-implementation of the virtual memory manager.
2020-04-23 18:12:04 -04:00
Lioncash
2fc4351547 svc: Remove unused variable
Since the VMM refactor, this is no longer used or needed.
2020-04-23 17:53:26 -04:00
Lioncash
a881161d3c page_table: Remove unused captures
Any time the lambda function is called, the permission being used in the
capture would be passed in as an argument to the lambda, so the capture
is unnecessary.
2020-04-23 17:33:08 -04:00
bunnei
da893629a0 kernel: memory: Improve implementation of device shared memory. (#3707)
* kernel: memory: Improve implementation of device shared memory.

* fixup! kernel: memory: Improve implementation of device shared memory.

* fixup! kernel: memory: Improve implementation of device shared memory.
2020-04-23 11:37:12 -04:00
bunnei
a8a37d9d06 Merge pull request #3725 from MerryMage/fpcr
thread: FPCR.FZ is likely not 1 (and FPCR.RMode = TieAway and FPCR.DN = 0)
2020-04-22 19:49:13 -04:00
bunnei
2aacd00137 Merge pull request #3696 from lioncash/cast-size
hle_ipc: Remove std::size_t casts where applicable
2020-04-19 14:24:15 -04:00
MerryMage
5451c81b74 thread: FPCR.FZ is likely not 1 2020-04-19 08:37:20 +01:00
Lioncash
ac3ff8c9ba memory/slab_heap: Make use of static_cast over reinterpret_cast
Casting from void* with static_cast is permitted by the standard, so we
can just make use of that instead.
2020-04-17 19:38:59 -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
bdf7501e7b memory: Add copyright notice for Atmosphere where applicable. 2020-04-17 00:59:35 -04:00
bunnei
0cf0195874 kernel: Remove old VMManager class. 2020-04-17 00:59:35 -04:00
bunnei
27b5b6c36f kernel: memory: page_table: Simplify GetPhysicalAddr impl. 2020-04-17 00:59:35 -04:00
bunnei
6b40850b9a kernel: svc: Updates for new VMM.
- Includes removing some SVC impls. that are untested.
2020-04-17 00:59:34 -04:00
bunnei
5fd6e219ea kernel: process: Updates for new VMM. 2020-04-17 00:59:33 -04:00
bunnei
15e751e36c kernel: resource_limit: Reserve physical memory. 2020-04-17 00:59:32 -04:00
bunnei
76a040f50d kernel: Initialize memory layout for new VMM. 2020-04-17 00:59:32 -04:00
bunnei
769f8cbf79 core: system: Rename GetDeviceManager -> DeviceManager.
- More consistent with other system components.
2020-04-17 00:59:32 -04:00
bunnei
d04147e731 kernel: transfer_memory: Refactor for new VMM. 2020-04-17 00:59:32 -04:00
bunnei
9edd67f475 kernel: shared_memory: Refactor for new VMM. 2020-04-17 00:59:32 -04:00
bunnei
6ef844fab3 kernel: errors: Add ERR_OUT_OF_RESOURCES. 2020-04-17 00:59:31 -04:00
bunnei
1717cdf811 kernel: process_capability: Update to use Memory::PageTable. 2020-04-17 00:59:31 -04:00
bunnei
6fe68ddea2 kernel: memory: Add PageTable class, to manage process address space. 2020-04-17 00:59:31 -04:00
bunnei
ea8bc8e759 kernel: memory: Add MemoryLayout class, to build physical memory layout. 2020-04-17 00:59:31 -04:00
bunnei
9b912d155a kernel: memory: Add MemoryManager class, to manage page heaps. 2020-04-17 00:59:30 -04:00
bunnei
227e9ac5d7 kernel: memory: Add MemoryBlockManager class, to manage memory blocks. 2020-04-17 00:59:30 -04:00