diff options
| author | bunnei <bunneidev@gmail.com> | 2021-04-10 00:02:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-10 00:02:52 -0700 |
| commit | b04877dd952d7da11647f16626952d7325e4e900 (patch) | |
| tree | d097ebea3b24a2c815015c17e6c5fd89c69ce045 /src/core/hle/kernel/arch | |
| parent | 31c80b8c6faa7681e7b16a4052403281c7f2b9cd (diff) | |
| parent | 10d6e9f32bcc102d2fb12ba3e489c9a03d7f220f (diff) | |
Merge pull request #6099 from bunnei/derive-mem
Kernel Rework: Derive memory regions from board layout.
Diffstat (limited to 'src/core/hle/kernel/arch')
| -rw-r--r-- | src/core/hle/kernel/arch/arm64/k_memory_region_device_types.inc | 20 |
1 files changed, 20 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)); |
