Commit Graph

47 Commits (a94831f2a99360a7dbc2602affc34bfaa8b048d5)

Author SHA1 Message Date
bunnei a609b6907a Kernel/Memory: Added a function to first a suitable guest address at which to allocate a region of a given size. 7 years ago
Lioncash 33830aa65a svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
Now that the changes clarifying the address spaces has been merged, we
can wrap the checks that the kernel performs when mapping shared memory
(and other forms of memory) into its own helper function and then use
those within MapSharedMemory and UnmapSharedMemory to complete the
sanitizing checks that are supposed to be done.
7 years ago
Lioncash 90f8474fc1 svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
So, one thing that's puzzled me is why the kernel seemed to *not* use
the direct code address ranges in some cases for some service functions.
For example, in svcMapMemory, the full address space width is compared
against for validity, but for svcMapSharedMemory, it compares against
0xFFE00000, 0xFF8000000, and 0x7FF8000000 as upper bounds, and uses
either 0x200000 or 0x8000000 as the lower-bounds as the beginning of the
compared range. Coincidentally, these exact same values are also used in
svcGetInfo, and also when initializing the user address space, so this
is actually retrieving the ASLR extents, not the extents of the address
space in general.
7 years ago
Lioncash 6c6f95d071 svc: Report correct memory-related values within some of the cases in svcGetInfo()
Previously, these were reporting hardcoded values, but given the regions
can change depending on the requested address spaces, these need to
report the values that the memory manager contains.
7 years ago
Lioncash 7fd598636e memory: Dehardcode the use of a 36-bit address space
Given games can also request a 32-bit or 39-bit address space, we
shouldn't be hardcoding the address space range as 36-bit.
7 years ago
Lioncash 75603b005b process/vm_manager: Amend API to allow reading parameters from NPDM metadata
Rather than hard-code the address range to be 36-bit, we can derive the
parameters from supplied NPDM metadata if the supplied exectuable
supports it. This is the bare minimum necessary for this to be possible.

The following commits will rework the memory code further to adjust to
this.
7 years ago
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 7 years ago
Lioncash d94a173877 kernel/vm_manager: Convert loop into std::any_of() 7 years ago
Lioncash c4e0c3d76c kernel/vm_manager: Use const where applicable
Makes our immutable state explicit.
7 years ago
Lioncash ce5ad45278 kernel/vm_manager: Use the VAddr type alias in CarveVMA()
These two variables correspond to address ranges.
7 years ago
bunnei 85421f3406
Merge pull request #690 from lioncash/move
core/memory, core/hle/kernel: Use std::move where applicable
7 years ago
Lioncash 93cba6f699 vm_manager: Add missing commas to string literal array elements in GetMemoryStateName()
Without these, this would perform concatenation, which is definitely not
what we want here.
7 years ago
Lioncash 46458e7284 core/memory, core/hle/kernel: Use std::move where applicable
Avoids pointless copies
7 years ago
James Rowe 0d46f0df12 Update clang format 7 years ago
James Rowe 638956aa81 Rename logging macro back to LOG_* 7 years ago
bunnei a434fdcb10 core: Implement multicore support. 7 years ago
Lioncash 7c9644646f
general: Make formatting of logged hex values more straightforward
This makes the formatting expectations more obvious (e.g. any zero padding specified
is padding that's entirely dedicated to the value being printed, not any pretty-printing
that also gets tacked on).
7 years ago
Lioncash 843dd62c81
core: Replace usages of LOG_GENERIC with new fmt-capable equivalents 7 years ago
Lioncash 8475496630
general: Convert assertion macros over to be fmt-compatible 7 years ago
Lioncash 40dee76c57
kernel: Migrate logging macros to fmt-compatible ones 7 years ago
bunnei 43f0f163e1 vm_manager: Increase GetTotalMemoryUsage value.
- Gets Binding of Isaac running.
7 years ago
bunnei 403f8e79ea arm_interface: Support unmapping previously mapped memory. 7 years ago
bunnei 34a29ad051 svc: Use more correct values for GetInfo MapRegion and NewMapRegion. 7 years ago
bunnei 8be7131033 MemoryState: Add additional memory states and improve naming. 7 years ago
Lioncash 1e33db8573
vm_manager: Silence formatting specifier warnings 7 years ago
MerryMage 738f91a57d memory: Replace all memory hooking with Special regions 7 years ago
bunnei e1ee8f4657 svc: Fix svcGetInfo MapRegionBaseAddr. 7 years ago
bunnei 1aa4cdc3c8
Merge pull request #52 from ogniK5377/fsp
added more svcGetInfo pairs for 3.0.0+ support, Changed HEAP_SIZE and TLS_AREA_VADDR. changed mem usage & heap usage stub added, ISelfController, IApplication function stubs. Added SetThreadCoreMask
7 years ago
David Marcec 68143af636 Added more svcGetInfo pairs 7 years ago
MerryMage e35644c005 clang-format 7 years ago
bunnei e9710a2cf7 vm_manager: Stub out a bunch of interfaces used by svcGetInfo. 7 years ago
bunnei b1d5db1cf6 Merge remote-tracking branch 'upstream/master' into nx
# Conflicts:
#	src/core/CMakeLists.txt
#	src/core/arm/dynarmic/arm_dynarmic.cpp
#	src/core/arm/dyncom/arm_dyncom.cpp
#	src/core/hle/kernel/process.cpp
#	src/core/hle/kernel/thread.cpp
#	src/core/hle/kernel/thread.h
#	src/core/hle/kernel/vm_manager.cpp
#	src/core/loader/3dsx.cpp
#	src/core/loader/elf.cpp
#	src/core/loader/ncch.cpp
#	src/core/memory.cpp
#	src/core/memory.h
#	src/core/memory_setup.h
8 years ago
bunnei f01472a5ff core: Various changes to support 64-bit addressing. 8 years ago
Subv 6d2734a074 Kernel/Memory: Give each Process its own page table.
The loader is in charge of setting the newly created process's page table as the main one during the loading process.
8 years ago
Yuri Kunde Schlesner 2cdb40d709 Kernel: Centralize error definitions in errors.h 8 years ago
Yuri Kunde Schlesner 84fbbe2629 Use negative priorities to avoid special-casing the self-include 9 years ago
Emmanuel Gil Peyrot 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.
9 years ago
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 9 years ago
MerryMage 80abe6eb08 Memory: Added necessary headers and removed unnecessary header 9 years ago
MerryMage 2b93313348 Memory: Implement MMIO 9 years ago
Yuri Kunde Schlesner cdeeecf080 Kernel: Properly implement ControlMemory FREE and COMMIT 10 years ago
Yuri Kunde Schlesner 306408d174 VMManager: Introduce names for used ResultCodes 10 years ago
Yuri Kunde Schlesner b9a9ad9742 VMManager: Make LogLayout log level configurable as a parameter 10 years ago
Yuri Kunde Schlesner 785407d06f VMManager: Change block offsets to size_t 10 years ago
Yuri Kunde Schlesner 5c5cf2f8e0 Core: Properly configure address space when loading a binary
The code now properly configures the process image to match the loaded
binary segments (code, rodata, data) instead of just blindly allocating
a large chunk of dummy memory.
10 years ago
Emmanuel Gil Peyrot aea15f5c73 Core: Cleanup core includes. 10 years ago
Yuri Kunde Schlesner 0a60aa75c2 Kernel: Add VMManager to manage process address spaces
This enables more dynamic management of the process address space,
compared to just directly configuring the page table for major areas.

This will serve as the foundation upon which the rest of the Kernel
memory management functions will be built.
10 years ago