diff --git a/include/lib/util_base.h b/include/lib/util_base.h index 6f0f78b2..60c9561b 100644 --- a/include/lib/util_base.h +++ b/include/lib/util_base.h @@ -14,6 +14,7 @@ #include #include +#include "zt_common.h" void util_hexdump(FILE *fh, const char *tag, const void *data, int cnt); void util_hexdump_grp(FILE *fh, const char *tag, const void *data, int group, @@ -22,22 +23,6 @@ void util_print_indented(const char *str, int indent); #define UTIL_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) -#define MIN(x, y) \ -({ \ - __typeof__(x) _x = (x); \ - __typeof__(y) _y = (y); \ - \ - _x < _y ? _x : _y; \ -}) - -#define MAX(x, y) \ -({ \ - __typeof__(x) _x = (x); \ - __typeof__(y) _y = (y); \ - \ - _x > _y ? _x : _y; \ -}) - static inline void util_ptr_vec_free(void **ptr_vec, int count) { int i; diff --git a/include/lib/zt_common.h b/include/lib/zt_common.h index 00c5f9a4..5269e0ed 100644 --- a/include/lib/zt_common.h +++ b/include/lib/zt_common.h @@ -67,6 +67,23 @@ #define barrier() __asm__ __volatile__("": : :"memory") +#undef MIN +#define MIN(x, y) \ + ({ \ + __typeof__(x) _x = (x); \ + __typeof__(y) _y = (y); \ + \ + _x < _y ? _x : _y; \ + }) + +#undef MAX +#define MAX(x, y) \ + ({ \ + __typeof__(x) _x = (x); \ + __typeof__(y) _y = (y); \ + \ + _x > _y ? _x : _y; \ + }) typedef unsigned long long u64; typedef signed long long s64; diff --git a/zipl/boot/s390.h b/zipl/boot/s390.h index 219be2fa..ec7c321c 100644 --- a/zipl/boot/s390.h +++ b/zipl/boot/s390.h @@ -15,7 +15,6 @@ #include "libc.h" #include "boot/sigp.h" -#define MIN(x, y) ((x) < (y) ? (x) : (y)) /* * Helper macro for exception table entries