summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-19 01:38:30 +0100
committerbunnei <bunneidev@gmail.com>2021-03-21 22:45:02 +0100
commitc17beefe3d1e4850b3518a45892c0c5c6e11c95a (patch)
treebd4a0f20b6f95f0394a7777e86ceffd1dcd9ba10 /src/core
parenthle: kernel: KMemoryRegion: Derive region values. (diff)
downloadyuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar
yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar.gz
yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar.bz2
yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar.lz
yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar.xz
yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.tar.zst
yuzu-c17beefe3d1e4850b3518a45892c0c5c6e11c95a.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/arch/arm64/k_memory_region_device_types.inc20
-rw-r--r--src/core/hle/kernel/board/nintendo/nx/k_memory_region_device_types.inc52
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 @@
+// Copyright 2021 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+// All architectures must define NumArchitectureDeviceRegions.
+constexpr inline const auto NumArchitectureDeviceRegions = 3;
+
+constexpr inline const auto KMemoryRegionType_Uart =
+ KMemoryRegionType_ArchDeviceBase.DeriveSparse(0, NumArchitectureDeviceRegions, 0);
+constexpr inline const auto KMemoryRegionType_InterruptCpuInterface =
+ KMemoryRegionType_ArchDeviceBase.DeriveSparse(0, NumArchitectureDeviceRegions, 1)
+ .SetAttribute(KMemoryRegionAttr_NoUserMap);
+constexpr inline const auto KMemoryRegionType_InterruptDistributor =
+ KMemoryRegionType_ArchDeviceBase.DeriveSparse(0, NumArchitectureDeviceRegions, 2)
+ .SetAttribute(KMemoryRegionAttr_NoUserMap);
+static_assert(KMemoryRegionType_Uart.GetValue() == (0x1D));
+static_assert(KMemoryRegionType_InterruptCpuInterface.GetValue() ==
+ (0x2D | KMemoryRegionAttr_NoUserMap));
+static_assert(KMemoryRegionType_InterruptDistributor.GetValue() ==
+ (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 @@
+// Copyright 2021 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+// All architectures must define NumBoardDeviceRegions.
+constexpr inline const auto NumBoardDeviceRegions = 6;
+// UNUSED: .Derive(NumBoardDeviceRegions, 0);
+constexpr inline const auto KMemoryRegionType_MemoryController =
+ KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 1)
+ .SetAttribute(KMemoryRegionAttr_NoUserMap);
+constexpr inline const auto KMemoryRegionType_MemoryController1 =
+ KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 2)
+ .SetAttribute(KMemoryRegionAttr_NoUserMap);
+constexpr inline const auto KMemoryRegionType_MemoryController0 =
+ KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 3)
+ .SetAttribute(KMemoryRegionAttr_NoUserMap);
+constexpr inline const auto KMemoryRegionType_PowerManagementController =
+ KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 4).DeriveTransition();
+constexpr inline const auto KMemoryRegionType_LegacyLpsDevices =
+ KMemoryRegionType_BoardDeviceBase.Derive(NumBoardDeviceRegions, 5);
+static_assert(KMemoryRegionType_MemoryController.GetValue() ==
+ (0x55 | KMemoryRegionAttr_NoUserMap));
+static_assert(KMemoryRegionType_MemoryController1.GetValue() ==
+ (0x65 | KMemoryRegionAttr_NoUserMap));
+static_assert(KMemoryRegionType_MemoryController0.GetValue() ==
+ (0x95 | KMemoryRegionAttr_NoUserMap));
+static_assert(KMemoryRegionType_PowerManagementController.GetValue() == (0x1A5));
+
+static_assert(KMemoryRegionType_LegacyLpsDevices.GetValue() == 0xC5);
+
+constexpr inline const auto NumLegacyLpsDevices = 7;
+constexpr inline const auto KMemoryRegionType_LegacyLpsExceptionVectors =
+ KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 0);
+constexpr inline const auto KMemoryRegionType_LegacyLpsIram =
+ KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 1);
+constexpr inline const auto KMemoryRegionType_LegacyLpsFlowController =
+ KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 2);
+constexpr inline const auto KMemoryRegionType_LegacyLpsPrimaryICtlr =
+ KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 3);
+constexpr inline const auto KMemoryRegionType_LegacyLpsSemaphore =
+ KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 4);
+constexpr inline const auto KMemoryRegionType_LegacyLpsAtomics =
+ KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 5);
+constexpr inline const auto KMemoryRegionType_LegacyLpsClkRst =
+ KMemoryRegionType_LegacyLpsDevices.Derive(NumLegacyLpsDevices, 6);
+static_assert(KMemoryRegionType_LegacyLpsExceptionVectors.GetValue() == 0x3C5);
+static_assert(KMemoryRegionType_LegacyLpsIram.GetValue() == 0x5C5);
+static_assert(KMemoryRegionType_LegacyLpsFlowController.GetValue() == 0x6C5);
+static_assert(KMemoryRegionType_LegacyLpsPrimaryICtlr.GetValue() == 0x9C5);
+static_assert(KMemoryRegionType_LegacyLpsSemaphore.GetValue() == 0xAC5);
+static_assert(KMemoryRegionType_LegacyLpsAtomics.GetValue() == 0xCC5);
+static_assert(KMemoryRegionType_LegacyLpsClkRst.GetValue() == 0x11C5);