summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Liam2023-03-07 09:25:12 -0500
committerGravatar Liam2023-03-12 22:09:09 -0400
commit9368e17a92815744ffed8db7a0fd638708426879 (patch)
tree006dfb49277dbb5a899d68b69f9cfd543d349f1a
parentkernel/svc: convert to new style (diff)
downloadyuzu-9368e17a92815744ffed8db7a0fd638708426879.tar.gz
yuzu-9368e17a92815744ffed8db7a0fd638708426879.tar.xz
yuzu-9368e17a92815744ffed8db7a0fd638708426879.zip
kernel: remove gratitutous attribute usage
-rw-r--r--src/core/hle/kernel/global_scheduler_context.h4
-rw-r--r--src/core/hle/kernel/k_code_memory.h2
-rw-r--r--src/core/hle/kernel/k_debug.h2
-rw-r--r--src/core/hle/kernel/k_memory_block.h30
-rw-r--r--src/core/hle/kernel/k_page_buffer.h2
-rw-r--r--src/core/hle/kernel/k_resource_limit.h2
-rw-r--r--src/core/hle/kernel/k_system_resource.cpp9
-rw-r--r--src/core/hle/kernel/k_system_resource.h2
8 files changed, 24 insertions, 29 deletions
diff --git a/src/core/hle/kernel/global_scheduler_context.h b/src/core/hle/kernel/global_scheduler_context.h
index b7fb8caec..c48e8cd12 100644
--- a/src/core/hle/kernel/global_scheduler_context.h
+++ b/src/core/hle/kernel/global_scheduler_context.h
@@ -44,7 +44,7 @@ public:
44 44
45 /// Returns a list of all threads managed by the scheduler 45 /// Returns a list of all threads managed by the scheduler
46 /// This is only safe to iterate while holding the scheduler lock 46 /// This is only safe to iterate while holding the scheduler lock
47 [[nodiscard]] const std::vector<KThread*>& GetThreadList() const { 47 const std::vector<KThread*>& GetThreadList() const {
48 return m_thread_list; 48 return m_thread_list;
49 } 49 }
50 50
@@ -64,7 +64,7 @@ public:
64 void RegisterDummyThreadForWakeup(KThread* thread); 64 void RegisterDummyThreadForWakeup(KThread* thread);
65 void WakeupWaitingDummyThreads(); 65 void WakeupWaitingDummyThreads();
66 66
67 [[nodiscard]] LockType& SchedulerLock() { 67 LockType& SchedulerLock() {
68 return m_scheduler_lock; 68 return m_scheduler_lock;
69 } 69 }
70 70
diff --git a/src/core/hle/kernel/k_code_memory.h b/src/core/hle/kernel/k_code_memory.h
index 5b260b385..fa63c18df 100644
--- a/src/core/hle/kernel/k_code_memory.h
+++ b/src/core/hle/kernel/k_code_memory.h
@@ -42,7 +42,7 @@ public:
42 bool IsInitialized() const override { 42 bool IsInitialized() const override {
43 return m_is_initialized; 43 return m_is_initialized;
44 } 44 }
45 static void PostDestroy([[maybe_unused]] uintptr_t arg) {} 45 static void PostDestroy(uintptr_t arg) {}
46 46
47 KProcess* GetOwner() const override { 47 KProcess* GetOwner() const override {
48 return m_owner; 48 return m_owner;
diff --git a/src/core/hle/kernel/k_debug.h b/src/core/hle/kernel/k_debug.h
index e3a0689c8..9ffcf27d1 100644
--- a/src/core/hle/kernel/k_debug.h
+++ b/src/core/hle/kernel/k_debug.h
@@ -14,7 +14,7 @@ class KDebug final : public KAutoObjectWithSlabHeapAndContainer<KDebug, KAutoObj
14public: 14public:
15 explicit KDebug(KernelCore& kernel_) : KAutoObjectWithSlabHeapAndContainer{kernel_} {} 15 explicit KDebug(KernelCore& kernel_) : KAutoObjectWithSlabHeapAndContainer{kernel_} {}
16 16
17 static void PostDestroy([[maybe_unused]] uintptr_t arg) {} 17 static void PostDestroy(uintptr_t arg) {}
18}; 18};
19 19
20} // namespace Kernel 20} // namespace Kernel
diff --git a/src/core/hle/kernel/k_memory_block.h b/src/core/hle/kernel/k_memory_block.h
index 87ca65592..e01929da6 100644
--- a/src/core/hle/kernel/k_memory_block.h
+++ b/src/core/hle/kernel/k_memory_block.h
@@ -471,8 +471,8 @@ public:
471 m_disable_merge_attribute & KMemoryBlockDisableMergeAttribute::AllRight); 471 m_disable_merge_attribute & KMemoryBlockDisableMergeAttribute::AllRight);
472 } 472 }
473 473
474 constexpr void UpdateDeviceDisableMergeStateForShareLeft( 474 constexpr void UpdateDeviceDisableMergeStateForShareLeft(KMemoryPermission new_perm, bool left,
475 [[maybe_unused]] KMemoryPermission new_perm, bool left, [[maybe_unused]] bool right) { 475 bool right) {
476 // New permission/right aren't used. 476 // New permission/right aren't used.
477 if (left) { 477 if (left) {
478 m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>( 478 m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>(
@@ -482,8 +482,8 @@ public:
482 } 482 }
483 } 483 }
484 484
485 constexpr void UpdateDeviceDisableMergeStateForShareRight( 485 constexpr void UpdateDeviceDisableMergeStateForShareRight(KMemoryPermission new_perm, bool left,
486 [[maybe_unused]] KMemoryPermission new_perm, [[maybe_unused]] bool left, bool right) { 486 bool right) {
487 // New permission/left aren't used. 487 // New permission/left aren't used.
488 if (right) { 488 if (right) {
489 m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>( 489 m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>(
@@ -499,8 +499,7 @@ public:
499 this->UpdateDeviceDisableMergeStateForShareRight(new_perm, left, right); 499 this->UpdateDeviceDisableMergeStateForShareRight(new_perm, left, right);
500 } 500 }
501 501
502 constexpr void ShareToDevice([[maybe_unused]] KMemoryPermission new_perm, bool left, 502 constexpr void ShareToDevice(KMemoryPermission new_perm, bool left, bool right) {
503 bool right) {
504 // New permission isn't used. 503 // New permission isn't used.
505 504
506 // We must either be shared or have a zero lock count. 505 // We must either be shared or have a zero lock count.
@@ -516,8 +515,8 @@ public:
516 this->UpdateDeviceDisableMergeStateForShare(new_perm, left, right); 515 this->UpdateDeviceDisableMergeStateForShare(new_perm, left, right);
517 } 516 }
518 517
519 constexpr void UpdateDeviceDisableMergeStateForUnshareLeft( 518 constexpr void UpdateDeviceDisableMergeStateForUnshareLeft(KMemoryPermission new_perm,
520 [[maybe_unused]] KMemoryPermission new_perm, bool left, [[maybe_unused]] bool right) { 519 bool left, bool right) {
521 // New permission/right aren't used. 520 // New permission/right aren't used.
522 521
523 if (left) { 522 if (left) {
@@ -536,8 +535,8 @@ public:
536 } 535 }
537 } 536 }
538 537
539 constexpr void UpdateDeviceDisableMergeStateForUnshareRight( 538 constexpr void UpdateDeviceDisableMergeStateForUnshareRight(KMemoryPermission new_perm,
540 [[maybe_unused]] KMemoryPermission new_perm, [[maybe_unused]] bool left, bool right) { 539 bool left, bool right) {
541 // New permission/left aren't used. 540 // New permission/left aren't used.
542 541
543 if (right) { 542 if (right) {
@@ -556,8 +555,7 @@ public:
556 this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right); 555 this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right);
557 } 556 }
558 557
559 constexpr void UnshareToDevice([[maybe_unused]] KMemoryPermission new_perm, bool left, 558 constexpr void UnshareToDevice(KMemoryPermission new_perm, bool left, bool right) {
560 bool right) {
561 // New permission isn't used. 559 // New permission isn't used.
562 560
563 // We must be shared. 561 // We must be shared.
@@ -575,8 +573,7 @@ public:
575 this->UpdateDeviceDisableMergeStateForUnshare(new_perm, left, right); 573 this->UpdateDeviceDisableMergeStateForUnshare(new_perm, left, right);
576 } 574 }
577 575
578 constexpr void UnshareToDeviceRight([[maybe_unused]] KMemoryPermission new_perm, bool left, 576 constexpr void UnshareToDeviceRight(KMemoryPermission new_perm, bool left, bool right) {
579 bool right) {
580 // New permission isn't used. 577 // New permission isn't used.
581 578
582 // We must be shared. 579 // We must be shared.
@@ -594,7 +591,7 @@ public:
594 this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right); 591 this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right);
595 } 592 }
596 593
597 constexpr void LockForIpc(KMemoryPermission new_perm, bool left, [[maybe_unused]] bool right) { 594 constexpr void LockForIpc(KMemoryPermission new_perm, bool left, bool right) {
598 // We must either be locked or have a zero lock count. 595 // We must either be locked or have a zero lock count.
599 ASSERT((m_attribute & KMemoryAttribute::IpcLocked) == KMemoryAttribute::IpcLocked || 596 ASSERT((m_attribute & KMemoryAttribute::IpcLocked) == KMemoryAttribute::IpcLocked ||
600 m_ipc_lock_count == 0); 597 m_ipc_lock_count == 0);
@@ -626,8 +623,7 @@ public:
626 } 623 }
627 } 624 }
628 625
629 constexpr void UnlockForIpc([[maybe_unused]] KMemoryPermission new_perm, bool left, 626 constexpr void UnlockForIpc(KMemoryPermission new_perm, bool left, bool right) {
630 [[maybe_unused]] bool right) {
631 // New permission isn't used. 627 // New permission isn't used.
632 628
633 // We must be locked. 629 // We must be locked.
diff --git a/src/core/hle/kernel/k_page_buffer.h b/src/core/hle/kernel/k_page_buffer.h
index cfedaae61..b7a3ccb4a 100644
--- a/src/core/hle/kernel/k_page_buffer.h
+++ b/src/core/hle/kernel/k_page_buffer.h
@@ -29,7 +29,7 @@ public:
29 static KPageBuffer* FromPhysicalAddress(Core::System& system, PAddr phys_addr); 29 static KPageBuffer* FromPhysicalAddress(Core::System& system, PAddr phys_addr);
30 30
31private: 31private:
32 [[maybe_unused]] alignas(PageSize) std::array<u8, PageSize> m_buffer{}; 32 alignas(PageSize) std::array<u8, PageSize> m_buffer{};
33}; 33};
34static_assert(sizeof(KPageBuffer) == KPageBufferSlabHeap::BufferSize); 34static_assert(sizeof(KPageBuffer) == KPageBufferSlabHeap::BufferSize);
35 35
diff --git a/src/core/hle/kernel/k_resource_limit.h b/src/core/hle/kernel/k_resource_limit.h
index 2573d1b7c..bc4f48e15 100644
--- a/src/core/hle/kernel/k_resource_limit.h
+++ b/src/core/hle/kernel/k_resource_limit.h
@@ -46,7 +46,7 @@ public:
46 void Release(LimitableResource which, s64 value); 46 void Release(LimitableResource which, s64 value);
47 void Release(LimitableResource which, s64 value, s64 hint); 47 void Release(LimitableResource which, s64 value, s64 hint);
48 48
49 static void PostDestroy([[maybe_unused]] uintptr_t arg) {} 49 static void PostDestroy(uintptr_t arg) {}
50 50
51private: 51private:
52 using ResourceArray = std::array<s64, static_cast<std::size_t>(LimitableResource::Count)>; 52 using ResourceArray = std::array<s64, static_cast<std::size_t>(LimitableResource::Count)>;
diff --git a/src/core/hle/kernel/k_system_resource.cpp b/src/core/hle/kernel/k_system_resource.cpp
index 4cc377a6c..e6c8d589a 100644
--- a/src/core/hle/kernel/k_system_resource.cpp
+++ b/src/core/hle/kernel/k_system_resource.cpp
@@ -5,9 +5,8 @@
5 5
6namespace Kernel { 6namespace Kernel {
7 7
8Result KSecureSystemResource::Initialize([[maybe_unused]] size_t size, 8Result KSecureSystemResource::Initialize(size_t size, KResourceLimit* resource_limit,
9 [[maybe_unused]] KResourceLimit* resource_limit, 9 KMemoryManager::Pool pool) {
10 [[maybe_unused]] KMemoryManager::Pool pool) {
11 // Unimplemented 10 // Unimplemented
12 UNREACHABLE(); 11 UNREACHABLE();
13} 12}
@@ -17,8 +16,8 @@ void KSecureSystemResource::Finalize() {
17 UNREACHABLE(); 16 UNREACHABLE();
18} 17}
19 18
20size_t KSecureSystemResource::CalculateRequiredSecureMemorySize( 19size_t KSecureSystemResource::CalculateRequiredSecureMemorySize(size_t size,
21 [[maybe_unused]] size_t size, [[maybe_unused]] KMemoryManager::Pool pool) { 20 KMemoryManager::Pool pool) {
22 // Unimplemented 21 // Unimplemented
23 UNREACHABLE(); 22 UNREACHABLE();
24} 23}
diff --git a/src/core/hle/kernel/k_system_resource.h b/src/core/hle/kernel/k_system_resource.h
index 9a991f725..aec058a95 100644
--- a/src/core/hle/kernel/k_system_resource.h
+++ b/src/core/hle/kernel/k_system_resource.h
@@ -99,7 +99,7 @@ public:
99 bool IsInitialized() const { 99 bool IsInitialized() const {
100 return m_is_initialized; 100 return m_is_initialized;
101 } 101 }
102 static void PostDestroy([[maybe_unused]] uintptr_t arg) {} 102 static void PostDestroy(uintptr_t arg) {}
103 103
104 size_t CalculateRequiredSecureMemorySize() const { 104 size_t CalculateRequiredSecureMemorySize() const {
105 return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool); 105 return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool);