diff options
author | Sven Schnelle <svens@linux.ibm.com> | 2024-04-30 16:29:59 +0200 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2024-05-14 13:37:07 +0200 |
commit | fa2ae4a377c0fbbcbcd4252842e702f7e4187170 (patch) | |
tree | 65c1314e568a499982b2f32377ea7ba8dd6cecde /arch/s390/include | |
parent | 62b672c4ba90e726cc39b5c3d6dffd1ca817e143 (diff) |
s390/idle: Rewrite psw_idle() in C
To ease maintenance and further enhancements, convert
the psw_idle() function to C.
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/processor.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index bbbdc5abe2b2..1e2fc6d6963c 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h @@ -40,6 +40,7 @@ #include <asm/setup.h> #include <asm/runtime_instr.h> #include <asm/irqflags.h> +#include <asm/alternative.h> typedef long (*sys_call_ptr_t)(struct pt_regs *regs); @@ -92,6 +93,14 @@ static inline void get_cpu_id(struct cpuid *ptr) asm volatile("stidp %0" : "=Q" (*ptr)); } +static __always_inline unsigned long get_cpu_timer(void) +{ + unsigned long timer; + + asm volatile("stpt %[timer]" : [timer] "=Q" (timer)); + return timer; +} + void s390_adjust_jiffies(void); void s390_update_cpu_mhz(void); void cpu_detect_mhz_feature(void); @@ -394,6 +403,11 @@ static __always_inline bool regs_irqs_disabled(struct pt_regs *regs) return arch_irqs_disabled_flags(regs->psw.mask); } +static __always_inline void bpon(void) +{ + asm volatile(ALTERNATIVE("nop", ".insn rrf,0xb2e80000,0,0,13,0", 82)); +} + #endif /* __ASSEMBLY__ */ #endif /* __ASM_S390_PROCESSOR_H */ |