From 24a6e0633a6bb079a6af406e7fcea2d1ba182100 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 24 May 2016 16:28:04 +0100 Subject: hw: Clean up includes Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- include/exec/hwaddr.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/exec') diff --git a/include/exec/hwaddr.h b/include/exec/hwaddr.h index bb41588b9d..a71c93cc81 100644 --- a/include/exec/hwaddr.h +++ b/include/exec/hwaddr.h @@ -3,7 +3,6 @@ #ifndef HWADDR_H #define HWADDR_H -#include #define HWADDR_BITS 64 /* hwaddr is the type of a physical address (its size can -- cgit v1.2.3-55-g7522 From 0d5c21f2b3bf1e0b562a2c74e353d2e03f2f50ef Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 2 Jun 2016 15:05:55 +0100 Subject: qemu-common.h: Drop WORDS_ALIGNED define The WORDS_ALIGNED #define is not used anywhere, and hasn't been since 2013 when commit 612d590ebc6cef rewrote the various ld__p functions to not use it. Remove the #define and the comment describing it. Also remove the line in the comment about TARGET_WORDS_ALIGNED, since it has never actually existed. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- include/exec/cpu-all.h | 5 ----- include/qemu-common.h | 4 ---- 2 files changed, 9 deletions(-) (limited to 'include/exec') diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 3911576431..9f38edf419 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -33,15 +33,10 @@ #define EXCP_YIELD 0x10004 /* cpu wants to yield timeslice to another */ /* some important defines: - * - * WORDS_ALIGNED : if defined, the host cpu can only make word aligned - * memory accesses. * * HOST_WORDS_BIGENDIAN : if defined, the host cpu is big endian and * otherwise little endian. * - * (TARGET_WORDS_ALIGNED : same for target cpu (not supported yet)) - * * TARGET_WORDS_BIGENDIAN : same for target cpu */ diff --git a/include/qemu-common.h b/include/qemu-common.h index 835cbc68b8..1f2cb94318 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -14,10 +14,6 @@ #include "qemu/fprintf-fn.h" -#if defined(__arm__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__) || defined(__ia64__) -#define WORDS_ALIGNED -#endif - #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) #include "qemu/option.h" -- cgit v1.2.3-55-g7522 From 7a00217d1a4478f2b8ac63e7fcd5a31af39394ba Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 2 Jun 2016 16:28:16 +0100 Subject: thunk: Drop unused NO_THUNK_TYPE_SIZE guards The thunk_type_size_array() and thunk_type_align_array() functions are only provided if NO_THUNK_TYPE_SIZE is not defined. However nothing in the codebase defines that, and so in fact these functions are always present. Drop the unnecessary #ifdefs. (Over a decade ago thunk.h used to be included by some softmmu files, which defined NO_THUNK_TYPE_SIZE, but these includes are long gone; see for instance commit f193c7979c2f7.) Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- include/exec/user/thunk.h | 3 --- thunk.c | 2 -- 2 files changed, 5 deletions(-) (limited to 'include/exec') diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h index ad1d60266e..57eb358d96 100644 --- a/include/exec/user/thunk.h +++ b/include/exec/user/thunk.h @@ -71,7 +71,6 @@ void thunk_register_struct_direct(int id, const char *name, const StructEntry *se1); const argtype *thunk_convert(void *dst, const void *src, const argtype *type_ptr, int to_host); -#ifndef NO_THUNK_TYPE_SIZE extern StructEntry *struct_entries; @@ -178,8 +177,6 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host) } } -#endif /* NO_THUNK_TYPE_SIZE */ - unsigned int target_to_host_bitmask(unsigned int x86_mask, const bitmask_transtbl * trans_tbl); unsigned int host_to_target_bitmask(unsigned int alpha_mask, diff --git a/thunk.c b/thunk.c index f057d86d94..8aee29918b 100644 --- a/thunk.c +++ b/thunk.c @@ -303,7 +303,6 @@ unsigned int host_to_target_bitmask(unsigned int alpha_mask, return(x86_mask); } -#ifndef NO_THUNK_TYPE_SIZE int thunk_type_size_array(const argtype *type_ptr, int is_host) { return thunk_type_size(type_ptr, is_host); @@ -313,7 +312,6 @@ int thunk_type_align_array(const argtype *type_ptr, int is_host) { return thunk_type_align(type_ptr, is_host); } -#endif /* ndef NO_THUNK_TYPE_SIZE */ void thunk_init(unsigned int max_structs) { -- cgit v1.2.3-55-g7522 From e0ca2ed562d50e6aa02b15431d009fe165cff159 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 2 Jun 2016 17:10:20 +0100 Subject: thunk: Rename args and fields in host-target bitmask conversion code The target_to_host_bitmask() and host_to_target_bitmask() functions and the associated struct bitmask_transtbl are completely generic, but for historical reasons the target related fields and parameters are named 'x86' and the host related fields are named 'alpha'. Rename them to 'target' and 'host'. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- include/exec/user/thunk.h | 12 ++++++------ thunk.c | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'include/exec') diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h index 57eb358d96..f19ef4b230 100644 --- a/include/exec/user/thunk.h +++ b/include/exec/user/thunk.h @@ -60,10 +60,10 @@ typedef struct { /* Translation table for bitmasks... */ typedef struct bitmask_transtbl { - unsigned int x86_mask; - unsigned int x86_bits; - unsigned int alpha_mask; - unsigned int alpha_bits; + unsigned int target_mask; + unsigned int target_bits; + unsigned int host_mask; + unsigned int host_bits; } bitmask_transtbl; void thunk_register_struct(int id, const char *name, const argtype *types); @@ -177,9 +177,9 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host) } } -unsigned int target_to_host_bitmask(unsigned int x86_mask, +unsigned int target_to_host_bitmask(unsigned int target_mask, const bitmask_transtbl * trans_tbl); -unsigned int host_to_target_bitmask(unsigned int alpha_mask, +unsigned int host_to_target_bitmask(unsigned int host_mask, const bitmask_transtbl * trans_tbl); void thunk_init(unsigned int max_structs); diff --git a/thunk.c b/thunk.c index 8aee29918b..2dac36666d 100644 --- a/thunk.c +++ b/thunk.c @@ -273,34 +273,34 @@ const argtype *thunk_convert(void *dst, const void *src, /* from em86 */ /* Utility function: Table-driven functions to translate bitmasks - * between X86 and Alpha formats... + * between host and target formats */ -unsigned int target_to_host_bitmask(unsigned int x86_mask, +unsigned int target_to_host_bitmask(unsigned int target_mask, const bitmask_transtbl * trans_tbl) { const bitmask_transtbl *btp; - unsigned int alpha_mask = 0; + unsigned int host_mask = 0; - for(btp = trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) { - if((x86_mask & btp->x86_mask) == btp->x86_bits) { - alpha_mask |= btp->alpha_bits; - } + for (btp = trans_tbl; btp->target_mask && btp->host_mask; btp++) { + if ((target_mask & btp->target_mask) == btp->target_bits) { + host_mask |= btp->host_bits; + } } - return(alpha_mask); + return host_mask; } -unsigned int host_to_target_bitmask(unsigned int alpha_mask, +unsigned int host_to_target_bitmask(unsigned int host_mask, const bitmask_transtbl * trans_tbl) { const bitmask_transtbl *btp; - unsigned int x86_mask = 0; + unsigned int target_mask = 0; - for(btp = trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) { - if((alpha_mask & btp->alpha_mask) == btp->alpha_bits) { - x86_mask |= btp->x86_bits; - } + for (btp = trans_tbl; btp->target_mask && btp->host_mask; btp++) { + if ((host_mask & btp->host_mask) == btp->host_bits) { + target_mask |= btp->target_bits; + } } - return(x86_mask); + return target_mask; } int thunk_type_size_array(const argtype *type_ptr, int is_host) -- cgit v1.2.3-55-g7522