mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
Kernel/riscv64: Use ALWAYS_INLINE
instead of inline
in CSR header
This fixes building the kernel with `-Og` when using GCC.
This commit is contained in:
parent
f04a2b81be
commit
4cd1e4d69e
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/4cd1e4d69e Pull-request: https://github.com/SerenityOS/serenity/pull/22265 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 9 additions and 9 deletions
|
@ -31,7 +31,7 @@ enum class Address : u16 {
|
|||
TIME = 0xc01,
|
||||
};
|
||||
|
||||
inline FlatPtr read(Address address)
|
||||
ALWAYS_INLINE FlatPtr read(Address address)
|
||||
{
|
||||
FlatPtr ret;
|
||||
asm volatile("csrr %0, %1"
|
||||
|
@ -40,12 +40,12 @@ inline FlatPtr read(Address address)
|
|||
return ret;
|
||||
}
|
||||
|
||||
inline void write(Address address, FlatPtr value)
|
||||
ALWAYS_INLINE void write(Address address, FlatPtr value)
|
||||
{
|
||||
asm volatile("csrw %0, %1" ::"i"(address), "Kr"(value));
|
||||
}
|
||||
|
||||
inline FlatPtr read_and_set_bits(Address address, FlatPtr bit_mask)
|
||||
ALWAYS_INLINE FlatPtr read_and_set_bits(Address address, FlatPtr bit_mask)
|
||||
{
|
||||
FlatPtr ret;
|
||||
asm volatile("csrrs %0, %1, %2"
|
||||
|
@ -54,12 +54,12 @@ inline FlatPtr read_and_set_bits(Address address, FlatPtr bit_mask)
|
|||
return ret;
|
||||
}
|
||||
|
||||
inline void set_bits(Address address, FlatPtr bit_mask)
|
||||
ALWAYS_INLINE void set_bits(Address address, FlatPtr bit_mask)
|
||||
{
|
||||
asm volatile("csrs %0, %1" ::"i"(address), "Kr"(bit_mask));
|
||||
}
|
||||
|
||||
inline void clear_bits(Address address, FlatPtr bit_mask)
|
||||
ALWAYS_INLINE void clear_bits(Address address, FlatPtr bit_mask)
|
||||
{
|
||||
asm volatile("csrc %0, %1" ::"i"(address), "Kr"(bit_mask));
|
||||
}
|
||||
|
@ -82,12 +82,12 @@ struct [[gnu::packed]] alignas(u64) SATP {
|
|||
// Current address-translation scheme
|
||||
Mode MODE : 4;
|
||||
|
||||
static inline void write(SATP satp)
|
||||
static ALWAYS_INLINE void write(SATP satp)
|
||||
{
|
||||
CSR::write(CSR::Address::SATP, bit_cast<FlatPtr>(satp));
|
||||
}
|
||||
|
||||
static inline SATP read()
|
||||
static ALWAYS_INLINE SATP read()
|
||||
{
|
||||
return bit_cast<SATP>(CSR::read(CSR::Address::SATP));
|
||||
}
|
||||
|
@ -203,12 +203,12 @@ struct [[gnu::packed]] alignas(u64) SSTATUS {
|
|||
// presence of some dirty state that will require saving extended user context to memory.
|
||||
u64 SD : 1;
|
||||
|
||||
static inline void write(SSTATUS sstatus)
|
||||
static ALWAYS_INLINE void write(SSTATUS sstatus)
|
||||
{
|
||||
CSR::write(CSR::Address::SSTATUS, bit_cast<FlatPtr>(sstatus));
|
||||
}
|
||||
|
||||
static inline SSTATUS read()
|
||||
static ALWAYS_INLINE SSTATUS read()
|
||||
{
|
||||
return bit_cast<SSTATUS>(CSR::read(CSR::Address::SSTATUS));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue