From 0668a06b81bb709b72aa816083227eb0d44b2ad6 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Tue, 17 May 2016 09:41:18 +0800 Subject: ICH9: fix typo Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- include/hw/i386/ich9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index d04dcdcfb3..88233c3077 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -35,7 +35,7 @@ typedef struct ICH9LPCState { /* (pci device, intx) -> pirq * In real chipset case, the unused slots are never used - * as ICH9 supports only D25-D32 irq routing. + * as ICH9 supports only D25-D31 irq routing. * On the other hand in qemu case, any slot/function can be populated * via command line option. * So fallback interrupt routing for any devices in any slots is necessary. @@ -181,7 +181,7 @@ Object *ich9_lpc_find(void); #define ICH9_SATA1_DEV 31 #define ICH9_SATA1_FUNC 2 -/* D30:F1 power management I/O registers +/* D31:F0 power management I/O registers offset from the address ICH9_LPC_PMBASE */ /* ICH9 LPC PM I/O registers are 128 ports and 128-aligned */ -- cgit v1.2.3-55-g7522 From d9d8d452da89678ceed415161313a6c3cd08401c Mon Sep 17 00:00:00 2001 From: Cao jin Date: Sun, 17 Apr 2016 15:45:54 +0800 Subject: qdev: Clean up around properties include: 1. remove unnecessary declaration of static function 2. fix inconsistency between comment and function name, and typo OOM->QOM 2. update comments of functions, use uniform format(GTK-Doc style) Signed-off-by: Cao jin Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- hw/core/qdev.c | 30 +++++++++++++++++++----------- include/hw/qdev-properties.h | 10 ++++++++-- 2 files changed, 27 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 853162b670..0a05a5295c 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -58,9 +58,6 @@ const char *qdev_fw_name(DeviceState *dev) return object_get_typename(OBJECT(dev)); } -static void qdev_property_add_legacy(DeviceState *dev, Property *prop, - Error **errp); - static void bus_remove_child(BusState *bus, DeviceState *child) { BusChild *kid; @@ -733,13 +730,20 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, } /** - * @qdev_add_legacy_property - adds a legacy property + * qdev_property_add_legacy: + * @dev: Device to add the property to. + * @prop: The qdev property definition. + * @errp: location to store error information. + * + * Add a legacy QOM property to @dev for qdev property @prop. + * On error, store error in @errp. * - * Do not use this is new code! Properties added through this interface will - * be given names and types in the "legacy" namespace. + * Legacy properties are string versions of QOM properties. The format of + * the string depends on the property type. Legacy properties are only + * needed for "info qtree". * - * Legacy properties are string versions of other OOM properties. The format - * of the string depends on the property type. + * Do not use this is new code! QOM Properties added through this interface + * will be given names in the "legacy" namespace. */ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, Error **errp) @@ -762,10 +766,14 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop, } /** - * @qdev_property_add_static - add a @Property to a device. + * qdev_property_add_static: + * @dev: Device to add the property to. + * @prop: The qdev property definition. + * @errp: location to store error information. * - * Static properties access data in a struct. The actual type of the - * property and the field depends on the property type. + * Add a static QOM property to @dev for qdev property @prop. + * On error, store error in @errp. Static properties access data in a struct. + * The type of the QOM property is derived from prop->info. */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 0586cacceb..034b75acc5 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -197,8 +197,14 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, Property *prop, const char *value); /** - * @qdev_property_add_static - add a @Property to a device referencing a - * field in a struct. + * qdev_property_add_static: + * @dev: Device to add the property to. + * @prop: The qdev property definition. + * @errp: location to store error information. + * + * Add a static QOM property to @dev for qdev property @prop. + * On error, store error in @errp. Static properties access data in a struct. + * The type of the QOM property is derived from prop->info. */ void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp); -- cgit v1.2.3-55-g7522 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 --- hw/intc/aspeed_vic.c | 1 - hw/timer/mc146818rtc.c | 1 - include/exec/hwaddr.h | 1 - include/qemu/fifo32.h | 1 - 4 files changed, 4 deletions(-) (limited to 'include') diff --git a/hw/intc/aspeed_vic.c b/hw/intc/aspeed_vic.c index 725d5b62c5..2370e7485f 100644 --- a/hw/intc/aspeed_vic.c +++ b/hw/intc/aspeed_vic.c @@ -28,7 +28,6 @@ */ #include "qemu/osdep.h" -#include #include "hw/intc/aspeed_vic.h" #include "qemu/bitops.h" #include "qemu/log.h" diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 2ac0fd3e48..a11b8b4b21 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -22,7 +22,6 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" -#include "config-target.h" #include "qemu/cutils.h" #include "qemu/bcd.h" #include "hw/hw.h" 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 diff --git a/include/qemu/fifo32.h b/include/qemu/fifo32.h index 2e5a0ccddf..4e9fd1b5ef 100644 --- a/include/qemu/fifo32.h +++ b/include/qemu/fifo32.h @@ -15,7 +15,6 @@ #ifndef FIFO32_H #define FIFO32_H -#include "qemu/osdep.h" #include "qemu/fifo8.h" typedef struct { -- cgit v1.2.3-55-g7522 From 030c98aff14f7504f1b4e00967a79595918288c6 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 24 May 2016 16:24:39 +0100 Subject: all: Remove unnecessary glib.h includes Remove glib.h includes, as it is provided by osdep.h. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Tested-by: Eric Blake Signed-off-by: Michael Tokarev --- block/dmg.c | 1 - block/vhdx.c | 1 - block/vmdk.c | 1 - fsdev/9p-iov-marshal.c | 1 - fsdev/9p-marshal.c | 1 - hw/9pfs/9p.h | 1 - hw/i386/acpi-build.c | 1 - hw/i386/pc_piix.c | 1 - include/hw/acpi/aml-build.h | 1 - include/hw/acpi/bios-linker-loader.h | 1 - include/qemu/bitmap.h | 1 - include/qemu/rcu.h | 1 - include/qom/object.h | 1 - include/sysemu/tpm_backend_int.h | 1 - memory_mapping.c | 1 - migration/postcopy-ram.c | 1 - page_cache.c | 1 - qapi/qmp-registry.c | 1 - qemu-bridge-helper.c | 1 - slirp/dnssearch.c | 1 - slirp/slirp.h | 1 - ui/sdl_zoom.c | 1 - ui/vnc-palette.c | 1 - util/coroutine-gthread.c | 1 - util/hbitmap.c | 1 - util/memfd.c | 1 - util/oslib-win32.c | 1 - util/uri.c | 1 - vl.c | 1 - 29 files changed, 29 deletions(-) (limited to 'include') diff --git a/block/dmg.c b/block/dmg.c index 1ea5f22d82..06eb5138f3 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -32,7 +32,6 @@ #ifdef CONFIG_BZIP2 #include #endif -#include enum { /* Limit chunk sizes to prevent unreasonable amounts of memory being used diff --git a/block/vhdx.c b/block/vhdx.c index c0d24a24ee..f5605a2ff4 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -27,7 +27,6 @@ #include "migration/migration.h" #include -#include /* Options for VHDX creation */ diff --git a/block/vmdk.c b/block/vmdk.c index 372e5edc15..2205cc888f 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -34,7 +34,6 @@ #include "migration/migration.h" #include "qemu/cutils.h" #include -#include #define VMDK3_MAGIC (('C' << 24) | ('O' << 16) | ('W' << 8) | 'D') #define VMDK4_MAGIC (('K' << 24) | ('D' << 16) | ('M' << 8) | 'V') diff --git a/fsdev/9p-iov-marshal.c b/fsdev/9p-iov-marshal.c index fb40bdf0d5..fce1ee9e55 100644 --- a/fsdev/9p-iov-marshal.c +++ b/fsdev/9p-iov-marshal.c @@ -12,7 +12,6 @@ */ #include "qemu/osdep.h" -#include #include #include #include diff --git a/fsdev/9p-marshal.c b/fsdev/9p-marshal.c index 183d3667c6..f56ef0e60c 100644 --- a/fsdev/9p-marshal.c +++ b/fsdev/9p-marshal.c @@ -12,7 +12,6 @@ */ #include "qemu/osdep.h" -#include #include #include #include diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 46d787627a..d2030fdf56 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -4,7 +4,6 @@ #include #include #include -#include #include "fsdev/file-op-9p.h" #include "fsdev/9p-iov-marshal.h" #include "qemu/thread.h" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 06d6204749..8ca203211a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -23,7 +23,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "acpi-build.h" -#include #include "qemu-common.h" #include "qemu/bitmap.h" #include "qemu/error-report.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 24e7042680..a6a6604722 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -23,7 +23,6 @@ */ #include "qemu/osdep.h" -#include #include "hw/hw.h" #include "hw/loader.h" diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 3952f85eeb..10c09ca29f 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -1,7 +1,6 @@ #ifndef HW_ACPI_GEN_UTILS_H #define HW_ACPI_GEN_UTILS_H -#include #include "hw/acpi/acpi-defs.h" #include "hw/acpi/bios-linker-loader.h" diff --git a/include/hw/acpi/bios-linker-loader.h b/include/hw/acpi/bios-linker-loader.h index a05227eb30..fa1e5d1a4e 100644 --- a/include/hw/acpi/bios-linker-loader.h +++ b/include/hw/acpi/bios-linker-loader.h @@ -1,7 +1,6 @@ #ifndef BIOS_LINKER_LOADER_H #define BIOS_LINKER_LOADER_H -#include typedef struct BIOSLinker { GArray *cmd_blob; diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h index 0e33fa5d9d..ec5146f84e 100644 --- a/include/qemu/bitmap.h +++ b/include/qemu/bitmap.h @@ -12,7 +12,6 @@ #ifndef BITMAP_H #define BITMAP_H -#include #include "qemu/bitops.h" diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h index 56d3a682a9..83ae2808be 100644 --- a/include/qemu/rcu.h +++ b/include/qemu/rcu.h @@ -23,7 +23,6 @@ * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ -#include #include "qemu/thread.h" #include "qemu/queue.h" diff --git a/include/qom/object.h b/include/qom/object.h index 21bb5ff149..99de539e7c 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -14,7 +14,6 @@ #ifndef QEMU_OBJECT_H #define QEMU_OBJECT_H -#include #include "qapi-types.h" #include "qemu/queue.h" diff --git a/include/sysemu/tpm_backend_int.h b/include/sysemu/tpm_backend_int.h index 40f693a0cc..cc0dcb3fd2 100644 --- a/include/sysemu/tpm_backend_int.h +++ b/include/sysemu/tpm_backend_int.h @@ -22,7 +22,6 @@ #ifndef TPM_TPM_BACKEND_H #define TPM_TPM_BACKEND_H -#include typedef struct TPMBackendThread { GThreadPool *pool; diff --git a/memory_mapping.c b/memory_mapping.c index 2354b2b7f3..e3e0d95172 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -13,7 +13,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include #include "qemu-common.h" #include "cpu.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index cf7dcd25d4..47250b675d 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -17,7 +17,6 @@ */ #include "qemu/osdep.h" -#include #include "qemu-common.h" #include "migration/migration.h" diff --git a/page_cache.c b/page_cache.c index 37a66e497b..a2809db2f5 100644 --- a/page_cache.c +++ b/page_cache.c @@ -13,7 +13,6 @@ */ #include "qemu/osdep.h" -#include #include "qemu-common.h" #include "qemu/host-utils.h" diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c index 4332a6818d..68b24c98b0 100644 --- a/qapi/qmp-registry.c +++ b/qapi/qmp-registry.c @@ -13,7 +13,6 @@ */ #include "qemu/osdep.h" -#include #include "qapi/qmp/dispatch.h" static QTAILQ_HEAD(QmpCommandList, QmpCommand) qmp_commands = diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c index 830fb9e269..5396fbfbb6 100644 --- a/qemu-bridge-helper.c +++ b/qemu-bridge-helper.c @@ -15,7 +15,6 @@ #include "qemu/osdep.h" -#include #include #include diff --git a/slirp/dnssearch.c b/slirp/dnssearch.c index aed2f13af5..4c70a64359 100644 --- a/slirp/dnssearch.c +++ b/slirp/dnssearch.c @@ -23,7 +23,6 @@ */ #include "qemu/osdep.h" -#include #include "slirp.h" static const uint8_t RFC3397_OPT_DOMAIN_SEARCH = 119; diff --git a/slirp/slirp.h b/slirp/slirp.h index 5df755e697..e3641f9eba 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -69,7 +69,6 @@ typedef char *caddr_t; #include #endif -#include #include "debug.h" diff --git a/ui/sdl_zoom.c b/ui/sdl_zoom.c index 72622c2647..b96196bac5 100644 --- a/ui/sdl_zoom.c +++ b/ui/sdl_zoom.c @@ -13,7 +13,6 @@ #include "qemu/osdep.h" #include "sdl_zoom.h" -#include static void sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth, SDL_Rect *dst_rect); diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c index 3b89d1af25..dc7c0ba997 100644 --- a/ui/vnc-palette.c +++ b/ui/vnc-palette.c @@ -28,7 +28,6 @@ #include "qemu/osdep.h" #include "vnc-palette.h" -#include static VncPaletteEntry *palette_find(const VncPalette *palette, uint32_t color, unsigned int hash) diff --git a/util/coroutine-gthread.c b/util/coroutine-gthread.c index fb697eb0b7..62bfb4015d 100644 --- a/util/coroutine-gthread.c +++ b/util/coroutine-gthread.c @@ -19,7 +19,6 @@ */ #include "qemu/osdep.h" -#include #include "qemu-common.h" #include "qemu/coroutine_int.h" diff --git a/util/hbitmap.c b/util/hbitmap.c index b22b87d0a6..7121b11c01 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -10,7 +10,6 @@ */ #include "qemu/osdep.h" -#include #include "qemu/hbitmap.h" #include "qemu/host-utils.h" #include "trace.h" diff --git a/util/memfd.c b/util/memfd.c index 7c406914c5..b374238a59 100644 --- a/util/memfd.c +++ b/util/memfd.c @@ -27,7 +27,6 @@ #include "qemu/osdep.h" -#include #include #include diff --git a/util/oslib-win32.c b/util/oslib-win32.c index c926db4a5c..6debc2b8a6 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -31,7 +31,6 @@ */ #include "qemu/osdep.h" #include -#include #include "qapi/error.h" #include "sysemu/sysemu.h" #include "qemu/main-loop.h" diff --git a/util/uri.c b/util/uri.c index d109d6c01d..70a9cbcbd2 100644 --- a/util/uri.c +++ b/util/uri.c @@ -52,7 +52,6 @@ */ #include "qemu/osdep.h" -#include #include "qemu/uri.h" diff --git a/vl.c b/vl.c index 2f74fe8fb6..fafc7dff07 100644 --- a/vl.c +++ b/vl.c @@ -51,7 +51,6 @@ int main(int argc, char **argv) #define main qemu_main #endif /* CONFIG_COCOA */ -#include #include "qemu/error-report.h" #include "qemu/sockets.h" -- cgit v1.2.3-55-g7522 From e52eeb468d3dbd23c7c9f9746d3528f10a226817 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 31 May 2016 12:33:31 -0600 Subject: host-utils: Prefer 'false' for bool type Mixing '0' and 'bool' looks stupid. Signed-off-by: Eric Blake Signed-off-by: Michael Tokarev --- include/qemu/host-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h index 1cdae0d0ed..3de7d4ec55 100644 --- a/include/qemu/host-utils.h +++ b/include/qemu/host-utils.h @@ -486,7 +486,7 @@ static inline uint64_t revbit64(uint64_t x) static inline bool is_power_of_2(uint64_t value) { if (!value) { - return 0; + return false; } return !(value & (value - 1)); -- 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') 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') 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') 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