summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp4
-rw-r--r--src/core/hle/kernel/init/init_slab_setup.cpp4
-rw-r--r--src/core/hle/kernel/k_capabilities.cpp6
-rw-r--r--src/core/hle/kernel/k_memory_manager.h6
-rw-r--r--src/core/hle/kernel/k_page_heap.cpp2
-rw-r--r--src/core/hle/kernel/k_page_table.cpp4
-rw-r--r--src/core/hle/kernel/kernel.cpp42
-rw-r--r--src/core/hle/kernel/process_capability.cpp2
-rw-r--r--src/core/hle/kernel/svc/svc_activity.cpp2
-rw-r--r--src/core/hle/kernel/svc/svc_info.cpp2
-rw-r--r--src/core/hle/kernel/svc/svc_memory.cpp2
11 files changed, 38 insertions, 38 deletions
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
index c10b7bf30..49098d2c9 100644
--- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
+++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
@@ -114,13 +114,13 @@ size_t KSystemControl::Init::GetAppletPoolSize() {
114 }(); 114 }();
115 115
116 // Return (possibly) adjusted size. 116 // Return (possibly) adjusted size.
117 constexpr size_t ExtraSystemMemoryForAtmosphere = 33_MiB; 117 constexpr static size_t ExtraSystemMemoryForAtmosphere = 33_MiB;
118 return base_pool_size - ExtraSystemMemoryForAtmosphere - KTraceBufferSize; 118 return base_pool_size - ExtraSystemMemoryForAtmosphere - KTraceBufferSize;
119} 119}
120 120
121size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() { 121size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() {
122 // Verify that our minimum is at least as large as Nintendo's. 122 // Verify that our minimum is at least as large as Nintendo's.
123 constexpr size_t MinimumSize = RequiredNonSecureSystemMemorySize; 123 constexpr static size_t MinimumSize = RequiredNonSecureSystemMemorySize;
124 static_assert(MinimumSize >= 0x29C8000); 124 static_assert(MinimumSize >= 0x29C8000);
125 125
126 return MinimumSize; 126 return MinimumSize;
diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp
index 571acf4b2..951326a85 100644
--- a/src/core/hle/kernel/init/init_slab_setup.cpp
+++ b/src/core/hle/kernel/init/init_slab_setup.cpp
@@ -129,7 +129,7 @@ VAddr InitializeSlabHeap(Core::System& system, KMemoryLayout& memory_layout, VAd
129} 129}
130 130
131size_t CalculateSlabHeapGapSize() { 131size_t CalculateSlabHeapGapSize() {
132 constexpr size_t KernelSlabHeapGapSize = 2_MiB - 320_KiB; 132 constexpr static size_t KernelSlabHeapGapSize = 2_MiB - 320_KiB;
133 static_assert(KernelSlabHeapGapSize <= KernelSlabHeapGapsSizeMax); 133 static_assert(KernelSlabHeapGapSize <= KernelSlabHeapGapsSizeMax);
134 return KernelSlabHeapGapSize; 134 return KernelSlabHeapGapSize;
135} 135}
@@ -272,7 +272,7 @@ void KPageBufferSlabHeap::Initialize(Core::System& system) {
272 kernel.GetSystemResourceLimit()->Reserve(LimitableResource::PhysicalMemoryMax, slab_size)); 272 kernel.GetSystemResourceLimit()->Reserve(LimitableResource::PhysicalMemoryMax, slab_size));
273 273
274 // Allocate memory for the slab. 274 // Allocate memory for the slab.
275 constexpr auto AllocateOption = KMemoryManager::EncodeOption( 275 constexpr static auto AllocateOption = KMemoryManager::EncodeOption(
276 KMemoryManager::Pool::System, KMemoryManager::Direction::FromFront); 276 KMemoryManager::Pool::System, KMemoryManager::Direction::FromFront);
277 const PAddr slab_address = 277 const PAddr slab_address =
278 kernel.MemoryManager().AllocateAndOpenContinuous(num_pages, 1, AllocateOption); 278 kernel.MemoryManager().AllocateAndOpenContinuous(num_pages, 1, AllocateOption);
diff --git a/src/core/hle/kernel/k_capabilities.cpp b/src/core/hle/kernel/k_capabilities.cpp
index 2907cc6e3..374bc2c06 100644
--- a/src/core/hle/kernel/k_capabilities.cpp
+++ b/src/core/hle/kernel/k_capabilities.cpp
@@ -21,8 +21,8 @@ Result KCapabilities::InitializeForKIP(std::span<const u32> kern_caps, KPageTabl
21 m_program_type = 0; 21 m_program_type = 0;
22 22
23 // Initial processes may run on all cores. 23 // Initial processes may run on all cores.
24 constexpr u64 VirtMask = Core::Hardware::VirtualCoreMask; 24 constexpr static u64 VirtMask = Core::Hardware::VirtualCoreMask;
25 constexpr u64 PhysMask = Core::Hardware::ConvertVirtualCoreMaskToPhysical(VirtMask); 25 constexpr static u64 PhysMask = Core::Hardware::ConvertVirtualCoreMaskToPhysical(VirtMask);
26 26
27 m_core_mask = VirtMask; 27 m_core_mask = VirtMask;
28 m_phys_core_mask = PhysMask; 28 m_phys_core_mask = PhysMask;
@@ -170,7 +170,7 @@ Result KCapabilities::MapIoPage_(const u32 cap, KPageTable* page_table) {
170template <typename F> 170template <typename F>
171Result KCapabilities::ProcessMapRegionCapability(const u32 cap, F f) { 171Result KCapabilities::ProcessMapRegionCapability(const u32 cap, F f) {
172 // Define the allowed memory regions. 172 // Define the allowed memory regions.
173 constexpr std::array<KMemoryRegionType, 4> MemoryRegions{ 173 constexpr static std::array<KMemoryRegionType, 4> MemoryRegions{
174 KMemoryRegionType_None, 174 KMemoryRegionType_None,
175 KMemoryRegionType_KernelTraceBuffer, 175 KMemoryRegionType_KernelTraceBuffer,
176 KMemoryRegionType_OnMemoryBootImage, 176 KMemoryRegionType_OnMemoryBootImage,
diff --git a/src/core/hle/kernel/k_memory_manager.h b/src/core/hle/kernel/k_memory_manager.h
index 401d4e644..d13549b5e 100644
--- a/src/core/hle/kernel/k_memory_manager.h
+++ b/src/core/hle/kernel/k_memory_manager.h
@@ -121,7 +121,7 @@ public:
121 } 121 }
122 122
123 size_t GetSize(Pool pool) { 123 size_t GetSize(Pool pool) {
124 constexpr Direction GetSizeDirection = Direction::FromFront; 124 constexpr static Direction GetSizeDirection = Direction::FromFront;
125 size_t total = 0; 125 size_t total = 0;
126 for (auto* manager = this->GetFirstManager(pool, GetSizeDirection); manager != nullptr; 126 for (auto* manager = this->GetFirstManager(pool, GetSizeDirection); manager != nullptr;
127 manager = this->GetNextManager(manager, GetSizeDirection)) { 127 manager = this->GetNextManager(manager, GetSizeDirection)) {
@@ -142,7 +142,7 @@ public:
142 size_t GetFreeSize(Pool pool) { 142 size_t GetFreeSize(Pool pool) {
143 KScopedLightLock lk(m_pool_locks[static_cast<size_t>(pool)]); 143 KScopedLightLock lk(m_pool_locks[static_cast<size_t>(pool)]);
144 144
145 constexpr Direction GetSizeDirection = Direction::FromFront; 145 constexpr static Direction GetSizeDirection = Direction::FromFront;
146 size_t total = 0; 146 size_t total = 0;
147 for (auto* manager = this->GetFirstManager(pool, GetSizeDirection); manager != nullptr; 147 for (auto* manager = this->GetFirstManager(pool, GetSizeDirection); manager != nullptr;
148 manager = this->GetNextManager(manager, GetSizeDirection)) { 148 manager = this->GetNextManager(manager, GetSizeDirection)) {
@@ -154,7 +154,7 @@ public:
154 void DumpFreeList(Pool pool) { 154 void DumpFreeList(Pool pool) {
155 KScopedLightLock lk(m_pool_locks[static_cast<size_t>(pool)]); 155 KScopedLightLock lk(m_pool_locks[static_cast<size_t>(pool)]);
156 156
157 constexpr Direction DumpDirection = Direction::FromFront; 157 constexpr static Direction DumpDirection = Direction::FromFront;
158 for (auto* manager = this->GetFirstManager(pool, DumpDirection); manager != nullptr; 158 for (auto* manager = this->GetFirstManager(pool, DumpDirection); manager != nullptr;
159 manager = this->GetNextManager(manager, DumpDirection)) { 159 manager = this->GetNextManager(manager, DumpDirection)) {
160 manager->DumpFreeList(); 160 manager->DumpFreeList();
diff --git a/src/core/hle/kernel/k_page_heap.cpp b/src/core/hle/kernel/k_page_heap.cpp
index 7b02c7d8b..ffebf0a35 100644
--- a/src/core/hle/kernel/k_page_heap.cpp
+++ b/src/core/hle/kernel/k_page_heap.cpp
@@ -68,7 +68,7 @@ PAddr KPageHeap::AllocateByRandom(s32 index, size_t num_pages, size_t align_page
68 const size_t align_shift = std::countr_zero(align_size); 68 const size_t align_shift = std::countr_zero(align_size);
69 69
70 // Decide on a block to allocate from. 70 // Decide on a block to allocate from.
71 constexpr size_t MinimumPossibleAlignmentsForRandomAllocation = 4; 71 constexpr static size_t MinimumPossibleAlignmentsForRandomAllocation = 4;
72 { 72 {
73 // By default, we'll want to look at all blocks larger than our current one. 73 // By default, we'll want to look at all blocks larger than our current one.
74 s32 max_blocks = static_cast<s32>(m_num_blocks); 74 s32 max_blocks = static_cast<s32>(m_num_blocks);
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp
index 2e13d5d0d..d3e0334ed 100644
--- a/src/core/hle/kernel/k_page_table.cpp
+++ b/src/core/hle/kernel/k_page_table.cpp
@@ -134,7 +134,7 @@ Result KPageTable::InitializeForProcess(FileSys::ProgramAddressSpaceType as_type
134 } 134 }
135 135
136 // Set code regions and determine remaining 136 // Set code regions and determine remaining
137 constexpr size_t RegionAlignment{2_MiB}; 137 constexpr static size_t RegionAlignment{2_MiB};
138 VAddr process_code_start{}; 138 VAddr process_code_start{};
139 VAddr process_code_end{}; 139 VAddr process_code_end{};
140 size_t stack_region_size{}; 140 size_t stack_region_size{};
@@ -2624,7 +2624,7 @@ Result KPageTable::SetMemoryAttribute(VAddr addr, size_t size, u32 mask, u32 att
2624 KMemoryPermission old_perm; 2624 KMemoryPermission old_perm;
2625 KMemoryAttribute old_attr; 2625 KMemoryAttribute old_attr;
2626 size_t num_allocator_blocks; 2626 size_t num_allocator_blocks;
2627 constexpr auto AttributeTestMask = 2627 constexpr static auto AttributeTestMask =
2628 ~(KMemoryAttribute::SetMask | KMemoryAttribute::DeviceShared); 2628 ~(KMemoryAttribute::SetMask | KMemoryAttribute::DeviceShared);
2629 R_TRY(this->CheckMemoryState( 2629 R_TRY(this->CheckMemoryState(
2630 std::addressof(old_state), std::addressof(old_perm), std::addressof(old_attr), 2630 std::addressof(old_state), std::addressof(old_perm), std::addressof(old_attr),
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 5b72eaaa1..563e2681b 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -254,7 +254,7 @@ struct KernelCore::Impl {
254 system_resource_limit->Reserve(LimitableResource::PhysicalMemoryMax, kernel_size); 254 system_resource_limit->Reserve(LimitableResource::PhysicalMemoryMax, kernel_size);
255 255
256 // Reserve secure applet memory, introduced in firmware 5.0.0 256 // Reserve secure applet memory, introduced in firmware 5.0.0
257 constexpr u64 secure_applet_memory_size{4_MiB}; 257 constexpr static u64 secure_applet_memory_size{4_MiB};
258 ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemoryMax, 258 ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemoryMax,
259 secure_applet_memory_size)); 259 secure_applet_memory_size));
260 } 260 }
@@ -477,9 +477,9 @@ struct KernelCore::Impl {
477 const VAddr code_end_virt_addr = KernelVirtualAddressCodeEnd; 477 const VAddr code_end_virt_addr = KernelVirtualAddressCodeEnd;
478 478
479 // Setup the containing kernel region. 479 // Setup the containing kernel region.
480 constexpr size_t KernelRegionSize = 1_GiB; 480 constexpr static size_t KernelRegionSize = 1_GiB;
481 constexpr size_t KernelRegionAlign = 1_GiB; 481 constexpr static size_t KernelRegionAlign = 1_GiB;
482 constexpr VAddr kernel_region_start = 482 constexpr static VAddr kernel_region_start =
483 Common::AlignDown(code_start_virt_addr, KernelRegionAlign); 483 Common::AlignDown(code_start_virt_addr, KernelRegionAlign);
484 size_t kernel_region_size = KernelRegionSize; 484 size_t kernel_region_size = KernelRegionSize;
485 if (!(kernel_region_start + KernelRegionSize - 1 <= KernelVirtualAddressSpaceLast)) { 485 if (!(kernel_region_start + KernelRegionSize - 1 <= KernelVirtualAddressSpaceLast)) {
@@ -489,11 +489,11 @@ struct KernelCore::Impl {
489 kernel_region_start, kernel_region_size, KMemoryRegionType_Kernel)); 489 kernel_region_start, kernel_region_size, KMemoryRegionType_Kernel));
490 490
491 // Setup the code region. 491 // Setup the code region.
492 constexpr size_t CodeRegionAlign = PageSize; 492 constexpr static size_t CodeRegionAlign = PageSize;
493 constexpr VAddr code_region_start = 493 constexpr static VAddr code_region_start =
494 Common::AlignDown(code_start_virt_addr, CodeRegionAlign); 494 Common::AlignDown(code_start_virt_addr, CodeRegionAlign);
495 constexpr VAddr code_region_end = Common::AlignUp(code_end_virt_addr, CodeRegionAlign); 495 constexpr static VAddr code_region_end = Common::AlignUp(code_end_virt_addr, CodeRegionAlign);
496 constexpr size_t code_region_size = code_region_end - code_region_start; 496 constexpr static size_t code_region_size = code_region_end - code_region_start;
497 ASSERT(memory_layout->GetVirtualMemoryRegionTree().Insert( 497 ASSERT(memory_layout->GetVirtualMemoryRegionTree().Insert(
498 code_region_start, code_region_size, KMemoryRegionType_KernelCode)); 498 code_region_start, code_region_size, KMemoryRegionType_KernelCode));
499 499
@@ -524,8 +524,8 @@ struct KernelCore::Impl {
524 } 524 }
525 525
526 // Decide on the actual size for the misc region. 526 // Decide on the actual size for the misc region.
527 constexpr size_t MiscRegionAlign = KernelAslrAlignment; 527 constexpr static size_t MiscRegionAlign = KernelAslrAlignment;
528 constexpr size_t MiscRegionMinimumSize = 32_MiB; 528 constexpr static size_t MiscRegionMinimumSize = 32_MiB;
529 const size_t misc_region_size = Common::AlignUp( 529 const size_t misc_region_size = Common::AlignUp(
530 std::max(misc_region_needed_size, MiscRegionMinimumSize), MiscRegionAlign); 530 std::max(misc_region_needed_size, MiscRegionMinimumSize), MiscRegionAlign);
531 ASSERT(misc_region_size > 0); 531 ASSERT(misc_region_size > 0);
@@ -541,8 +541,8 @@ struct KernelCore::Impl {
541 const bool use_extra_resources = KSystemControl::Init::ShouldIncreaseThreadResourceLimit(); 541 const bool use_extra_resources = KSystemControl::Init::ShouldIncreaseThreadResourceLimit();
542 542
543 // Setup the stack region. 543 // Setup the stack region.
544 constexpr size_t StackRegionSize = 14_MiB; 544 constexpr static size_t StackRegionSize = 14_MiB;
545 constexpr size_t StackRegionAlign = KernelAslrAlignment; 545 constexpr static size_t StackRegionAlign = KernelAslrAlignment;
546 const VAddr stack_region_start = 546 const VAddr stack_region_start =
547 memory_layout->GetVirtualMemoryRegionTree().GetRandomAlignedRegion( 547 memory_layout->GetVirtualMemoryRegionTree().GetRandomAlignedRegion(
548 StackRegionSize, StackRegionAlign, KMemoryRegionType_Kernel); 548 StackRegionSize, StackRegionAlign, KMemoryRegionType_Kernel);
@@ -563,7 +563,7 @@ struct KernelCore::Impl {
563 const PAddr code_end_phys_addr = code_start_phys_addr + code_region_size; 563 const PAddr code_end_phys_addr = code_start_phys_addr + code_region_size;
564 const PAddr slab_start_phys_addr = code_end_phys_addr; 564 const PAddr slab_start_phys_addr = code_end_phys_addr;
565 const PAddr slab_end_phys_addr = slab_start_phys_addr + slab_region_size; 565 const PAddr slab_end_phys_addr = slab_start_phys_addr + slab_region_size;
566 constexpr size_t SlabRegionAlign = KernelAslrAlignment; 566 constexpr static size_t SlabRegionAlign = KernelAslrAlignment;
567 const size_t slab_region_needed_size = 567 const size_t slab_region_needed_size =
568 Common::AlignUp(code_end_phys_addr + slab_region_size, SlabRegionAlign) - 568 Common::AlignUp(code_end_phys_addr + slab_region_size, SlabRegionAlign) -
569 Common::AlignDown(code_end_phys_addr, SlabRegionAlign); 569 Common::AlignDown(code_end_phys_addr, SlabRegionAlign);
@@ -575,8 +575,8 @@ struct KernelCore::Impl {
575 slab_region_start, slab_region_size, KMemoryRegionType_KernelSlab)); 575 slab_region_start, slab_region_size, KMemoryRegionType_KernelSlab));
576 576
577 // Setup the temp region. 577 // Setup the temp region.
578 constexpr size_t TempRegionSize = 128_MiB; 578 constexpr static size_t TempRegionSize = 128_MiB;
579 constexpr size_t TempRegionAlign = KernelAslrAlignment; 579 constexpr static size_t TempRegionAlign = KernelAslrAlignment;
580 const VAddr temp_region_start = 580 const VAddr temp_region_start =
581 memory_layout->GetVirtualMemoryRegionTree().GetRandomAlignedRegion( 581 memory_layout->GetVirtualMemoryRegionTree().GetRandomAlignedRegion(
582 TempRegionSize, TempRegionAlign, KMemoryRegionType_Kernel); 582 TempRegionSize, TempRegionAlign, KMemoryRegionType_Kernel);
@@ -656,7 +656,7 @@ struct KernelCore::Impl {
656 ASSERT(linear_extents.GetEndAddress() != 0); 656 ASSERT(linear_extents.GetEndAddress() != 0);
657 657
658 // Setup the linear mapping region. 658 // Setup the linear mapping region.
659 constexpr size_t LinearRegionAlign = 1_GiB; 659 constexpr static size_t LinearRegionAlign = 1_GiB;
660 const PAddr aligned_linear_phys_start = 660 const PAddr aligned_linear_phys_start =
661 Common::AlignDown(linear_extents.GetAddress(), LinearRegionAlign); 661 Common::AlignDown(linear_extents.GetAddress(), LinearRegionAlign);
662 const size_t linear_region_size = 662 const size_t linear_region_size =
@@ -737,11 +737,11 @@ struct KernelCore::Impl {
737 void InitializeHackSharedMemory() { 737 void InitializeHackSharedMemory() {
738 // Setup memory regions for emulated processes 738 // Setup memory regions for emulated processes
739 // TODO(bunnei): These should not be hardcoded regions initialized within the kernel 739 // TODO(bunnei): These should not be hardcoded regions initialized within the kernel
740 constexpr std::size_t hid_size{0x40000}; 740 constexpr static std::size_t hid_size{0x40000};
741 constexpr std::size_t font_size{0x1100000}; 741 constexpr static std::size_t font_size{0x1100000};
742 constexpr std::size_t irs_size{0x8000}; 742 constexpr static std::size_t irs_size{0x8000};
743 constexpr std::size_t time_size{0x1000}; 743 constexpr static std::size_t time_size{0x1000};
744 constexpr std::size_t hidbus_size{0x1000}; 744 constexpr static std::size_t hidbus_size{0x1000};
745 745
746 hid_shared_mem = KSharedMemory::Create(system.Kernel()); 746 hid_shared_mem = KSharedMemory::Create(system.Kernel());
747 font_shared_mem = KSharedMemory::Create(system.Kernel()); 747 font_shared_mem = KSharedMemory::Create(system.Kernel());
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp
index 773319ad8..de322cbf9 100644
--- a/src/core/hle/kernel/process_capability.cpp
+++ b/src/core/hle/kernel/process_capability.cpp
@@ -306,7 +306,7 @@ Result ProcessCapabilities::HandleMapRegionFlags(u32 flags, KPageTable& page_tab
306} 306}
307 307
308Result ProcessCapabilities::HandleInterruptFlags(u32 flags) { 308Result ProcessCapabilities::HandleInterruptFlags(u32 flags) {
309 constexpr u32 interrupt_ignore_value = 0x3FF; 309 constexpr static u32 interrupt_ignore_value = 0x3FF;
310 const u32 interrupt0 = (flags >> 12) & 0x3FF; 310 const u32 interrupt0 = (flags >> 12) & 0x3FF;
311 const u32 interrupt1 = (flags >> 22) & 0x3FF; 311 const u32 interrupt1 = (flags >> 22) & 0x3FF;
312 312
diff --git a/src/core/hle/kernel/svc/svc_activity.cpp b/src/core/hle/kernel/svc/svc_activity.cpp
index 1dcdb7a15..0fd1b3d4c 100644
--- a/src/core/hle/kernel/svc/svc_activity.cpp
+++ b/src/core/hle/kernel/svc/svc_activity.cpp
@@ -16,7 +16,7 @@ Result SetThreadActivity(Core::System& system, Handle thread_handle,
16 thread_activity); 16 thread_activity);
17 17
18 // Validate the activity. 18 // Validate the activity.
19 constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { 19 constexpr static auto IsValidThreadActivity = [](ThreadActivity activity) {
20 return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused; 20 return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused;
21 }; 21 };
22 R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue); 22 R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue);
diff --git a/src/core/hle/kernel/svc/svc_info.cpp b/src/core/hle/kernel/svc/svc_info.cpp
index ad56e2fe6..c30ba0295 100644
--- a/src/core/hle/kernel/svc/svc_info.cpp
+++ b/src/core/hle/kernel/svc/svc_info.cpp
@@ -193,7 +193,7 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
193 return ResultSuccess; 193 return ResultSuccess;
194 194
195 case InfoType::ThreadTickCount: { 195 case InfoType::ThreadTickCount: {
196 constexpr u64 num_cpus = 4; 196 constexpr static u64 num_cpus = 4;
197 if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id >= num_cpus) { 197 if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id >= num_cpus) {
198 LOG_ERROR(Kernel_SVC, "Core count is out of range, expected {} but got {}", num_cpus, 198 LOG_ERROR(Kernel_SVC, "Core count is out of range, expected {} but got {}", num_cpus,
199 info_sub_id); 199 info_sub_id);
diff --git a/src/core/hle/kernel/svc/svc_memory.cpp b/src/core/hle/kernel/svc/svc_memory.cpp
index 21f818da6..7045c5e69 100644
--- a/src/core/hle/kernel/svc/svc_memory.cpp
+++ b/src/core/hle/kernel/svc/svc_memory.cpp
@@ -132,7 +132,7 @@ Result SetMemoryAttribute(Core::System& system, VAddr address, u64 size, u32 mas
132 R_UNLESS((address < address + size), ResultInvalidCurrentMemory); 132 R_UNLESS((address < address + size), ResultInvalidCurrentMemory);
133 133
134 // Validate the attribute and mask. 134 // Validate the attribute and mask.
135 constexpr u32 SupportedMask = static_cast<u32>(MemoryAttribute::Uncached); 135 constexpr static u32 SupportedMask = static_cast<u32>(MemoryAttribute::Uncached);
136 R_UNLESS((mask | attr) == mask, ResultInvalidCombination); 136 R_UNLESS((mask | attr) == mask, ResultInvalidCombination);
137 R_UNLESS((mask | attr | SupportedMask) == SupportedMask, ResultInvalidCombination); 137 R_UNLESS((mask | attr | SupportedMask) == SupportedMask, ResultInvalidCombination);
138 138