diff options
| author | 2021-02-18 16:38:30 -0800 | |
|---|---|---|
| committer | 2021-03-21 14:45:02 -0700 | |
| commit | c17beefe3d1e4850b3518a45892c0c5c6e11c95a (patch) | |
| tree | bd4a0f20b6f95f0394a7777e86ceffd1dcd9ba10 /src | |
| parent | hle: kernel: KMemoryRegion: Derive region values. (diff) | |
| download | yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar.gz yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar.xz yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.zip | |
hle: kernel: Add architecture and board specific memory regions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/arch/arm64/k_memory_region_device_types.inc | 20 | ||||
| -rw-r--r-- | src/core/hle/kernel/board/nintendo/nx/k_memory_region_device_types.inc | 52 |
2 files changed, 72 insertions, 0 deletions
diff --git a/src/core/hle/kernel/arch/arm64/k_memory_region_device_types.inc b/src/core/hle/kernel/arch/arm64/k_memory_region_device_types.inc new file mode 100644 index 000000000..857b512ba --- /dev/null +++ b/src/core/hle/kernel/arch/arm64/k_memory_region_device_types.inc | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | // All architectures must define NumArchitectureDeviceRegions. | ||
| 6 | constexpr inline const auto NumArchitectureDeviceRegions = 3; | ||
| 7 | |||
| 8 | constexpr inline const auto KMemoryRegionType_Uart = | ||
| 9 | KMemoryRegionType_ArchDeviceBase.DeriveSparse(0, NumArchitectureDeviceRegions, 0); | ||
| 10 | constexpr inline const auto KMemoryRegionType_InterruptCpuInterface = | ||
| 11 | KMemoryRegionType_ArchDeviceBase.DeriveSparse(0, NumArchitectureDeviceRegions, 1) | ||
| 12 | .SetAttribute(KMemoryRegionAttr_NoUserMap); | ||
| 13 | constexpr inline const auto KMemoryRegionType_InterruptDistributor = | ||
| 14 | KMemoryRegionType_ArchDeviceBase.DeriveSparse(0, NumArchitectureDeviceRegions, 2) | ||
| 15 | .SetAttribute(KMemoryRegionAttr_NoUserMap); | ||
| 16 | static_assert(KMemoryRegionType_Uart.GetValue() == (0x1D)); | ||
| 17 | static_assert(KMemoryRegionType_InterruptCpuInterface.GetValue() == | ||
| 18 | (0x2D | KMemoryRegionAttr_NoUserMap)); | ||
| 19 | static_assert(KMemoryRegionType_InterruptDistributor.GetValue() == | ||
| 20 | (0x4D | KMemoryRegionAttr_NoUserMap)); | ||
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_memory_region_device_types.inc b/src/core/hle/kernel/board/nintendo/nx/k_memory_region_device_types.inc new file mode 100644 index 000000000..58d6c0b16 --- /dev/null +++ b/src/core/hle/kernel/board/nintendo/nx/k_memory_region_device_types.inc | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | // All architectures must define NumBoardDeviceRegions. | ||
| 6 | constexpr inline const auto NumBoardDeviceRegions = 6; | ||
| 7 | // UNUSED: .Derive(NumBoardDeviceRegions, 0); | ||
| 8 | constexpr inline const auto KMemoryRegionType_MemoryController = | ||
| 9 | KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 1) | ||
| 10 | .SetAttribute(KMemoryRegionAttr_NoUserMap); | ||
| 11 | constexpr inline const auto KMemoryRegionType_MemoryController1 = | ||
| 12 | KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 2) | ||
| 13 | .SetAttribute(KMemoryRegionAttr_NoUserMap); | ||
| 14 | constexpr inline const auto KMemoryRegionType_MemoryController0 = | ||
| 15 | KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 3) | ||
| 16 | .SetAttribute(KMemoryRegionAttr_NoUserMap); | ||
| 17 | constexpr inline const auto KMemoryRegionType_PowerManagementController = | ||
| 18 | KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 4).DeriveTransition(); | ||
| 19 | constexpr inline const auto KMemoryRegionType_LegacyLpsDevices = | ||
| 20 | KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 5); | ||
| 21 | static_assert(KMemoryRegionType_MemoryController.GetValue() == | ||
| 22 | (0x55 | KMemoryRegionAttr_NoUserMap)); | ||
| 23 | static_assert(KMemoryRegionType_MemoryController1.GetValue() == | ||
| 24 | (0x65 | KMemoryRegionAttr_NoUserMap)); | ||
| 25 | static_assert(KMemoryRegionType_MemoryController0.GetValue() == | ||
| 26 | (0x95 | KMemoryRegionAttr_NoUserMap)); | ||
| 27 | static_assert(KMemoryRegionType_PowerManagementController.GetValue() == (0x1A5)); | ||
| 28 | |||
| 29 | static_assert(KMemoryRegionType_LegacyLpsDevices.GetValue() == 0xC5); | ||
| 30 | |||
| 31 | constexpr inline const auto NumLegacyLpsDevices = 7; | ||
| 32 | constexpr inline const auto KMemoryRegionType_LegacyLpsExceptionVectors = | ||
| 33 | KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 0); | ||
| 34 | constexpr inline const auto KMemoryRegionType_LegacyLpsIram = | ||
| 35 | KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 1); | ||
| 36 | constexpr inline const auto KMemoryRegionType_LegacyLpsFlowController = | ||
| 37 | KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 2); | ||
| 38 | constexpr inline const auto KMemoryRegionType_LegacyLpsPrimaryICtlr = | ||
| 39 | KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 3); | ||
| 40 | constexpr inline const auto KMemoryRegionType_LegacyLpsSemaphore = | ||
| 41 | KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 4); | ||
| 42 | constexpr inline const auto KMemoryRegionType_LegacyLpsAtomics = | ||
| 43 | KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 5); | ||
| 44 | constexpr inline const auto KMemoryRegionType_LegacyLpsClkRst = | ||
| 45 | KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 6); | ||
| 46 | static_assert(KMemoryRegionType_LegacyLpsExceptionVectors.GetValue() == 0x3C5); | ||
| 47 | static_assert(KMemoryRegionType_LegacyLpsIram.GetValue() == 0x5C5); | ||
| 48 | static_assert(KMemoryRegionType_LegacyLpsFlowController.GetValue() == 0x6C5); | ||
| 49 | static_assert(KMemoryRegionType_LegacyLpsPrimaryICtlr.GetValue() == 0x9C5); | ||
| 50 | static_assert(KMemoryRegionType_LegacyLpsSemaphore.GetValue() == 0xAC5); | ||
| 51 | static_assert(KMemoryRegionType_LegacyLpsAtomics.GetValue() == 0xCC5); | ||
| 52 | static_assert(KMemoryRegionType_LegacyLpsClkRst.GetValue() == 0x11C5); | ||