mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
Process: Rename StaticAddressMapping => AddressMapping
This commit is contained in:
parent
83ccf85bb2
commit
3cb19c9589
6 changed files with 10 additions and 10 deletions
|
@ -59,16 +59,16 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) {
|
||||||
u32 end_desc = kernel_caps[i+1];
|
u32 end_desc = kernel_caps[i+1];
|
||||||
++i; // Skip over the second descriptor on the next iteration
|
++i; // Skip over the second descriptor on the next iteration
|
||||||
|
|
||||||
StaticAddressMapping mapping;
|
AddressMapping mapping;
|
||||||
mapping.address = descriptor << 12;
|
mapping.address = descriptor << 12;
|
||||||
mapping.size = (end_desc << 12) - mapping.address;
|
mapping.size = (end_desc << 12) - mapping.address;
|
||||||
mapping.writable = descriptor & BIT(20);
|
mapping.writable = descriptor & BIT(20);
|
||||||
mapping.unk_flag = end_desc & BIT(20);
|
mapping.unk_flag = end_desc & BIT(20);
|
||||||
|
|
||||||
static_address_mappings.push_back(mapping);
|
address_mappings.push_back(mapping);
|
||||||
} else if ((type & 0xFFF) == 0xFFE) { // 0x000F
|
} else if ((type & 0xFFF) == 0xFFE) { // 0x000F
|
||||||
// Mapped memory page
|
// Mapped memory page
|
||||||
StaticAddressMapping mapping;
|
AddressMapping mapping;
|
||||||
mapping.address = descriptor << 12;
|
mapping.address = descriptor << 12;
|
||||||
mapping.size = Memory::PAGE_SIZE;
|
mapping.size = Memory::PAGE_SIZE;
|
||||||
mapping.writable = true; // TODO: Not sure if correct
|
mapping.writable = true; // TODO: Not sure if correct
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
struct StaticAddressMapping {
|
struct AddressMapping {
|
||||||
// Address and size must be page-aligned
|
// Address and size must be page-aligned
|
||||||
VAddr address;
|
VAddr address;
|
||||||
u32 size;
|
u32 size;
|
||||||
|
@ -66,7 +66,7 @@ public:
|
||||||
unsigned int handle_table_size = 0x200;
|
unsigned int handle_table_size = 0x200;
|
||||||
/// Special memory ranges mapped into this processes address space. This is used to give
|
/// Special memory ranges mapped into this processes address space. This is used to give
|
||||||
/// processes access to specific I/O regions and device memory.
|
/// processes access to specific I/O regions and device memory.
|
||||||
boost::container::static_vector<StaticAddressMapping, 8> static_address_mappings;
|
boost::container::static_vector<AddressMapping, 8> address_mappings;
|
||||||
ProcessFlags flags;
|
ProcessFlags flags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -232,7 +232,7 @@ ResultStatus AppLoader_THREEDSX::Load() {
|
||||||
|
|
||||||
Kernel::g_current_process = Kernel::Process::Create(filename, 0);
|
Kernel::g_current_process = Kernel::Process::Create(filename, 0);
|
||||||
Kernel::g_current_process->svc_access_mask.set();
|
Kernel::g_current_process->svc_access_mask.set();
|
||||||
Kernel::g_current_process->static_address_mappings = default_address_mappings;
|
Kernel::g_current_process->address_mappings = default_address_mappings;
|
||||||
|
|
||||||
Load3DSXFile(*file, Memory::EXEFS_CODE_VADDR);
|
Load3DSXFile(*file, Memory::EXEFS_CODE_VADDR);
|
||||||
|
|
||||||
|
|
|
@ -352,7 +352,7 @@ ResultStatus AppLoader_ELF::Load() {
|
||||||
|
|
||||||
Kernel::g_current_process = Kernel::Process::Create(filename, 0);
|
Kernel::g_current_process = Kernel::Process::Create(filename, 0);
|
||||||
Kernel::g_current_process->svc_access_mask.set();
|
Kernel::g_current_process->svc_access_mask.set();
|
||||||
Kernel::g_current_process->static_address_mappings = default_address_mappings;
|
Kernel::g_current_process->address_mappings = default_address_mappings;
|
||||||
|
|
||||||
ElfReader elf_reader(&buffer[0]);
|
ElfReader elf_reader(&buffer[0]);
|
||||||
elf_reader.LoadInto(Memory::EXEFS_CODE_VADDR);
|
elf_reader.LoadInto(Memory::EXEFS_CODE_VADDR);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
namespace Loader {
|
namespace Loader {
|
||||||
|
|
||||||
const std::initializer_list<Kernel::StaticAddressMapping> default_address_mappings = {
|
const std::initializer_list<Kernel::AddressMapping> default_address_mappings = {
|
||||||
{ 0x1FF50000, 0x8000, true }, // part of DSP RAM
|
{ 0x1FF50000, 0x8000, true }, // part of DSP RAM
|
||||||
{ 0x1FF70000, 0x8000, true }, // part of DSP RAM
|
{ 0x1FF70000, 0x8000, true }, // part of DSP RAM
|
||||||
{ 0x1F000000, 0x600000, false }, // entire VRAM
|
{ 0x1F000000, 0x600000, false }, // entire VRAM
|
||||||
|
@ -142,7 +142,7 @@ ResultStatus LoadFile(const std::string& filename) {
|
||||||
{
|
{
|
||||||
Kernel::g_current_process = Kernel::Process::Create(filename_filename, 0);
|
Kernel::g_current_process = Kernel::Process::Create(filename_filename, 0);
|
||||||
Kernel::g_current_process->svc_access_mask.set();
|
Kernel::g_current_process->svc_access_mask.set();
|
||||||
Kernel::g_current_process->static_address_mappings = default_address_mappings;
|
Kernel::g_current_process->address_mappings = default_address_mappings;
|
||||||
|
|
||||||
size_t size = (size_t)file->GetSize();
|
size_t size = (size_t)file->GetSize();
|
||||||
if (file->ReadBytes(Memory::GetPointer(Memory::EXEFS_CODE_VADDR), size) != size)
|
if (file->ReadBytes(Memory::GetPointer(Memory::EXEFS_CODE_VADDR), size) != size)
|
||||||
|
|
|
@ -110,7 +110,7 @@ protected:
|
||||||
* Common address mappings found in most games, used for binary formats that don't have this
|
* Common address mappings found in most games, used for binary formats that don't have this
|
||||||
* information.
|
* information.
|
||||||
*/
|
*/
|
||||||
extern const std::initializer_list<Kernel::StaticAddressMapping> default_address_mappings;
|
extern const std::initializer_list<Kernel::AddressMapping> default_address_mappings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifies and loads a bootable file
|
* Identifies and loads a bootable file
|
||||||
|
|
Loading…
Reference in a new issue