From 24fe8c1d1b75185f341ec2d0efc6c34f0b9263f1 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 9 Dec 2019 16:24:38 +0100 Subject: [PATCH] zipl: move __always_inline/barrier/__pa32/pa to zt_common.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move `__always_inline/barrier/__pa32/pa` to `lib/zt_common.h` as this is non-architecture dependent code. Reviewed-by: Philipp Rudo Reviewed-by: Stefan Haberland Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- include/lib/zt_common.h | 12 ++++++++++++ zipl/boot/s390.h | 9 --------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/lib/zt_common.h b/include/lib/zt_common.h index 716e7d16..00c5f9a4 100644 --- a/include/lib/zt_common.h +++ b/include/lib/zt_common.h @@ -55,6 +55,18 @@ #define __may_alias __attribute__((may_alias)) #define __section(x) __attribute__((__section__(#x))) #define __noinline __attribute__((__noinline__)) +/* The Linux kernel (in stddef.h) and glibc (sys/cdefs.h) define + * __always_inline. Therefore undefine it first to allow the headers + * to be included first. + */ +#undef __always_inline +#define __always_inline inline __attribute__((always_inline)) + +#define __pa32(x) ((uint32_t)(unsigned long)(x)) +#define __pa(x) ((unsigned long)(x)) + +#define barrier() __asm__ __volatile__("": : :"memory") + typedef unsigned long long u64; typedef signed long long s64; diff --git a/zipl/boot/s390.h b/zipl/boot/s390.h index c2cd936b..219be2fa 100644 --- a/zipl/boot/s390.h +++ b/zipl/boot/s390.h @@ -15,16 +15,7 @@ #include "libc.h" #include "boot/sigp.h" -#define __pa32(x) ((uint32_t)(unsigned long)(x)) -#define __pa(x) ((unsigned long)(x)) #define MIN(x, y) ((x) < (y) ? (x) : (y)) -#define barrier() __asm__ __volatile__("": : :"memory") -/* The Linux kernel (in stddef.h) and glibc (sys/cdefs.h) define - * __always_inline. Therefore undefine it first to allow the headers - * to be included first. - */ -#undef __always_inline -#define __always_inline inline __attribute__((always_inline)) /* * Helper macro for exception table entries