1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 19:17:44 +00:00

Kernel: Resolve clang-tidy readability-make-member-function-const

... In files included from Kernel/Thread.cpp or Kernel/Process.cpp

Some places the warning is suppressed, because we do not want a const
object do have non-const access to the returned sub-object.
This commit is contained in:
Andrew Kaster 2021-10-31 15:54:39 -06:00 committed by Andreas Kling
parent a92132e44a
commit 65edc62c02
11 changed files with 18 additions and 14 deletions

View file

@ -160,7 +160,7 @@ struct [[gnu::packed]] IDTEntry
{
}
FlatPtr off()
FlatPtr off() const
{
#if ARCH(I386)
return (u32)offset_2 << 16 & (u32)offset_1;
@ -168,7 +168,7 @@ struct [[gnu::packed]] IDTEntry
return (u64)offset_3 << 32 & (u64)offset_2 << 16 & (u64)offset_1;
#endif
}
IDTEntryType type()
IDTEntryType type() const
{
return IDTEntryType(type_attr.gate_type);
}

View file

@ -93,7 +93,7 @@ public:
}
template<typename T>
ALWAYS_INLINE void out(T value)
ALWAYS_INLINE void out(T value) const
{
static_assert(sizeof(T) <= 4);
if constexpr (sizeof(T) == 4) {
@ -111,7 +111,7 @@ public:
VERIFY_NOT_REACHED();
}
inline void out(u32 value, u8 bit_width)
inline void out(u32 value, u8 bit_width) const
{
if (bit_width == 32) {
IO::out32(get(), value);

View file

@ -77,7 +77,7 @@ private:
class PageTableEntry {
public:
PhysicalPtr physical_page_base() { return PhysicalAddress::physical_page_base(m_raw); }
PhysicalPtr physical_page_base() const { return PhysicalAddress::physical_page_base(m_raw); }
void set_physical_page_base(PhysicalPtr value)
{
m_raw &= 0x8000000000000fffULL;

View file

@ -120,12 +120,12 @@ public:
void detect_hypervisor();
void detect_hypervisor_hyperv(CPUID const& hypervisor_leaf_range);
void idle_begin()
void idle_begin() const
{
s_idle_cpu_mask.fetch_or(1u << m_cpu, AK::MemoryOrder::memory_order_relaxed);
}
void idle_end()
void idle_end() const
{
s_idle_cpu_mask.fetch_and(~(1u << m_cpu), AK::MemoryOrder::memory_order_relaxed);
}