Add a wrapper for the SET PREFIX and STORE PREFIX instructions, and use it instead of using inline assembly everywhere. Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> --- lib/s390x/asm/arch_def.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h index 1a5e3c6..38c9dfa 100644 --- a/lib/s390x/asm/arch_def.h +++ b/lib/s390x/asm/arch_def.h @@ -284,4 +284,17 @@ static inline int servc(uint32_t command, unsigned long sccb) return cc; } +static inline void spx(uint32_t new_prefix) +{ + asm volatile("spx %0" : : "Q" (new_prefix) : "memory"); +} + +static inline uint32_t stpx(void) +{ + uint32_t prefix; + + asm volatile("stpx %0" : "=Q" (prefix)); + return prefix; +} + #endif -- 2.24.1