From d4bbb78a27a9342efb694caa6e7f73ee37b029dc Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Sun, 1 Mar 2020 16:01:31 +0000 Subject: [PATCH] thermosphere: static inline -> inline --- thermosphere/src/cpu/hvisor_cpu_caches.hpp | 10 +++++----- thermosphere/src/cpu/hvisor_cpu_instructions.hpp | 6 +++--- .../src/cpu/hvisor_cpu_interrupt_mask_guard.hpp | 6 +++--- thermosphere/src/hvisor_guest_timers.hpp | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/thermosphere/src/cpu/hvisor_cpu_caches.hpp b/thermosphere/src/cpu/hvisor_cpu_caches.hpp index 32316ae09..399fa1523 100644 --- a/thermosphere/src/cpu/hvisor_cpu_caches.hpp +++ b/thermosphere/src/cpu/hvisor_cpu_caches.hpp @@ -21,13 +21,13 @@ namespace ams::hvisor::cpu { - static inline u32 GetInstructionCachePolicy(void) + inline u32 GetInstructionCachePolicy(void) { u32 ctr = static_cast(THERMOSPHERE_GET_SYSREG(ctr_el0)); return (ctr >> 14) & 3; } - static inline u32 GetSmallestInstructionCacheLineSize(void) + inline u32 GetSmallestInstructionCacheLineSize(void) { u32 ctr = static_cast(THERMOSPHERE_GET_SYSREG(ctr_el0)); u32 shift = ctr & 0xF; @@ -35,7 +35,7 @@ namespace ams::hvisor::cpu { return 4 << shift; } - static inline u32 GetSmallestDataCacheLineSize(void) + inline u32 GetSmallestDataCacheLineSize(void) { u32 ctr = static_cast(THERMOSPHERE_GET_SYSREG(ctr_el0)); u32 shift = (ctr >> 16) & 0xF; @@ -43,13 +43,13 @@ namespace ams::hvisor::cpu { return 4 << shift; } - static inline void InvalidateInstructionCache(void) + ALWAYS_INLINE void InvalidateInstructionCache(void) { __asm__ __volatile__ ("ic ialluis" ::: "memory"); cpu::isb(); } - static inline void InvalidateInstructionCacheLocal(void) + ALWAYS_INLINE void InvalidateInstructionCacheLocal(void) { __asm__ __volatile__ ("ic iallu" ::: "memory"); cpu::isb(); diff --git a/thermosphere/src/cpu/hvisor_cpu_instructions.hpp b/thermosphere/src/cpu/hvisor_cpu_instructions.hpp index 6a454f113..9d636460c 100644 --- a/thermosphere/src/cpu/hvisor_cpu_instructions.hpp +++ b/thermosphere/src/cpu/hvisor_cpu_instructions.hpp @@ -24,8 +24,8 @@ res;\ }) -#define DECLARE_SINGLE_ASM_INSN2(name, what) static inline void name() { __asm__ __volatile__ (what ::: "memory"); } -#define DECLARE_SINGLE_ASM_INSN(name) static inline void name() { __asm__ __volatile__ (STRINGIZE(name) ::: "memory"); } +#define DECLARE_SINGLE_ASM_INSN2(name, what) ALWAYS_INLINE void name() { __asm__ __volatile__ (what ::: "memory"); } +#define DECLARE_SINGLE_ASM_INSN(name) ALWAYS_INLINE void name() { __asm__ __volatile__ (STRINGIZE(name) ::: "memory"); } namespace ams::hvisor::cpu { @@ -55,7 +55,7 @@ namespace ams::hvisor::cpu { DECLARE_SINGLE_ASM_INSN2(TlbInvalidateEl1, "tlbi vmalle1is") DECLARE_SINGLE_ASM_INSN2(TlbInvalidateEl1Stage12, "tlbi alle1is") - ALWAYS_INLINE static void TlbInvalidateEl2Page(uintptr_t addr) + ALWAYS_INLINE void TlbInvalidateEl2Page(uintptr_t addr) { __asm__ __volatile__ ("tlbi vae2is, %0" :: "r"(addr) : "memory"); } diff --git a/thermosphere/src/cpu/hvisor_cpu_interrupt_mask_guard.hpp b/thermosphere/src/cpu/hvisor_cpu_interrupt_mask_guard.hpp index c75dc7f23..2403cdc9e 100644 --- a/thermosphere/src/cpu/hvisor_cpu_interrupt_mask_guard.hpp +++ b/thermosphere/src/cpu/hvisor_cpu_interrupt_mask_guard.hpp @@ -20,21 +20,21 @@ namespace ams::hvisor::cpu { - static inline u64 MaskIrq() + ALWAYS_INLINE u64 MaskIrq() { u64 daif = THERMOSPHERE_GET_SYSREG(daif); THERMOSPHERE_SET_SYSREG_IMM(daifset, BIT(1)); return daif; } - static inline u64 UnmaskIrq() + ALWAYS_INLINE u64 UnmaskIrq() { u64 daif = THERMOSPHERE_GET_SYSREG(daif); THERMOSPHERE_SET_SYSREG_IMM(daifclr, BIT(1)); return daif; } - static inline void RestoreInterruptFlags(u64 flags) + ALWAYS_INLINE void RestoreInterruptFlags(u64 flags) { THERMOSPHERE_SET_SYSREG(daif, flags); } diff --git a/thermosphere/src/hvisor_guest_timers.hpp b/thermosphere/src/hvisor_guest_timers.hpp index c37cedeae..c0ce48965 100644 --- a/thermosphere/src/hvisor_guest_timers.hpp +++ b/thermosphere/src/hvisor_guest_timers.hpp @@ -22,12 +22,12 @@ namespace ams::hvisor { - static inline u64 ComputeCntvct(const ExceptionStackFrame *frame) + inline u64 ComputeCntvct(const ExceptionStackFrame *frame) { return frame->cntpct_el0 - currentCoreCtx->GetTotalTimeInHypervisor(); } - static inline void WriteEmulatedPhysicalCompareValue(ExceptionStackFrame *frame, u64 val) + inline void WriteEmulatedPhysicalCompareValue(ExceptionStackFrame *frame, u64 val) { // We lied about the value of cntpct, so we need to compute the time delta // the guest actually intended to use... @@ -36,7 +36,7 @@ namespace ams::hvisor { THERMOSPHERE_SET_SYSREG(cntp_cval_el0, frame->cntpct_el0 + (val - vct)); } - static inline bool CheckRescheduleEmulatedPtimer(ExceptionStackFrame *frame) + inline bool CheckRescheduleEmulatedPtimer(ExceptionStackFrame *frame) { // Evaluate if the timer has really expired in the PoV of the guest kernel. // If not, reschedule (add missed time delta) it & exit early @@ -53,14 +53,14 @@ namespace ams::hvisor { return true; } - static inline void EnableGuestTimerTraps(void) + ALWAYS_INLINE void EnableGuestTimerTraps(void) { // Disable event streams, trap everything u64 cnthctl = 0; THERMOSPHERE_SET_SYSREG(cnthctl_el2, cnthctl); } - static inline void UpdateVirtualOffsetSysreg(void) + ALWAYS_INLINE void UpdateVirtualOffsetSysreg(void) { THERMOSPHERE_SET_SYSREG(cntvoff_el2, currentCoreCtx->GetTotalTimeInHypervisor()); }