mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Refactor the memory implementation and add Regions
This commit does a major refactor of the memory implementation, it forms a memory map which is far cleaner than trying to access it through a handle table lookup. In addition, it creates a common interface for all memory kernel objects: KMemory from which all other kernel memory objects inherit. This allows doing resizing, permission change, etc without casting to the base memory type.
This commit is contained in:
@ -37,7 +37,7 @@ namespace skyline {
|
||||
};
|
||||
namespace kernel::svc {
|
||||
/**
|
||||
* @brief Set the process heap to a given size (https://switchbrew.org/wiki/SVC#svcSetHeapSize)
|
||||
* @brief Sets the process heap to a given Size. It can both extend and shrink the heap. (https://switchbrew.org/wiki/SVC#svcSetHeapSize)
|
||||
*/
|
||||
void SetHeapSize(DeviceState &state);
|
||||
|
||||
@ -46,6 +46,11 @@ namespace skyline {
|
||||
*/
|
||||
void SetMemoryAttribute(DeviceState &state);
|
||||
|
||||
/**
|
||||
* @brief Maps a memory range into a different range. Mainly used for adding guard pages around stack. (https://switchbrew.org/wiki/SVC#svcSetMemoryAttribute)
|
||||
*/
|
||||
void MapMemory(DeviceState &state);
|
||||
|
||||
/**
|
||||
* @brief Query information about an address (https://switchbrew.org/wiki/SVC#svcQueryMemory)
|
||||
*/
|
||||
@ -169,7 +174,7 @@ namespace skyline {
|
||||
SetHeapSize, // 0x01
|
||||
nullptr, // 0x02
|
||||
SetMemoryAttribute, // 0x03
|
||||
nullptr, // 0x04
|
||||
MapMemory, // 0x04
|
||||
nullptr, // 0x05
|
||||
QueryMemory, // 0x06
|
||||
ExitProcess, // 0x07
|
||||
|
Reference in New Issue
Block a user