From afa00ec5e1585555f94de63427f38be481554a3e Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 4 Dec 2024 22:50:25 +0000 Subject: [PATCH] configure.ac: drop custom big-endian macros, rely on --- configure.ac | 20 -------------------- src/bits.h | 2 ++ src/decoder/_decoder.h | 1 + src/simmem.h | 3 +++ src/std.h | 22 ---------------------- src/tlb.h | 2 ++ 6 files changed, 8 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index f3414fa..fe4ce19 100644 --- a/configure.ac +++ b/configure.ac @@ -66,27 +66,7 @@ AC_DEFINE_UNQUOTED([PAGER], ["$PAGER"], [Define to the pager program.]) dnl Initialize maintainer mode AM_MAINTAINER_MODE -dnl Check for host endianness -AC_CACHE_CHECK([whether host byte ordering is defined in sys/param.h], -ski_cv_c_bigendian_compile, -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -]],[[ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN -#error bogus endian macros -#endif -]])], -[ski_cv_c_bigendian_compile=yes], [ski_cv_c_bigendian_compile=no])]) - -AS_IF([test "x$ski_cv_c_bigendian_compile" = xyes], [ -AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, - [define if sys/param.h defines the endiness]) -]) -AC_C_BIGENDIAN - dnl Check for variables & functions - AC_FUNC_ALLOCA dnl Find libelf.h diff --git a/src/bits.h b/src/bits.h index f551844..77e24fc 100644 --- a/src/bits.h +++ b/src/bits.h @@ -22,6 +22,8 @@ #ifndef _SKI_BITS_H #define _SKI_BITS_H +#include + #include "std.h" #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN diff --git a/src/decoder/_decoder.h b/src/decoder/_decoder.h index 34b4b8d..03b443f 100644 --- a/src/decoder/_decoder.h +++ b/src/decoder/_decoder.h @@ -97,6 +97,7 @@ extern TemplateInfo templates[NUM_TEMPL_SBS]; #include #endif /* INLINE */ +# include # include "std.h" #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN diff --git a/src/simmem.h b/src/simmem.h index 858e7cf..151446c 100644 --- a/src/simmem.h +++ b/src/simmem.h @@ -22,6 +22,9 @@ #ifndef _SKI_MEMORY_H_ #define _SKI_MEMORY_H_ +#include +#include + #include "types.h" #include "sim.h" diff --git a/src/std.h b/src/std.h index c927fe5..bd2b484 100644 --- a/src/std.h +++ b/src/std.h @@ -30,26 +30,4 @@ typedef enum {NO, YES} BOOL; -/* What is the host endiannes? */ -#if defined ENDIANESS_IN_SYS_PARAM_H -# include -# include -#else /* !defined ENDIANESS_IN_SYS_PARAM_H */ -# if !defined HAVE_CONFIG_H -# warning "Assuming BIG_ENDIAN" -/* In case we do not have config.h assume BIG_ENDIAN */ -# define BIG_ENDIAN 4321 -# define LITTLE_ENDIAN 1234 -# define BYTE_ORDER BIG_ENDIAN -# else -# define BIG_ENDIAN 4321 -# define LITTLE_ENDIAN 1234 -# ifdef WORDS_BIGENDIAN -# define BYTE_ORDER BIG_ENDIAN -# else -# define BYTE_ORDER LITTLE_ENDIAN -# endif -# endif /* !defined HAVE_CONFIG_H */ -#endif /* !defined ENDIANESS_IN_SYS_PARAM_H */ - #endif /* _SKI_STD_H */ diff --git a/src/tlb.h b/src/tlb.h index adc4d5c..8ef750b 100644 --- a/src/tlb.h +++ b/src/tlb.h @@ -22,6 +22,8 @@ #ifndef _SKI_TLB_H_ #define _SKI_TLB_H_ +#include + #include "simmem.h" #define NDTRS 16