mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 18:22:47 +01:00
kernel: remove gratitutous attribute usage
This commit is contained in:
parent
91fd4e30f2
commit
9368e17a92
8 changed files with 24 additions and 29 deletions
|
@ -44,7 +44,7 @@ public:
|
||||||
|
|
||||||
/// Returns a list of all threads managed by the scheduler
|
/// Returns a list of all threads managed by the scheduler
|
||||||
/// This is only safe to iterate while holding the scheduler lock
|
/// This is only safe to iterate while holding the scheduler lock
|
||||||
[[nodiscard]] const std::vector<KThread*>& GetThreadList() const {
|
const std::vector<KThread*>& GetThreadList() const {
|
||||||
return m_thread_list;
|
return m_thread_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public:
|
||||||
void RegisterDummyThreadForWakeup(KThread* thread);
|
void RegisterDummyThreadForWakeup(KThread* thread);
|
||||||
void WakeupWaitingDummyThreads();
|
void WakeupWaitingDummyThreads();
|
||||||
|
|
||||||
[[nodiscard]] LockType& SchedulerLock() {
|
LockType& SchedulerLock() {
|
||||||
return m_scheduler_lock;
|
return m_scheduler_lock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
bool IsInitialized() const override {
|
bool IsInitialized() const override {
|
||||||
return m_is_initialized;
|
return m_is_initialized;
|
||||||
}
|
}
|
||||||
static void PostDestroy([[maybe_unused]] uintptr_t arg) {}
|
static void PostDestroy(uintptr_t arg) {}
|
||||||
|
|
||||||
KProcess* GetOwner() const override {
|
KProcess* GetOwner() const override {
|
||||||
return m_owner;
|
return m_owner;
|
||||||
|
|
|
@ -14,7 +14,7 @@ class KDebug final : public KAutoObjectWithSlabHeapAndContainer<KDebug, KAutoObj
|
||||||
public:
|
public:
|
||||||
explicit KDebug(KernelCore& kernel_) : KAutoObjectWithSlabHeapAndContainer{kernel_} {}
|
explicit KDebug(KernelCore& kernel_) : KAutoObjectWithSlabHeapAndContainer{kernel_} {}
|
||||||
|
|
||||||
static void PostDestroy([[maybe_unused]] uintptr_t arg) {}
|
static void PostDestroy(uintptr_t arg) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Kernel
|
} // namespace Kernel
|
||||||
|
|
|
@ -471,8 +471,8 @@ public:
|
||||||
m_disable_merge_attribute & KMemoryBlockDisableMergeAttribute::AllRight);
|
m_disable_merge_attribute & KMemoryBlockDisableMergeAttribute::AllRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void UpdateDeviceDisableMergeStateForShareLeft(
|
constexpr void UpdateDeviceDisableMergeStateForShareLeft(KMemoryPermission new_perm, bool left,
|
||||||
[[maybe_unused]] KMemoryPermission new_perm, bool left, [[maybe_unused]] bool right) {
|
bool right) {
|
||||||
// New permission/right aren't used.
|
// New permission/right aren't used.
|
||||||
if (left) {
|
if (left) {
|
||||||
m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>(
|
m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>(
|
||||||
|
@ -482,8 +482,8 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void UpdateDeviceDisableMergeStateForShareRight(
|
constexpr void UpdateDeviceDisableMergeStateForShareRight(KMemoryPermission new_perm, bool left,
|
||||||
[[maybe_unused]] KMemoryPermission new_perm, [[maybe_unused]] bool left, bool right) {
|
bool right) {
|
||||||
// New permission/left aren't used.
|
// New permission/left aren't used.
|
||||||
if (right) {
|
if (right) {
|
||||||
m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>(
|
m_disable_merge_attribute = static_cast<KMemoryBlockDisableMergeAttribute>(
|
||||||
|
@ -499,8 +499,7 @@ public:
|
||||||
this->UpdateDeviceDisableMergeStateForShareRight(new_perm, left, right);
|
this->UpdateDeviceDisableMergeStateForShareRight(new_perm, left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void ShareToDevice([[maybe_unused]] KMemoryPermission new_perm, bool left,
|
constexpr void ShareToDevice(KMemoryPermission new_perm, bool left, bool right) {
|
||||||
bool right) {
|
|
||||||
// New permission isn't used.
|
// New permission isn't used.
|
||||||
|
|
||||||
// We must either be shared or have a zero lock count.
|
// We must either be shared or have a zero lock count.
|
||||||
|
@ -516,8 +515,8 @@ public:
|
||||||
this->UpdateDeviceDisableMergeStateForShare(new_perm, left, right);
|
this->UpdateDeviceDisableMergeStateForShare(new_perm, left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void UpdateDeviceDisableMergeStateForUnshareLeft(
|
constexpr void UpdateDeviceDisableMergeStateForUnshareLeft(KMemoryPermission new_perm,
|
||||||
[[maybe_unused]] KMemoryPermission new_perm, bool left, [[maybe_unused]] bool right) {
|
bool left, bool right) {
|
||||||
// New permission/right aren't used.
|
// New permission/right aren't used.
|
||||||
|
|
||||||
if (left) {
|
if (left) {
|
||||||
|
@ -536,8 +535,8 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void UpdateDeviceDisableMergeStateForUnshareRight(
|
constexpr void UpdateDeviceDisableMergeStateForUnshareRight(KMemoryPermission new_perm,
|
||||||
[[maybe_unused]] KMemoryPermission new_perm, [[maybe_unused]] bool left, bool right) {
|
bool left, bool right) {
|
||||||
// New permission/left aren't used.
|
// New permission/left aren't used.
|
||||||
|
|
||||||
if (right) {
|
if (right) {
|
||||||
|
@ -556,8 +555,7 @@ public:
|
||||||
this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right);
|
this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void UnshareToDevice([[maybe_unused]] KMemoryPermission new_perm, bool left,
|
constexpr void UnshareToDevice(KMemoryPermission new_perm, bool left, bool right) {
|
||||||
bool right) {
|
|
||||||
// New permission isn't used.
|
// New permission isn't used.
|
||||||
|
|
||||||
// We must be shared.
|
// We must be shared.
|
||||||
|
@ -575,8 +573,7 @@ public:
|
||||||
this->UpdateDeviceDisableMergeStateForUnshare(new_perm, left, right);
|
this->UpdateDeviceDisableMergeStateForUnshare(new_perm, left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void UnshareToDeviceRight([[maybe_unused]] KMemoryPermission new_perm, bool left,
|
constexpr void UnshareToDeviceRight(KMemoryPermission new_perm, bool left, bool right) {
|
||||||
bool right) {
|
|
||||||
// New permission isn't used.
|
// New permission isn't used.
|
||||||
|
|
||||||
// We must be shared.
|
// We must be shared.
|
||||||
|
@ -594,7 +591,7 @@ public:
|
||||||
this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right);
|
this->UpdateDeviceDisableMergeStateForUnshareRight(new_perm, left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void LockForIpc(KMemoryPermission new_perm, bool left, [[maybe_unused]] bool right) {
|
constexpr void LockForIpc(KMemoryPermission new_perm, bool left, bool right) {
|
||||||
// We must either be locked or have a zero lock count.
|
// We must either be locked or have a zero lock count.
|
||||||
ASSERT((m_attribute & KMemoryAttribute::IpcLocked) == KMemoryAttribute::IpcLocked ||
|
ASSERT((m_attribute & KMemoryAttribute::IpcLocked) == KMemoryAttribute::IpcLocked ||
|
||||||
m_ipc_lock_count == 0);
|
m_ipc_lock_count == 0);
|
||||||
|
@ -626,8 +623,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void UnlockForIpc([[maybe_unused]] KMemoryPermission new_perm, bool left,
|
constexpr void UnlockForIpc(KMemoryPermission new_perm, bool left, bool right) {
|
||||||
[[maybe_unused]] bool right) {
|
|
||||||
// New permission isn't used.
|
// New permission isn't used.
|
||||||
|
|
||||||
// We must be locked.
|
// We must be locked.
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
static KPageBuffer* FromPhysicalAddress(Core::System& system, PAddr phys_addr);
|
static KPageBuffer* FromPhysicalAddress(Core::System& system, PAddr phys_addr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
[[maybe_unused]] alignas(PageSize) std::array<u8, PageSize> m_buffer{};
|
alignas(PageSize) std::array<u8, PageSize> m_buffer{};
|
||||||
};
|
};
|
||||||
static_assert(sizeof(KPageBuffer) == KPageBufferSlabHeap::BufferSize);
|
static_assert(sizeof(KPageBuffer) == KPageBufferSlabHeap::BufferSize);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
void Release(LimitableResource which, s64 value);
|
void Release(LimitableResource which, s64 value);
|
||||||
void Release(LimitableResource which, s64 value, s64 hint);
|
void Release(LimitableResource which, s64 value, s64 hint);
|
||||||
|
|
||||||
static void PostDestroy([[maybe_unused]] uintptr_t arg) {}
|
static void PostDestroy(uintptr_t arg) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using ResourceArray = std::array<s64, static_cast<std::size_t>(LimitableResource::Count)>;
|
using ResourceArray = std::array<s64, static_cast<std::size_t>(LimitableResource::Count)>;
|
||||||
|
|
|
@ -5,9 +5,8 @@
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
Result KSecureSystemResource::Initialize([[maybe_unused]] size_t size,
|
Result KSecureSystemResource::Initialize(size_t size, KResourceLimit* resource_limit,
|
||||||
[[maybe_unused]] KResourceLimit* resource_limit,
|
KMemoryManager::Pool pool) {
|
||||||
[[maybe_unused]] KMemoryManager::Pool pool) {
|
|
||||||
// Unimplemented
|
// Unimplemented
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -17,8 +16,8 @@ void KSecureSystemResource::Finalize() {
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t KSecureSystemResource::CalculateRequiredSecureMemorySize(
|
size_t KSecureSystemResource::CalculateRequiredSecureMemorySize(size_t size,
|
||||||
[[maybe_unused]] size_t size, [[maybe_unused]] KMemoryManager::Pool pool) {
|
KMemoryManager::Pool pool) {
|
||||||
// Unimplemented
|
// Unimplemented
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ public:
|
||||||
bool IsInitialized() const {
|
bool IsInitialized() const {
|
||||||
return m_is_initialized;
|
return m_is_initialized;
|
||||||
}
|
}
|
||||||
static void PostDestroy([[maybe_unused]] uintptr_t arg) {}
|
static void PostDestroy(uintptr_t arg) {}
|
||||||
|
|
||||||
size_t CalculateRequiredSecureMemorySize() const {
|
size_t CalculateRequiredSecureMemorySize() const {
|
||||||
return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool);
|
return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool);
|
||||||
|
|
Loading…
Reference in a new issue