diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-04-01 20:58:27 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-04-01 21:24:45 +0100 |
commit | 086969277e74d8ba065bf8145d3aeb0dec0bfee5 (patch) | |
tree | 02b3699a66735ef806d9b46353491f18f8e4e7b4 /Kernel/Arch | |
parent | 0376c127f6e98e03607700d0b3f5154b7014b2f8 (diff) | |
download | serenity-086969277e74d8ba065bf8145d3aeb0dec0bfee5.zip |
Everywhere: Run clang-format
Diffstat (limited to 'Kernel/Arch')
-rw-r--r-- | Kernel/Arch/Processor.h | 2 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Prekernel.h | 2 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/PrekernelCommon.cpp | 2 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/PrekernelMMU.cpp | 6 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Processor.h | 4 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/UART.h | 4 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Utils.cpp | 4 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/Utils.h | 4 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/dummy.cpp | 36 | ||||
-rw-r--r-- | Kernel/Arch/aarch64/init.cpp | 2 | ||||
-rw-r--r-- | Kernel/Arch/x86/CPU.h | 8 | ||||
-rw-r--r-- | Kernel/Arch/x86/IO.h | 12 | ||||
-rw-r--r-- | Kernel/Arch/x86/PageDirectory.h | 2 | ||||
-rw-r--r-- | Kernel/Arch/x86/Processor.h | 2 | ||||
-rw-r--r-- | Kernel/Arch/x86/RegisterState.h | 6 | ||||
-rw-r--r-- | Kernel/Arch/x86/SafeMem.h | 22 | ||||
-rw-r--r-- | Kernel/Arch/x86/TSS.h | 2 | ||||
-rw-r--r-- | Kernel/Arch/x86/TrapFrame.h | 4 | ||||
-rw-r--r-- | Kernel/Arch/x86/common/CPU.cpp | 2 | ||||
-rw-r--r-- | Kernel/Arch/x86/common/Interrupts.cpp | 4 | ||||
-rw-r--r-- | Kernel/Arch/x86/common/Processor.cpp | 4 | ||||
-rw-r--r-- | Kernel/Arch/x86/common/SafeMem.cpp | 14 |
22 files changed, 74 insertions, 74 deletions
diff --git a/Kernel/Arch/Processor.h b/Kernel/Arch/Processor.h index 83a322bc47..2b4794e851 100644 --- a/Kernel/Arch/Processor.h +++ b/Kernel/Arch/Processor.h @@ -44,7 +44,7 @@ struct ProcessorMessage { } flush_tlb; }; - volatile bool async; + bool volatile async; ProcessorMessageEntry* per_proc_entries; diff --git a/Kernel/Arch/aarch64/Prekernel.h b/Kernel/Arch/aarch64/Prekernel.h index 4bb284f7cd..1012ad4e3b 100644 --- a/Kernel/Arch/aarch64/Prekernel.h +++ b/Kernel/Arch/aarch64/Prekernel.h @@ -11,7 +11,7 @@ namespace Prekernel { void drop_to_exception_level_1(); void init_prekernel_page_tables(); -[[noreturn]] void panic(const char* msg); +[[noreturn]] void panic(char const* msg); [[noreturn]] void halt(); diff --git a/Kernel/Arch/aarch64/PrekernelCommon.cpp b/Kernel/Arch/aarch64/PrekernelCommon.cpp index 5035ae5ab8..5f7310daa3 100644 --- a/Kernel/Arch/aarch64/PrekernelCommon.cpp +++ b/Kernel/Arch/aarch64/PrekernelCommon.cpp @@ -11,7 +11,7 @@ namespace Prekernel { -[[noreturn]] void panic(const char* msg) +[[noreturn]] void panic(char const* msg) { auto& uart = Prekernel::UART::the(); diff --git a/Kernel/Arch/aarch64/PrekernelMMU.cpp b/Kernel/Arch/aarch64/PrekernelMMU.cpp index 38c953b600..31ec573299 100644 --- a/Kernel/Arch/aarch64/PrekernelMMU.cpp +++ b/Kernel/Arch/aarch64/PrekernelMMU.cpp @@ -91,8 +91,8 @@ private: } } - const u64* m_start; - const u64* m_end; + u64 const* m_start; + u64 const* m_end; u64* m_current; }; } @@ -181,7 +181,7 @@ static void activate_mmu() // Enable MMU in the system control register Aarch64::SCTLR_EL1 sctlr_el1 = Aarch64::SCTLR_EL1::read(); - sctlr_el1.M = 1; //Enable MMU + sctlr_el1.M = 1; // Enable MMU Aarch64::SCTLR_EL1::write(sctlr_el1); Aarch64::Asm::flush(); diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h index f7a5a1e50c..c26963ef53 100644 --- a/Kernel/Arch/aarch64/Processor.h +++ b/Kernel/Arch/aarch64/Processor.h @@ -17,8 +17,8 @@ namespace Kernel { class Thread; -//FIXME This needs to go behind some sort of platform abstraction -// it is used between Thread and Processor. +// FIXME This needs to go behind some sort of platform abstraction +// it is used between Thread and Processor. struct [[gnu::aligned(16)]] FPUState { u8 buffer[512]; diff --git a/Kernel/Arch/aarch64/UART.h b/Kernel/Arch/aarch64/UART.h index 79cef0a166..7b77cda167 100644 --- a/Kernel/Arch/aarch64/UART.h +++ b/Kernel/Arch/aarch64/UART.h @@ -22,7 +22,7 @@ public: void send(u32 c); u32 receive(); - void print_str(const char* s) + void print_str(char const* s) { while (*s) send(*s++); @@ -42,7 +42,7 @@ public: void print_hex(u64 n) { char buf[17]; - static const char* digits = "0123456789ABCDEF"; + static char const* digits = "0123456789ABCDEF"; int i = 0; do { buf[i++] = digits[n % 16]; diff --git a/Kernel/Arch/aarch64/Utils.cpp b/Kernel/Arch/aarch64/Utils.cpp index 92d2f3a7d8..9c9fe88ae9 100644 --- a/Kernel/Arch/aarch64/Utils.cpp +++ b/Kernel/Arch/aarch64/Utils.cpp @@ -7,14 +7,14 @@ #include <Kernel/Arch/aarch64/UART.h> #include <Kernel/Arch/aarch64/Utils.h> -void Prekernel::dbgln(const char* text) +void Prekernel::dbgln(char const* text) { auto& uart = Prekernel::UART::the(); uart.print_str(text); uart.print_str("\r\n"); } -void Prekernel::warnln(const char* text) +void Prekernel::warnln(char const* text) { dbgln(text); } diff --git a/Kernel/Arch/aarch64/Utils.h b/Kernel/Arch/aarch64/Utils.h index 0c25610654..da5eea7ad7 100644 --- a/Kernel/Arch/aarch64/Utils.h +++ b/Kernel/Arch/aarch64/Utils.h @@ -9,7 +9,7 @@ namespace Prekernel { // FIXME: to be replaced by real implementation from AK/Format.h -void dbgln(const char* text); -void warnln(const char* text); +void dbgln(char const* text); +void warnln(char const* text); } diff --git a/Kernel/Arch/aarch64/dummy.cpp b/Kernel/Arch/aarch64/dummy.cpp index 74264c2fa1..0d2fb587cd 100644 --- a/Kernel/Arch/aarch64/dummy.cpp +++ b/Kernel/Arch/aarch64/dummy.cpp @@ -19,9 +19,9 @@ void dummy(); void dummy() { } // Assertions.h -[[noreturn]] void __assertion_failed(const char*, const char*, unsigned, const char*); +[[noreturn]] void __assertion_failed(char const*, char const*, unsigned, char const*); -[[noreturn]] void __assertion_failed(const char*, const char*, unsigned, const char*) +[[noreturn]] void __assertion_failed(char const*, char const*, unsigned, char const*) { for (;;) { } } @@ -58,20 +58,20 @@ ssize_t safe_strnlen(char const*, unsigned long, void*&) { return 0; } bool safe_memcpy(void*, void const*, unsigned long, void*&); bool safe_memcpy(void*, void const*, unsigned long, void*&) { return false; } -Optional<bool> safe_atomic_compare_exchange_relaxed(volatile u32*, u32&, u32); -Optional<bool> safe_atomic_compare_exchange_relaxed(volatile u32*, u32&, u32) { return {}; } +Optional<bool> safe_atomic_compare_exchange_relaxed(u32 volatile*, u32&, u32); +Optional<bool> safe_atomic_compare_exchange_relaxed(u32 volatile*, u32&, u32) { return {}; } -Optional<u32> safe_atomic_load_relaxed(volatile u32*); -Optional<u32> safe_atomic_load_relaxed(volatile u32*) { return {}; } +Optional<u32> safe_atomic_load_relaxed(u32 volatile*); +Optional<u32> safe_atomic_load_relaxed(u32 volatile*) { return {}; } -Optional<u32> safe_atomic_fetch_add_relaxed(volatile u32*, u32); -Optional<u32> safe_atomic_fetch_add_relaxed(volatile u32*, u32) { return {}; } +Optional<u32> safe_atomic_fetch_add_relaxed(u32 volatile*, u32); +Optional<u32> safe_atomic_fetch_add_relaxed(u32 volatile*, u32) { return {}; } -Optional<u32> safe_atomic_exchange_relaxed(volatile u32*, u32); -Optional<u32> safe_atomic_exchange_relaxed(volatile u32*, u32) { return {}; } +Optional<u32> safe_atomic_exchange_relaxed(u32 volatile*, u32); +Optional<u32> safe_atomic_exchange_relaxed(u32 volatile*, u32) { return {}; } -bool safe_atomic_store_relaxed(volatile u32*, u32); -bool safe_atomic_store_relaxed(volatile u32*, u32) { return {}; } +bool safe_atomic_store_relaxed(u32 volatile*, u32); +bool safe_atomic_store_relaxed(u32 volatile*, u32) { return {}; } } @@ -79,12 +79,12 @@ extern "C" { FlatPtr kernel_mapping_base; -void kernelputstr(const char*, size_t); -void kernelputstr(const char*, size_t) { } +void kernelputstr(char const*, size_t); +void kernelputstr(char const*, size_t) { } -void kernelcriticalputstr(const char*, size_t); -void kernelcriticalputstr(const char*, size_t) { } +void kernelcriticalputstr(char const*, size_t); +void kernelcriticalputstr(char const*, size_t) { } -void kernelearlyputstr(const char*, size_t); -void kernelearlyputstr(const char*, size_t) { } +void kernelearlyputstr(char const*, size_t); +void kernelearlyputstr(char const*, size_t) { } } diff --git a/Kernel/Arch/aarch64/init.cpp b/Kernel/Arch/aarch64/init.cpp index bce753da49..a5fc1e16f8 100644 --- a/Kernel/Arch/aarch64/init.cpp +++ b/Kernel/Arch/aarch64/init.cpp @@ -164,7 +164,7 @@ extern "C" const u32 serenity_boot_logo_size; static void draw_logo() { - Prekernel::BootPPMParser logo_parser(reinterpret_cast<const u8*>(&serenity_boot_logo_start), serenity_boot_logo_size); + Prekernel::BootPPMParser logo_parser(reinterpret_cast<u8 const*>(&serenity_boot_logo_start), serenity_boot_logo_size); if (!logo_parser.parse()) { Prekernel::warnln("Invalid boot logo."); return; diff --git a/Kernel/Arch/x86/CPU.h b/Kernel/Arch/x86/CPU.h index 99d579c287..caa946fd28 100644 --- a/Kernel/Arch/x86/CPU.h +++ b/Kernel/Arch/x86/CPU.h @@ -33,8 +33,8 @@ inline u32 get_iopl_from_eflags(u32 eflags) return (eflags & iopl_mask) >> 12; } -const DescriptorTablePointer& get_gdtr(); -const DescriptorTablePointer& get_idtr(); +DescriptorTablePointer const& get_gdtr(); +DescriptorTablePointer const& get_idtr(); void handle_crash(RegisterState const&, char const* description, int signal, bool out_of_memory = false); @@ -48,7 +48,7 @@ constexpr FlatPtr page_base_of(FlatPtr address) return address & PAGE_MASK; } -inline FlatPtr page_base_of(const void* address) +inline FlatPtr page_base_of(void const* address) { return page_base_of((FlatPtr)address); } @@ -58,7 +58,7 @@ constexpr FlatPtr offset_in_page(FlatPtr address) return address & (~PAGE_MASK); } -inline FlatPtr offset_in_page(const void* address) +inline FlatPtr offset_in_page(void const* address) { return offset_in_page((FlatPtr)address); } diff --git a/Kernel/Arch/x86/IO.h b/Kernel/Arch/x86/IO.h index 5dd0c8ac22..f38dfc89bd 100644 --- a/Kernel/Arch/x86/IO.h +++ b/Kernel/Arch/x86/IO.h @@ -133,12 +133,12 @@ public: bool is_null() const { return m_address == 0; } - bool operator==(const IOAddress& other) const { return m_address == other.m_address; } - bool operator!=(const IOAddress& other) const { return m_address != other.m_address; } - bool operator>(const IOAddress& other) const { return m_address > other.m_address; } - bool operator>=(const IOAddress& other) const { return m_address >= other.m_address; } - bool operator<(const IOAddress& other) const { return m_address < other.m_address; } - bool operator<=(const IOAddress& other) const { return m_address <= other.m_address; } + bool operator==(IOAddress const& other) const { return m_address == other.m_address; } + bool operator!=(IOAddress const& other) const { return m_address != other.m_address; } + bool operator>(IOAddress const& other) const { return m_address > other.m_address; } + bool operator>=(IOAddress const& other) const { return m_address >= other.m_address; } + bool operator<(IOAddress const& other) const { return m_address < other.m_address; } + bool operator<=(IOAddress const& other) const { return m_address <= other.m_address; } private: u16 m_address { 0 }; diff --git a/Kernel/Arch/x86/PageDirectory.h b/Kernel/Arch/x86/PageDirectory.h index d0e241e987..7c8e7e2cf9 100644 --- a/Kernel/Arch/x86/PageDirectory.h +++ b/Kernel/Arch/x86/PageDirectory.h @@ -29,7 +29,7 @@ public: void clear() { m_raw = 0; } u64 raw() const { return m_raw; } - void copy_from(Badge<Memory::PageDirectory>, const PageDirectoryEntry& other) { m_raw = other.m_raw; } + void copy_from(Badge<Memory::PageDirectory>, PageDirectoryEntry const& other) { m_raw = other.m_raw; } enum Flags { Present = 1 << 0, diff --git a/Kernel/Arch/x86/Processor.h b/Kernel/Arch/x86/Processor.h index 39418ae8dd..60740dc9dd 100644 --- a/Kernel/Arch/x86/Processor.h +++ b/Kernel/Arch/x86/Processor.h @@ -182,7 +182,7 @@ public: Descriptor& get_gdt_entry(u16 selector); void flush_gdt(); - const DescriptorTablePointer& get_gdtr(); + DescriptorTablePointer const& get_gdtr(); template<IteratorFunction<Processor&> Callback> static inline IterationDecision for_each(Callback callback) diff --git a/Kernel/Arch/x86/RegisterState.h b/Kernel/Arch/x86/RegisterState.h index bc48812bac..42af83a5a1 100644 --- a/Kernel/Arch/x86/RegisterState.h +++ b/Kernel/Arch/x86/RegisterState.h @@ -128,7 +128,7 @@ static_assert(AssertSize<RegisterState, REGISTER_STATE_SIZE>()); static_assert(AssertSize<RegisterState, REGISTER_STATE_SIZE>()); #endif -inline void copy_kernel_registers_into_ptrace_registers(PtraceRegisters& ptrace_regs, const RegisterState& kernel_regs) +inline void copy_kernel_registers_into_ptrace_registers(PtraceRegisters& ptrace_regs, RegisterState const& kernel_regs) { #if ARCH(I386) ptrace_regs.eax = kernel_regs.eax; @@ -169,7 +169,7 @@ inline void copy_kernel_registers_into_ptrace_registers(PtraceRegisters& ptrace_ ptrace_regs.gs = 0; } -inline void copy_ptrace_registers_into_kernel_registers(RegisterState& kernel_regs, const PtraceRegisters& ptrace_regs) +inline void copy_ptrace_registers_into_kernel_registers(RegisterState& kernel_regs, PtraceRegisters const& ptrace_regs) { #if ARCH(I386) kernel_regs.eax = ptrace_regs.eax; @@ -224,7 +224,7 @@ inline void read_debug_registers_into(DebugRegisterState& state) state.dr7 = read_dr7(); } -inline void write_debug_registers_from(const DebugRegisterState& state) +inline void write_debug_registers_from(DebugRegisterState const& state) { write_dr0(state.dr0); write_dr1(state.dr1); diff --git a/Kernel/Arch/x86/SafeMem.h b/Kernel/Arch/x86/SafeMem.h index df90e847b3..df5be2d770 100644 --- a/Kernel/Arch/x86/SafeMem.h +++ b/Kernel/Arch/x86/SafeMem.h @@ -14,16 +14,16 @@ namespace Kernel { struct RegisterState; -[[nodiscard]] bool safe_memcpy(void* dest_ptr, const void* src_ptr, size_t n, void*& fault_at) __attribute__((used)); -[[nodiscard]] ssize_t safe_strnlen(const char* str, size_t max_n, void*& fault_at) __attribute__((used)); +[[nodiscard]] bool safe_memcpy(void* dest_ptr, void const* src_ptr, size_t n, void*& fault_at) __attribute__((used)); +[[nodiscard]] ssize_t safe_strnlen(char const* str, size_t max_n, void*& fault_at) __attribute__((used)); [[nodiscard]] bool safe_memset(void* dest_ptr, int c, size_t n, void*& fault_at) __attribute__((used)); -[[nodiscard]] Optional<u32> safe_atomic_fetch_add_relaxed(volatile u32* var, u32 val) __attribute__((used)); -[[nodiscard]] Optional<u32> safe_atomic_exchange_relaxed(volatile u32* var, u32 val) __attribute__((used)); -[[nodiscard]] Optional<u32> safe_atomic_load_relaxed(volatile u32* var) __attribute__((used)); -[[nodiscard]] bool safe_atomic_store_relaxed(volatile u32* var, u32 val) __attribute__((used)); -[[nodiscard]] Optional<bool> safe_atomic_compare_exchange_relaxed(volatile u32* var, u32& expected, u32 val) __attribute__((used)); +[[nodiscard]] Optional<u32> safe_atomic_fetch_add_relaxed(u32 volatile* var, u32 val) __attribute__((used)); +[[nodiscard]] Optional<u32> safe_atomic_exchange_relaxed(u32 volatile* var, u32 val) __attribute__((used)); +[[nodiscard]] Optional<u32> safe_atomic_load_relaxed(u32 volatile* var) __attribute__((used)); +[[nodiscard]] bool safe_atomic_store_relaxed(u32 volatile* var, u32 val) __attribute__((used)); +[[nodiscard]] Optional<bool> safe_atomic_compare_exchange_relaxed(u32 volatile* var, u32& expected, u32 val) __attribute__((used)); -[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_and_relaxed(volatile u32* var, u32 val) +[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_and_relaxed(u32 volatile* var, u32 val) { auto expected_value = safe_atomic_load_relaxed(var); if (!expected_value.has_value()) @@ -41,7 +41,7 @@ struct RegisterState; } } -[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_and_not_relaxed(volatile u32* var, u32 val) +[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_and_not_relaxed(u32 volatile* var, u32 val) { auto expected_value = safe_atomic_load_relaxed(var); if (!expected_value.has_value()) @@ -59,7 +59,7 @@ struct RegisterState; } } -[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_or_relaxed(volatile u32* var, u32 val) +[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_or_relaxed(u32 volatile* var, u32 val) { auto expected_value = safe_atomic_load_relaxed(var); if (!expected_value.has_value()) @@ -77,7 +77,7 @@ struct RegisterState; } } -[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_xor_relaxed(volatile u32* var, u32 val) +[[nodiscard]] ALWAYS_INLINE Optional<u32> safe_atomic_fetch_xor_relaxed(u32 volatile* var, u32 val) { auto expected_value = safe_atomic_load_relaxed(var); if (!expected_value.has_value()) diff --git a/Kernel/Arch/x86/TSS.h b/Kernel/Arch/x86/TSS.h index ef735ad1f3..03e2a943b9 100644 --- a/Kernel/Arch/x86/TSS.h +++ b/Kernel/Arch/x86/TSS.h @@ -42,7 +42,7 @@ struct [[gnu::packed]] TSS64 { u32 rsp1h; u32 rsp2l; u32 rsp2h; - u64 __2; //probably CR3 and EIP? + u64 __2; // probably CR3 and EIP? u32 ist1l; u32 ist1h; u32 ist2l; diff --git a/Kernel/Arch/x86/TrapFrame.h b/Kernel/Arch/x86/TrapFrame.h index 48e99953d2..33ddaf6917 100644 --- a/Kernel/Arch/x86/TrapFrame.h +++ b/Kernel/Arch/x86/TrapFrame.h @@ -21,9 +21,9 @@ struct TrapFrame { RegisterState* regs; // must be last TrapFrame() = delete; - TrapFrame(const TrapFrame&) = delete; + TrapFrame(TrapFrame const&) = delete; TrapFrame(TrapFrame&&) = delete; - TrapFrame& operator=(const TrapFrame&) = delete; + TrapFrame& operator=(TrapFrame const&) = delete; TrapFrame& operator=(TrapFrame&&) = delete; }; diff --git a/Kernel/Arch/x86/common/CPU.cpp b/Kernel/Arch/x86/common/CPU.cpp index 53afe555d2..c334ffc584 100644 --- a/Kernel/Arch/x86/common/CPU.cpp +++ b/Kernel/Arch/x86/common/CPU.cpp @@ -11,7 +11,7 @@ using namespace Kernel; -void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func) +void __assertion_failed(char const* msg, char const* file, unsigned line, char const* func) { asm volatile("cli"); critical_dmesgln("ASSERTION FAILED: {}", msg); diff --git a/Kernel/Arch/x86/common/Interrupts.cpp b/Kernel/Arch/x86/common/Interrupts.cpp index 7a0cf0e404..e87601130d 100644 --- a/Kernel/Arch/x86/common/Interrupts.cpp +++ b/Kernel/Arch/x86/common/Interrupts.cpp @@ -174,7 +174,7 @@ static EntropySource s_entropy_source_interrupts { EntropySource::Static::Interr // clang-format on -static void dump(const RegisterState& regs) +static void dump(RegisterState const& regs) { #if ARCH(I386) u16 ss; @@ -522,7 +522,7 @@ void handle_interrupt(TrapFrame* trap) handler->eoi(); } -const DescriptorTablePointer& get_idtr() +DescriptorTablePointer const& get_idtr() { return s_idtr; } diff --git a/Kernel/Arch/x86/common/Processor.cpp b/Kernel/Arch/x86/common/Processor.cpp index a0e3908eb9..1cf3a1e6be 100644 --- a/Kernel/Arch/x86/common/Processor.cpp +++ b/Kernel/Arch/x86/common/Processor.cpp @@ -38,7 +38,7 @@ READONLY_AFTER_INIT FPUState Processor::s_clean_fpu_state; READONLY_AFTER_INIT static ProcessorContainer s_processors {}; READONLY_AFTER_INIT Atomic<u32> Processor::g_total_processors; -READONLY_AFTER_INIT static volatile bool s_smp_enabled; +READONLY_AFTER_INIT static bool volatile s_smp_enabled; static Atomic<ProcessorMessage*> s_message_pool; Atomic<u32> Processor::s_idle_cpu_mask { 0 }; @@ -775,7 +775,7 @@ void Processor::flush_gdt() : "memory"); } -const DescriptorTablePointer& Processor::get_gdtr() +DescriptorTablePointer const& Processor::get_gdtr() { return m_gdtr; } diff --git a/Kernel/Arch/x86/common/SafeMem.cpp b/Kernel/Arch/x86/common/SafeMem.cpp index 6a93fef67d..b7acc471e6 100644 --- a/Kernel/Arch/x86/common/SafeMem.cpp +++ b/Kernel/Arch/x86/common/SafeMem.cpp @@ -53,7 +53,7 @@ ALWAYS_INLINE bool validate_canonical_address(size_t address) } CODE_SECTION(".text.safemem") -NEVER_INLINE bool safe_memcpy(void* dest_ptr, const void* src_ptr, size_t n, void*& fault_at) +NEVER_INLINE bool safe_memcpy(void* dest_ptr, void const* src_ptr, size_t n, void*& fault_at) { fault_at = nullptr; size_t dest = (size_t)dest_ptr; @@ -115,7 +115,7 @@ NEVER_INLINE bool safe_memcpy(void* dest_ptr, const void* src_ptr, size_t n, voi } CODE_SECTION(".text.safemem") -NEVER_INLINE ssize_t safe_strnlen(const char* str, size_t max_n, void*& fault_at) +NEVER_INLINE ssize_t safe_strnlen(char const* str, size_t max_n, void*& fault_at) { if (!validate_canonical_address((size_t)str)) { fault_at = const_cast<char*>(str); @@ -210,7 +210,7 @@ NEVER_INLINE bool safe_memset(void* dest_ptr, int c, size_t n, void*& fault_at) } CODE_SECTION(".text.safemem.atomic") -NEVER_INLINE Optional<u32> safe_atomic_fetch_add_relaxed(volatile u32* var, u32 val) +NEVER_INLINE Optional<u32> safe_atomic_fetch_add_relaxed(u32 volatile* var, u32 val) { u32 result; bool error; @@ -230,7 +230,7 @@ NEVER_INLINE Optional<u32> safe_atomic_fetch_add_relaxed(volatile u32* var, u32 } CODE_SECTION(".text.safemem.atomic") -NEVER_INLINE Optional<u32> safe_atomic_exchange_relaxed(volatile u32* var, u32 val) +NEVER_INLINE Optional<u32> safe_atomic_exchange_relaxed(u32 volatile* var, u32 val) { u32 result; bool error; @@ -250,7 +250,7 @@ NEVER_INLINE Optional<u32> safe_atomic_exchange_relaxed(volatile u32* var, u32 v } CODE_SECTION(".text.safemem.atomic") -NEVER_INLINE Optional<u32> safe_atomic_load_relaxed(volatile u32* var) +NEVER_INLINE Optional<u32> safe_atomic_load_relaxed(u32 volatile* var) { u32 result; bool error; @@ -270,7 +270,7 @@ NEVER_INLINE Optional<u32> safe_atomic_load_relaxed(volatile u32* var) } CODE_SECTION(".text.safemem.atomic") -NEVER_INLINE bool safe_atomic_store_relaxed(volatile u32* var, u32 val) +NEVER_INLINE bool safe_atomic_store_relaxed(u32 volatile* var, u32 val) { bool error; asm volatile( @@ -287,7 +287,7 @@ NEVER_INLINE bool safe_atomic_store_relaxed(volatile u32* var, u32 val) } CODE_SECTION(".text.safemem.atomic") -NEVER_INLINE Optional<bool> safe_atomic_compare_exchange_relaxed(volatile u32* var, u32& expected, u32 val) +NEVER_INLINE Optional<bool> safe_atomic_compare_exchange_relaxed(u32 volatile* var, u32& expected, u32 val) { // NOTE: accessing expected is NOT protected as it should always point // to a valid location in kernel memory! |