From c3776f4de5919f6e5f0e7d38a368634b194a4c4d Mon Sep 17 00:00:00 2001 From: John Arbuckle Date: Sun, 9 Sep 2018 11:32:38 -0400 Subject: qemu-common.h: update copyright date to 2018 Currently the copyright date is set to 2017. Update the date to say 2018. Signed-off-by: John Arbuckle Reviewed-by: Stefan Weil Signed-off-by: Thomas Huth --- include/qemu-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu-common.h b/include/qemu-common.h index 85f4749aef..ed60ba251d 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -17,7 +17,7 @@ #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) /* Copyright string for -version arguments, About dialogs, etc */ -#define QEMU_COPYRIGHT "Copyright (c) 2003-2017 " \ +#define QEMU_COPYRIGHT "Copyright (c) 2003-2018 " \ "Fabrice Bellard and the QEMU Project developers" /* Bug reporting information for --help arguments, About dialogs, etc */ -- cgit v1.2.3 From 97ff87c0ed020c2a4b931146e142d67abe852e22 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 26 Sep 2018 17:48:50 +0200 Subject: qemu/compiler: Wrap __attribute__((flatten)) in a macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Older versions of Clang (before 3.5) and GCC (before 4.1) do not support the "__attribute__((flatten))" yet. We don't care about such old versions of GCC anymore, but since Clang 3.4 is still used in EPEL for RHEL7 / CentOS 7, we should not use this attribute directly but with a wrapper macro instead. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- include/qemu/compiler.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index bf47e7bee4..66f8c241dc 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -131,6 +131,21 @@ #define HAS_ASSUME_ALIGNED #endif +#ifndef __has_attribute +#define __has_attribute(x) 0 /* compatibility with older GCC */ +#endif + +/* + * GCC doesn't provide __has_attribute() until GCC 5, but we know all the GCC + * versions we support have the "flatten" attribute. Clang may not have the + * "flatten" attribute but always has __has_attribute() to check for it. + */ +#if __has_attribute(flatten) || !defined(__clang__) +# define QEMU_FLATTEN __attribute__((flatten)) +#else +# define QEMU_FLATTEN +#endif + /* Implement C11 _Generic via GCC builtins. Example: * * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x) -- cgit v1.2.3 From c95ac10340ec42d2e8828b5ddab1c9d0c15dbc0e Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 5 Oct 2018 14:46:02 +0200 Subject: cpu: Provide a proper prototype for target_words_bigendian() in a header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We've got three places already that provide a prototype for this function in a .c file - that's ugly. Let's provide a proper prototype in a header instead, with a proper description why this function should not be used in most cases. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laszlo Ersek Signed-off-by: Thomas Huth --- include/qom/cpu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/qom/cpu.h b/include/qom/cpu.h index dc130cd307..4e238b0d9f 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -1085,6 +1085,17 @@ void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); +/** + * target_words_bigendian: + * Returns true if the (default) endianness of the target is big endian, + * false otherwise. Note that in target-specific code, you can use + * TARGET_WORDS_BIGENDIAN directly instead. On the other hand, common + * code should normally never need to know about the endianness of the + * target, so please do *not* use this function unless you know very well + * what you are doing! + */ +bool target_words_bigendian(void); + #ifdef NEED_CPU_H #ifdef CONFIG_SOFTMMU -- cgit v1.2.3