aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-09-29 09:35:25 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2009-09-29 09:35:25 -0300
commit8e53a621cc5708f8409e288161f15b49f239ab75 (patch)
tree9a9ed6d460e88f045a6ad1831709ca15e5a6a0bc
parentMerge commit '52d946208e9cc2e958b4d3ad18914a51bdbe197a' into upstream-merge (diff)
parentmonitor: Fix do_commit() argument type (diff)
downloadqemu-kvm-8e53a621cc5708f8409e288161f15b49f239ab75.tar.gz
qemu-kvm-8e53a621cc5708f8409e288161f15b49f239ab75.tar.bz2
qemu-kvm-8e53a621cc5708f8409e288161f15b49f239ab75.zip
Merge commit '075e36b8ede5409b491abdf69fe2ffcf1bfe6bca' into upstream-merge
* commit '075e36b8ede5409b491abdf69fe2ffcf1bfe6bca': (27 commits) monitor: Fix do_commit() argument type Don't redefine NULL, please Fix coding style issue Remove PARAMS() macro __thread should be before real type gcc wants 1st static and then const Bring two last users of K&R definitions to ANSI c89 static and inline should came before the type of the functions Use proper typedef syntax Revert "This files are compiled in libqemu.a now" fix use after free unbreak usb pass-through on linux. clean: remove ide/*.o files on clean ARM host: fix generated blocks linking Fix spelling in comment Suppress some variants of English in comments sparc64-8bit-asi target-mips: remove MAX_OP_PER_INSTR workaround exec-all.h: increase OPC_BUF_SIZE exec-all.h: increase MAX_OP_PER_INSTR to 96 from 64 ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--Makefile.target2
-rw-r--r--alpha-dis.c120
-rw-r--r--device_tree.c1
-rw-r--r--dis-asm.h102
-rw-r--r--dyngen-exec.h2
-rw-r--r--exec-all.h8
-rw-r--r--gen-icount.h2
-rw-r--r--hw/g364fb.c4
-rw-r--r--hw/mips_malta.c2
-rw-r--r--hw/nseries.c16
-rw-r--r--hw/omap1.c8
-rw-r--r--hw/omap2.c18
-rw-r--r--hw/omap_clk.c4
-rw-r--r--hw/omap_lcdc.c10
-rw-r--r--hw/omap_mmc.c2
-rw-r--r--hw/onenand.c4
-rw-r--r--hw/pflash_cfi01.c2
-rw-r--r--hw/pxa2xx_lcd.c4
-rw-r--r--hw/pxa2xx_pcmcia.c4
-rw-r--r--hw/pxa2xx_template.h4
-rw-r--r--hw/pxa2xx_timer.c2
-rw-r--r--hw/qdev.c2
-rw-r--r--hw/qdev.h2
-rw-r--r--hw/realview.c2
-rw-r--r--hw/serial.c4
-rw-r--r--hw/sh7750.c2
-rw-r--r--hw/sh7750_regnames.c2
-rw-r--r--hw/sm501.c2
-rw-r--r--hw/tsc210x.c2
-rw-r--r--hw/usb-bt.c2
-rw-r--r--hw/virtio.h2
-rw-r--r--hw/xen_blkif.h4
-rw-r--r--linux-user/arm/nwfpe/fpa11.c2
-rw-r--r--linux-user/arm/nwfpe/fpa11_cprt.c2
-rw-r--r--linux-user/arm/nwfpe/fpopcode.h7
-rw-r--r--linux-user/mmap.c2
-rw-r--r--qemu-config.c2
-rw-r--r--qemu-monitor.hx2
-rw-r--r--qemu-option.c6
-rw-r--r--sh4-dis.c32
-rw-r--r--target-alpha/op_helper.c2
-rw-r--r--target-i386/kvm.c2
-rw-r--r--target-microblaze/translate.c4
-rw-r--r--target-mips/op_helper.c2
-rw-r--r--target-mips/translate.c3
-rw-r--r--target-ppc/translate.c8
-rw-r--r--target-sh4/op_helper.c4
-rw-r--r--target-sparc/op_helper.c5
-rw-r--r--target-sparc/translate.c1
-rw-r--r--tcg/arm/tcg-target.c4
-rw-r--r--tcg/hppa/tcg-target.c4
-rw-r--r--usb-linux.c2
-rw-r--r--vl.c2
-rw-r--r--vnc.c2
54 files changed, 199 insertions, 248 deletions
diff --git a/Makefile.target b/Makefile.target
index 3b990f9c7..dc7e4197b 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -358,7 +358,7 @@ qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
clean:
rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
- rm -f *.d */*.d tcg/*.o
+ rm -f *.d */*.d tcg/*.o ide/*.o
rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
install: all
diff --git a/alpha-dis.c b/alpha-dis.c
index 097f06b69..970da5bfe 100644
--- a/alpha-dis.c
+++ b/alpha-dis.c
@@ -108,8 +108,8 @@ struct alpha_operand
string (the operand will be inserted in any case). If the
operand value is legal, *ERRMSG will be unchanged (most operands
can accept any value). */
- unsigned (*insert) PARAMS ((unsigned instruction, int op,
- const char **errmsg));
+ unsigned (*insert) (unsigned instruction, int op,
+ const char **errmsg);
/* Extraction function. This is used by the disassembler. To
extract this operand type from an instruction, check this field.
@@ -128,7 +128,7 @@ struct alpha_operand
non-zero if this operand type can not actually be extracted from
this operand (i.e., the instruction does not match). If the
operand is valid, *INVALID will not be changed. */
- int (*extract) PARAMS ((unsigned instruction, int *invalid));
+ int (*extract) (unsigned instruction, int *invalid);
};
/* Elements in the table are retrieved by indexing with values from
@@ -158,7 +158,7 @@ extern const unsigned alpha_num_operands;
instructions which want their operands to look like "Ra,disp(Rb)". */
#define AXP_OPERAND_PARENS 02
-/* Used in combination with PARENS, this supresses the supression of
+/* Used in combination with PARENS, this suppresses the suppression of
the comma. This is used for "jmp Ra,(Rb),hint". */
#define AXP_OPERAND_COMMA 04
@@ -179,7 +179,7 @@ extern const unsigned alpha_num_operands;
a flags value of 0 can be treated as end-of-arguments. */
#define AXP_OPERAND_UNSIGNED 0200
-/* Supress overflow detection on this field. This is used for hints. */
+/* Suppress overflow detection on this field. This is used for hints. */
#define AXP_OPERAND_NOOVERFLOW 0400
/* Mask for optional argument default value. */
@@ -273,23 +273,23 @@ enum bfd_reloc_code_real {
/* Local insertion and extraction functions */
-static unsigned insert_rba PARAMS((unsigned, int, const char **));
-static unsigned insert_rca PARAMS((unsigned, int, const char **));
-static unsigned insert_za PARAMS((unsigned, int, const char **));
-static unsigned insert_zb PARAMS((unsigned, int, const char **));
-static unsigned insert_zc PARAMS((unsigned, int, const char **));
-static unsigned insert_bdisp PARAMS((unsigned, int, const char **));
-static unsigned insert_jhint PARAMS((unsigned, int, const char **));
-static unsigned insert_ev6hwjhint PARAMS((unsigned, int, const char **));
-
-static int extract_rba PARAMS((unsigned, int *));
-static int extract_rca PARAMS((unsigned, int *));
-static int extract_za PARAMS((unsigned, int *));
-static int extract_zb PARAMS((unsigned, int *));
-static int extract_zc PARAMS((unsigned, int *));
-static int extract_bdisp PARAMS((unsigned, int *));
-static int extract_jhint PARAMS((unsigned, int *));
-static int extract_ev6hwjhint PARAMS((unsigned, int *));
+static unsigned insert_rba (unsigned, int, const char **);
+static unsigned insert_rca (unsigned, int, const char **);
+static unsigned insert_za (unsigned, int, const char **);
+static unsigned insert_zb (unsigned, int, const char **);
+static unsigned insert_zc (unsigned, int, const char **);
+static unsigned insert_bdisp (unsigned, int, const char **);
+static unsigned insert_jhint (unsigned, int, const char **);
+static unsigned insert_ev6hwjhint (unsigned, int, const char **);
+
+static int extract_rba (unsigned, int *);
+static int extract_rca (unsigned, int *);
+static int extract_za (unsigned, int *);
+static int extract_zb (unsigned, int *);
+static int extract_zc (unsigned, int *);
+static int extract_bdisp (unsigned, int *);
+static int extract_jhint (unsigned, int *);
+static int extract_ev6hwjhint (unsigned, int *);
/* The operands table */
@@ -434,18 +434,13 @@ const unsigned alpha_num_operands = sizeof(alpha_operands)/sizeof(*alpha_operand
/*ARGSUSED*/
static unsigned
-insert_rba(insn, value, errmsg)
- unsigned insn;
- int value ATTRIBUTE_UNUSED;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_rba(unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
{
return insn | (((insn >> 21) & 0x1f) << 16);
}
static int
-extract_rba(insn, invalid)
- unsigned insn;
- int *invalid;
+extract_rba(unsigned insn, int *invalid)
{
if (invalid != (int *) NULL
&& ((insn >> 21) & 0x1f) != ((insn >> 16) & 0x1f))
@@ -458,18 +453,13 @@ extract_rba(insn, invalid)
/*ARGSUSED*/
static unsigned
-insert_rca(insn, value, errmsg)
- unsigned insn;
- int value ATTRIBUTE_UNUSED;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_rca(unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
{
return insn | ((insn >> 21) & 0x1f);
}
static int
-extract_rca(insn, invalid)
- unsigned insn;
- int *invalid;
+extract_rca(unsigned insn, int *invalid)
{
if (invalid != (int *) NULL
&& ((insn >> 21) & 0x1f) != (insn & 0x1f))
@@ -482,18 +472,13 @@ extract_rca(insn, invalid)
/*ARGSUSED*/
static unsigned
-insert_za(insn, value, errmsg)
- unsigned insn;
- int value ATTRIBUTE_UNUSED;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_za(unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
{
return insn | (31 << 21);
}
static int
-extract_za(insn, invalid)
- unsigned insn;
- int *invalid;
+extract_za(unsigned insn, int *invalid)
{
if (invalid != (int *) NULL && ((insn >> 21) & 0x1f) != 31)
*invalid = 1;
@@ -502,18 +487,13 @@ extract_za(insn, invalid)
/*ARGSUSED*/
static unsigned
-insert_zb(insn, value, errmsg)
- unsigned insn;
- int value ATTRIBUTE_UNUSED;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_zb(unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
{
return insn | (31 << 16);
}
static int
-extract_zb(insn, invalid)
- unsigned insn;
- int *invalid;
+extract_zb(unsigned insn, int *invalid)
{
if (invalid != (int *) NULL && ((insn >> 16) & 0x1f) != 31)
*invalid = 1;
@@ -522,18 +502,13 @@ extract_zb(insn, invalid)
/*ARGSUSED*/
static unsigned
-insert_zc(insn, value, errmsg)
- unsigned insn;
- int value ATTRIBUTE_UNUSED;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_zc(unsigned insn, int value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
{
return insn | 31;
}
static int
-extract_zc(insn, invalid)
- unsigned insn;
- int *invalid;
+extract_zc(unsigned insn, int *invalid)
{
if (invalid != (int *) NULL && (insn & 0x1f) != 31)
*invalid = 1;
@@ -544,10 +519,7 @@ extract_zc(insn, invalid)
/* The displacement field of a Branch format insn. */
static unsigned
-insert_bdisp(insn, value, errmsg)
- unsigned insn;
- int value;
- const char **errmsg;
+insert_bdisp(unsigned insn, int value, const char **errmsg)
{
if (errmsg != (const char **)NULL && (value & 3))
*errmsg = _("branch operand unaligned");
@@ -556,9 +528,7 @@ insert_bdisp(insn, value, errmsg)
/*ARGSUSED*/
static int
-extract_bdisp(insn, invalid)
- unsigned insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_bdisp(unsigned insn, int *invalid ATTRIBUTE_UNUSED)
{
return 4 * (((insn & 0x1FFFFF) ^ 0x100000) - 0x100000);
}
@@ -567,10 +537,7 @@ extract_bdisp(insn, invalid)
/* The hint field of a JMP/JSR insn. */
static unsigned
-insert_jhint(insn, value, errmsg)
- unsigned insn;
- int value;
- const char **errmsg;
+insert_jhint(unsigned insn, int value, const char **errmsg)
{
if (errmsg != (const char **)NULL && (value & 3))
*errmsg = _("jump hint unaligned");
@@ -579,9 +546,7 @@ insert_jhint(insn, value, errmsg)
/*ARGSUSED*/
static int
-extract_jhint(insn, invalid)
- unsigned insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_jhint(unsigned insn, int *invalid ATTRIBUTE_UNUSED)
{
return 4 * (((insn & 0x3FFF) ^ 0x2000) - 0x2000);
}
@@ -589,10 +554,7 @@ extract_jhint(insn, invalid)
/* The hint field of an EV6 HW_JMP/JSR insn. */
static unsigned
-insert_ev6hwjhint(insn, value, errmsg)
- unsigned insn;
- int value;
- const char **errmsg;
+insert_ev6hwjhint(unsigned insn, int value, const char **errmsg)
{
if (errmsg != (const char **)NULL && (value & 3))
*errmsg = _("jump hint unaligned");
@@ -601,9 +563,7 @@ insert_ev6hwjhint(insn, value, errmsg)
/*ARGSUSED*/
static int
-extract_ev6hwjhint(insn, invalid)
- unsigned insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_ev6hwjhint(unsigned insn, int *invalid ATTRIBUTE_UNUSED)
{
return 4 * (((insn & 0x1FFF) ^ 0x1000) - 0x1000);
}
@@ -1804,9 +1764,7 @@ static const char * const vms_regnames[64] = {
/* Disassemble Alpha instructions. */
int
-print_insn_alpha (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_alpha (bfd_vma memaddr, struct disassemble_info *info)
{
static const struct alpha_opcode *opcode_index[AXP_NOPS+1];
const char * const * regnames;
diff --git a/device_tree.c b/device_tree.c
index cc9160643..426a63155 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -22,6 +22,7 @@
#include "qemu-common.h"
#include "sysemu.h"
#include "device_tree.h"
+#include "hw/loader.h"
#include <libfdt.h>
diff --git a/dis-asm.h b/dis-asm.h
index 251c49030..1d8f4bdbc 100644
--- a/dis-asm.h
+++ b/dis-asm.h
@@ -14,7 +14,6 @@
#include <string.h>
#include <inttypes.h>
-#define PARAMS(x) x
typedef void *PTR;
typedef uint64_t bfd_vma;
typedef int64_t bfd_signed_vma;
@@ -234,7 +233,7 @@ typedef struct symbol_cache_entry
} udata;
} asymbol;
-typedef int (*fprintf_ftype) PARAMS((FILE*, const char*, ...));
+typedef int (*fprintf_ftype) (FILE*, const char*, ...);
enum dis_insn_type {
dis_noninsn, /* Not a valid instruction */
@@ -296,19 +295,19 @@ typedef struct disassemble_info {
INFO is a pointer to this struct.
Returns an errno value or 0 for success. */
int (*read_memory_func)
- PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int length,
- struct disassemble_info *info));
+ (bfd_vma memaddr, bfd_byte *myaddr, int length,
+ struct disassemble_info *info);
/* Function which should be called if we get an error that we can't
recover from. STATUS is the errno value from read_memory_func and
MEMADDR is the address that we were trying to read. INFO is a
pointer to this struct. */
void (*memory_error_func)
- PARAMS ((int status, bfd_vma memaddr, struct disassemble_info *info));
+ (int status, bfd_vma memaddr, struct disassemble_info *info);
/* Function called to print ADDR. */
void (*print_address_func)
- PARAMS ((bfd_vma addr, struct disassemble_info *info));
+ (bfd_vma addr, struct disassemble_info *info);
/* Function called to determine if there is a symbol at the given ADDR.
If there is, the function returns 1, otherwise it returns 0.
@@ -318,7 +317,7 @@ typedef struct disassemble_info {
address, (normally because there is a symbol associated with
that address), but sometimes we want to mask out the overlay bits. */
int (* symbol_at_address_func)
- PARAMS ((bfd_vma addr, struct disassemble_info * info));
+ (bfd_vma addr, struct disassemble_info * info);
/* These are for buffer_read_memory. */
bfd_byte *buffer;
@@ -363,49 +362,48 @@ typedef struct disassemble_info {
/* Standard disassemblers. Disassemble one instruction at the given
target address. Return number of bytes processed. */
-typedef int (*disassembler_ftype)
- PARAMS((bfd_vma, disassemble_info *));
-
-extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_mips PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_i386 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m68k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_z8001 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_z8002 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8300 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8300h PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8300s PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8500 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_alpha PARAMS ((bfd_vma, disassemble_info*));
-extern disassembler_ftype arc_get_disassembler PARAMS ((int, int));
-extern int print_insn_arm PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_sparc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_big_a29k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_a29k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_i960 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_sh PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_shl PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_hppa PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m32r PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m88k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_mn10200 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_mn10300 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_ns32k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_big_powerpc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_powerpc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_rs6000 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_w65 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_d10v PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_v850 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_tic30 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_ppc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_s390 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_crisv32 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_microblaze PARAMS ((bfd_vma, disassemble_info*));
+typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
+
+extern int print_insn_big_mips (bfd_vma, disassemble_info*);
+extern int print_insn_little_mips (bfd_vma, disassemble_info*);
+extern int print_insn_i386 (bfd_vma, disassemble_info*);
+extern int print_insn_m68k (bfd_vma, disassemble_info*);
+extern int print_insn_z8001 (bfd_vma, disassemble_info*);
+extern int print_insn_z8002 (bfd_vma, disassemble_info*);
+extern int print_insn_h8300 (bfd_vma, disassemble_info*);
+extern int print_insn_h8300h (bfd_vma, disassemble_info*);
+extern int print_insn_h8300s (bfd_vma, disassemble_info*);
+extern int print_insn_h8500 (bfd_vma, disassemble_info*);
+extern int print_insn_alpha (bfd_vma, disassemble_info*);
+extern disassembler_ftype arc_get_disassembler (int, int);
+extern int print_insn_arm (bfd_vma, disassemble_info*);
+extern int print_insn_sparc (bfd_vma, disassemble_info*);
+extern int print_insn_big_a29k (bfd_vma, disassemble_info*);
+extern int print_insn_little_a29k (bfd_vma, disassemble_info*);
+extern int print_insn_i960 (bfd_vma, disassemble_info*);
+extern int print_insn_sh (bfd_vma, disassemble_info*);
+extern int print_insn_shl (bfd_vma, disassemble_info*);
+extern int print_insn_hppa (bfd_vma, disassemble_info*);
+extern int print_insn_m32r (bfd_vma, disassemble_info*);
+extern int print_insn_m88k (bfd_vma, disassemble_info*);
+extern int print_insn_mn10200 (bfd_vma, disassemble_info*);
+extern int print_insn_mn10300 (bfd_vma, disassemble_info*);
+extern int print_insn_ns32k (bfd_vma, disassemble_info*);
+extern int print_insn_big_powerpc (bfd_vma, disassemble_info*);
+extern int print_insn_little_powerpc (bfd_vma, disassemble_info*);
+extern int print_insn_rs6000 (bfd_vma, disassemble_info*);
+extern int print_insn_w65 (bfd_vma, disassemble_info*);
+extern int print_insn_d10v (bfd_vma, disassemble_info*);
+extern int print_insn_v850 (bfd_vma, disassemble_info*);
+extern int print_insn_tic30 (bfd_vma, disassemble_info*);
+extern int print_insn_ppc (bfd_vma, disassemble_info*);
+extern int print_insn_s390 (bfd_vma, disassemble_info*);
+extern int print_insn_crisv32 (bfd_vma, disassemble_info*);
+extern int print_insn_microblaze (bfd_vma, disassemble_info*);
#if 0
/* Fetch the disassembler for a given BFD, if that support is available. */
-extern disassembler_ftype disassembler PARAMS ((bfd *));
+extern disassembler_ftype disassembler (bfd *);
#endif
@@ -415,22 +413,20 @@ extern disassembler_ftype disassembler PARAMS ((bfd *));
/* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */
extern int buffer_read_memory
- PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *));
+ (bfd_vma, bfd_byte *, int, struct disassemble_info *);
/* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */
-extern void perror_memory PARAMS ((int, bfd_vma, struct disassemble_info *));
+extern void perror_memory (int, bfd_vma, struct disassemble_info *);
/* Just print the address in hex. This is included for completeness even
though both GDB and objdump provide their own (to print symbolic
addresses). */
-extern void generic_print_address
- PARAMS ((bfd_vma, struct disassemble_info *));
+extern void generic_print_address (bfd_vma, struct disassemble_info *);
/* Always true. */
-extern int generic_symbol_at_address
- PARAMS ((bfd_vma, struct disassemble_info *));
+extern int generic_symbol_at_address (bfd_vma, struct disassemble_info *);
/* Macro to initialize a disassemble_info struct. This should be called
by all applications creating such a struct. */
diff --git a/dyngen-exec.h b/dyngen-exec.h
index 18819e470..86e61c3df 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -47,8 +47,6 @@ typedef struct FILE FILE;
extern int fprintf(FILE *, const char *, ...);
extern int fputs(const char *, FILE *);
extern int printf(const char *, ...);
-#undef NULL
-#define NULL 0
#if defined(__i386__)
#define AREG0 "ebp"
diff --git a/exec-all.h b/exec-all.h
index 51519ff25..dd134a99f 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -34,10 +34,10 @@
typedef struct TranslationBlock TranslationBlock;
/* XXX: make safe guess about sizes */
-#define MAX_OP_PER_INSTR 64
+#define MAX_OP_PER_INSTR 96
/* A Call op needs up to 6 + 2N parameters (N = number of arguments). */
#define MAX_OPC_PARAM 10
-#define OPC_BUF_SIZE 512
+#define OPC_BUF_SIZE 640
#define OPC_MAX_SIZE (OPC_BUF_SIZE - MAX_OP_PER_INSTR)
/* Maximum size a TCG op can expand to. This is complicated because a
@@ -208,7 +208,9 @@ static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr
#endif
/* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */
- *(uint32_t *)jmp_addr |= ((addr - (jmp_addr + 8)) >> 2) & 0xffffff;
+ *(uint32_t *)jmp_addr =
+ (*(uint32_t *)jmp_addr & ~0xffffff)
+ | (((addr - (jmp_addr + 8)) >> 2) & 0xffffff);
#if QEMU_GNUC_PREREQ(4, 1)
__clear_cache((char *) jmp_addr, (char *) jmp_addr + 4);
diff --git a/gen-icount.h b/gen-icount.h
index d4524d663..01face23b 100644
--- a/gen-icount.h
+++ b/gen-icount.h
@@ -40,7 +40,7 @@ static void gen_icount_end(TranslationBlock *tb, int num_insns)
}
}
-static void inline gen_io_start(void)
+static inline void gen_io_start(void)
{
TCGv_i32 tmp = tcg_const_i32(1);
tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUState, can_do_io));
diff --git a/hw/g364fb.c b/hw/g364fb.c
index d44fcc2d2..d1d2c12d6 100644
--- a/hw/g364fb.c
+++ b/hw/g364fb.c
@@ -268,7 +268,7 @@ static void g364fb_update_display(void *opaque)
qemu_irq_raise(s->irq);
}
-static void inline g364fb_invalidate_display(void *opaque)
+static inline void g364fb_invalidate_display(void *opaque)
{
G364State *s = opaque;
int i;
@@ -396,7 +396,7 @@ static uint32_t g364fb_ctrl_readb(void *opaque, target_phys_addr_t addr)
static void g364fb_update_depth(G364State *s)
{
- const static int depths[8] = { 1, 2, 4, 8, 15, 16, 0 };
+ static const int depths[8] = { 1, 2, 4, 8, 15, 16, 0 };
s->depth = depths[(s->ctla & 0x00700000) >> 20];
}
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 4d72da871..e09e971b3 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -132,7 +132,7 @@ struct _eeprom24c0x_t {
typedef struct _eeprom24c0x_t eeprom24c0x_t;
static eeprom24c0x_t eeprom = {
- contents: {
+ .contents = {
/* 00000000: */ 0x80,0x08,0x04,0x0D,0x0A,0x01,0x40,0x00,
/* 00000008: */ 0x01,0x75,0x54,0x00,0x82,0x08,0x00,0x01,
/* 00000010: */ 0x8F,0x04,0x02,0x01,0x01,0x00,0x0E,0x00,
diff --git a/hw/nseries.c b/hw/nseries.c
index 066a0f980..79f7387ff 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -248,7 +248,7 @@ static void n800_tsc_kbd_setup(struct n800_s *s)
/* XXX: are the three pins inverted inside the chip between the
* tsc and the cpu (N4111)? */
- qemu_irq penirq = 0; /* NC */
+ qemu_irq penirq = NULL; /* NC */
qemu_irq kbirq = omap2_gpio_in_get(s->cpu->gpif, N800_TSC_KP_IRQ_GPIO)[0];
qemu_irq dav = omap2_gpio_in_get(s->cpu->gpif, N800_TSC_TS_GPIO)[0];
@@ -716,7 +716,7 @@ static void n800_dss_init(struct rfbi_chip_s *chip)
static void n8x0_dss_setup(struct n800_s *s)
{
- s->blizzard.opaque = s1d13745_init(0);
+ s->blizzard.opaque = s1d13745_init(NULL);
s->blizzard.block = s1d13745_write_block;
s->blizzard.write = s1d13745_write;
s->blizzard.read = s1d13745_read;
@@ -769,9 +769,9 @@ static void n8x0_usb_setup(struct n800_s *s)
/* Using the NOR interface */
omap_gpmc_attach(s->cpu->gpmc, N8X0_USB_ASYNC_CS,
- tusb6010_async_io(tusb), 0, 0, tusb);
+ tusb6010_async_io(tusb), NULL, NULL, tusb);
omap_gpmc_attach(s->cpu->gpmc, N8X0_USB_SYNC_CS,
- tusb6010_sync_io(tusb), 0, 0, tusb);
+ tusb6010_sync_io(tusb), NULL, NULL, tusb);
s->usb = tusb;
omap2_gpio_out_set(s->cpu->gpif, N8X0_TUSB_ENABLE_GPIO, tusb_pwr);
@@ -1047,7 +1047,7 @@ static struct omap_gpiosw_info_s {
"headphone", N8X0_HEADPHONE_GPIO,
OMAP_GPIOSW_TYPE_CONNECTION | OMAP_GPIOSW_INVERTED,
},
- { 0 }
+ { NULL }
}, n810_gpiosw_info[] = {
{
"gps_reset", N810_GPS_RESET_GPIO,
@@ -1068,7 +1068,7 @@ static struct omap_gpiosw_info_s {
"slide", N810_SLIDE_GPIO,
OMAP_GPIOSW_TYPE_COVER | OMAP_GPIOSW_INVERTED,
},
- { 0 }
+ { NULL }
};
static struct omap_partition_info_s {
@@ -1083,7 +1083,7 @@ static struct omap_partition_info_s {
{ 0x00280000, 0x00200000, 0x3, "initfs" },
{ 0x00480000, 0x0fb80000, 0x3, "rootfs" },
- { 0, 0, 0, 0 }
+ { 0, 0, 0, NULL }
}, n810_part_info[] = {
{ 0x00000000, 0x00020000, 0x3, "bootloader" },
{ 0x00020000, 0x00060000, 0x0, "config" },
@@ -1091,7 +1091,7 @@ static struct omap_partition_info_s {
{ 0x002a0000, 0x00400000, 0x0, "initfs" },
{ 0x006a0000, 0x0f960000, 0x0, "rootfs" },
- { 0, 0, 0, 0 }
+ { 0, 0, 0, NULL }
};
static bdaddr_t n8x0_bd_addr = {{ N8X0_BD_ADDR }};
diff --git a/hw/omap1.c b/hw/omap1.c
index 06c71581b..e9676ecc8 100644
--- a/hw/omap1.c
+++ b/hw/omap1.c
@@ -436,7 +436,7 @@ static uint32_t omap2_inth_read(void *opaque, target_phys_addr_t addr)
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
int offset = addr;
int bank_no, line_no;
- struct omap_intr_handler_bank_s *bank = 0;
+ struct omap_intr_handler_bank_s *bank = NULL;
if ((offset & 0xf80) == 0x80) {
bank_no = (offset & 0x60) >> 5;
@@ -514,7 +514,7 @@ static void omap2_inth_write(void *opaque, target_phys_addr_t addr,
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
int offset = addr;
int bank_no, line_no;
- struct omap_intr_handler_bank_s *bank = 0;
+ struct omap_intr_handler_bank_s *bank = NULL;
if ((offset & 0xf80) == 0x80) {
bank_no = (offset & 0x60) >> 5;
@@ -4731,12 +4731,12 @@ struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,
omap_findclk(s, "uart2_ck"),
omap_findclk(s, "uart2_ck"),
s->drq[OMAP_DMA_UART2_TX], s->drq[OMAP_DMA_UART2_RX],
- serial_hds[0] ? serial_hds[1] : 0);
+ serial_hds[0] ? serial_hds[1] : NULL);
s->uart[2] = omap_uart_init(0xfffb9800, s->irq[0][OMAP_INT_UART3],
omap_findclk(s, "uart3_ck"),
omap_findclk(s, "uart3_ck"),
s->drq[OMAP_DMA_UART3_TX], s->drq[OMAP_DMA_UART3_RX],
- serial_hds[0] && serial_hds[1] ? serial_hds[2] : 0);
+ serial_hds[0] && serial_hds[1] ? serial_hds[2] : NULL);
omap_dpll_init(&s->dpll[0], 0xfffecf00, omap_findclk(s, "dpll1"));
omap_dpll_init(&s->dpll[1], 0xfffed000, omap_findclk(s, "dpll2"));
diff --git a/hw/omap2.c b/hw/omap2.c
index ef338a562..a3fa89d3e 100644
--- a/hw/omap2.c
+++ b/hw/omap2.c
@@ -1055,7 +1055,7 @@ struct omap_gpif_s *omap2_gpio_init(struct omap_target_agent_s *ta,
s->modules = modules;
for (i = 0; i < modules; i ++)
omap_gpio_module_init(s->module + i, ta, region[i],
- irq[i], 0, 0, fclk[i], iclk);
+ irq[i], NULL, NULL, fclk[i], iclk);
omap_gpif_reset(s);
@@ -1615,13 +1615,13 @@ static void omap_eac_format_update(struct omap_eac_s *s)
if (s->codec.in_voice) {
AUD_set_active_in(s->codec.in_voice, 0);
AUD_close_in(&s->codec.card, s->codec.in_voice);
- s->codec.in_voice = 0;
+ s->codec.in_voice = NULL;
}
if (s->codec.out_voice) {
omap_eac_out_empty(s);
AUD_set_active_out(s->codec.out_voice, 0);
AUD_close_out(&s->codec.card, s->codec.out_voice);
- s->codec.out_voice = 0;
+ s->codec.out_voice = NULL;
s->codec.txavail = 0;
}
/* Discard what couldn't be written */
@@ -2555,8 +2555,8 @@ static struct omap_l4_agent_info_s {
struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus, int cs)
{
int i, iomemtype;
- struct omap_target_agent_s *ta = 0;
- struct omap_l4_agent_info_s *info = 0;
+ struct omap_target_agent_s *ta = NULL;
+ struct omap_l4_agent_info_s *info = NULL;
for (i = 0; i < bus->ta_num; i ++)
if (omap_l4_agent_info[i].ta == cs) {
@@ -3007,7 +3007,7 @@ static void omap_prcm_apll_update(struct omap_prcm_s *s)
s->apll_lock[1] = (mode[1] == 3);
/* TODO: update clocks */
- if (mode[0] == 1 || mode[0] == 2 || mode[1] == 1 || mode[2] == 2)
+ if (mode[0] == 1 || mode[0] == 2 || mode[1] == 1 || mode[1] == 2)
fprintf(stderr, "%s: bad EN_54M_PLL or bad EN_96M_PLL\n",
__FUNCTION__);
}
@@ -4559,14 +4559,14 @@ struct omap_mpu_state_s *omap2420_mpu_init(unsigned long sdram_size,
omap_findclk(s, "uart2_iclk"),
s->drq[OMAP24XX_DMA_UART2_TX],
s->drq[OMAP24XX_DMA_UART2_RX],
- serial_hds[0] ? serial_hds[1] : 0);
+ serial_hds[0] ? serial_hds[1] : NULL);
s->uart[2] = omap2_uart_init(omap_l4ta(s->l4, 21),
s->irq[0][OMAP_INT_24XX_UART3_IRQ],
omap_findclk(s, "uart3_fclk"),
omap_findclk(s, "uart3_iclk"),
s->drq[OMAP24XX_DMA_UART3_TX],
s->drq[OMAP24XX_DMA_UART3_RX],
- serial_hds[0] && serial_hds[1] ? serial_hds[2] : 0);
+ serial_hds[0] && serial_hds[1] ? serial_hds[2] : NULL);
s->gptimer[0] = omap_gp_timer_init(omap_l4ta(s->l4, 7),
s->irq[0][OMAP_INT_24XX_GPTIMER1],
@@ -4677,7 +4677,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(unsigned long sdram_size,
omap_sti_init(omap_l4ta(s->l4, 18), 0x54000000,
s->irq[0][OMAP_INT_24XX_STI], omap_findclk(s, "emul_ck"),
serial_hds[0] && serial_hds[1] && serial_hds[2] ?
- serial_hds[3] : 0);
+ serial_hds[3] : NULL);
s->eac = omap_eac_init(omap_l4ta(s->l4, 32),
s->irq[0][OMAP_INT_24XX_EAC_IRQ],
diff --git a/hw/omap_clk.c b/hw/omap_clk.c
index a2da17fc1..6bcabef8a 100644
--- a/hw/omap_clk.c
+++ b/hw/omap_clk.c
@@ -1086,7 +1086,7 @@ static struct clk *onchip_clks[] = {
&dss_l4_iclk,
&omapctrl_clk,
- 0
+ NULL
};
void omap_clk_adduser(struct clk *clk, qemu_irq user)
@@ -1184,7 +1184,7 @@ void omap_clk_reparent(struct clk *clk, struct clk *parent)
omap_clk_update(clk);
omap_clk_rate_update(clk);
} else
- clk->sibling = 0;
+ clk->sibling = NULL;
}
void omap_clk_onoff(struct clk *clk, int on)
diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c
index c0651938c..6affef67b 100644
--- a/hw/omap_lcdc.c
+++ b/hw/omap_lcdc.c
@@ -80,31 +80,31 @@ static void omap_lcd_interrupts(struct omap_lcd_panel_s *s)
#include "omap_lcd_template.h"
static draw_line_func draw_line_table2[33] = {
- [0 ... 32] = 0,
+ [0 ... 32] = NULL,
[8] = draw_line2_8,
[15] = draw_line2_15,
[16] = draw_line2_16,
[32] = draw_line2_32,
}, draw_line_table4[33] = {
- [0 ... 32] = 0,
+ [0 ... 32] = NULL,
[8] = draw_line4_8,
[15] = draw_line4_15,
[16] = draw_line4_16,
[32] = draw_line4_32,
}, draw_line_table8[33] = {
- [0 ... 32] = 0,
+ [0 ... 32] = NULL,
[8] = draw_line8_8,
[15] = draw_line8_15,
[16] = draw_line8_16,
[32] = draw_line8_32,
}, draw_line_table12[33] = {
- [0 ... 32] = 0,
+ [0 ... 32] = NULL,
[8] = draw_line12_8,
[15] = draw_line12_15,
[16] = draw_line12_16,
[32] = draw_line12_32,
}, draw_line_table16[33] = {
- [0 ... 32] = 0,
+ [0 ... 32] = NULL,
[8] = draw_line16_8,
[15] = draw_line16_15,
[16] = draw_line16_16,
diff --git a/hw/omap_mmc.c b/hw/omap_mmc.c
index bbe3f28b6..15cbf06c8 100644
--- a/hw/omap_mmc.c
+++ b/hw/omap_mmc.c
@@ -619,7 +619,7 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
s->card = sd_init(bd, 0);
s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0];
- sd_set_cb(s->card, 0, s->cdet);
+ sd_set_cb(s->card, NULL, s->cdet);
return s;
}
diff --git a/hw/onenand.c b/hw/onenand.c
index 59bc8acd8..c1e7e4d60 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -426,7 +426,7 @@ static void onenand_command(OneNANDState *s, int cmd)
case 0x65: /* OTP Access */
s->intstatus |= ONEN_INT;
- s->bdrv_cur = 0;
+ s->bdrv_cur = NULL;
s->current = s->otp;
s->secs_cur = 1 << (BLOCK_SHIFT - 9);
s->addr[ONEN_BUF_BLOCK] = 0;
@@ -624,7 +624,7 @@ void *onenand_init(uint32_t id, int regshift, qemu_irq irq)
s->shift = regshift;
s->intr = irq;
- s->rdy = 0;
+ s->rdy = NULL;
s->id = id;
s->blocks = size >> BLOCK_SHIFT;
s->secs = size >> 9;
diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index 6ba496e54..dfdced97b 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -195,7 +195,7 @@ static void pflash_update(pflash_t *pfl, int offset,
}
}
-static void inline pflash_data_write(pflash_t *pfl, target_phys_addr_t offset,
+static inline void pflash_data_write(pflash_t *pfl, target_phys_addr_t offset,
uint32_t value, int width)
{
uint8_t *p = pfl->storage;
diff --git a/hw/pxa2xx_lcd.c b/hw/pxa2xx_lcd.c
index 0bf03de24..930299abd 100644
--- a/hw/pxa2xx_lcd.c
+++ b/hw/pxa2xx_lcd.c
@@ -667,7 +667,7 @@ static void pxa2xx_lcdc_dma0_redraw_horiz(PXA2xxLCDState *s,
target_phys_addr_t addr, int *miny, int *maxy)
{
int src_width, dest_width;
- drawfn fn = 0;
+ drawfn fn = NULL;
if (s->dest_width)
fn = s->line_fn[s->transp][s->bpp];
if (!fn)
@@ -694,7 +694,7 @@ static void pxa2xx_lcdc_dma0_redraw_vert(PXA2xxLCDState *s,
target_phys_addr_t addr, int *miny, int *maxy)
{
int src_width, dest_width;
- drawfn fn = 0;
+ drawfn fn = NULL;
if (s->dest_width)
fn = s->line_fn[s->transp][s->bpp];
if (!fn)
diff --git a/hw/pxa2xx_pcmcia.c b/hw/pxa2xx_pcmcia.c
index 5b42147dc..be1309f62 100644
--- a/hw/pxa2xx_pcmcia.c
+++ b/hw/pxa2xx_pcmcia.c
@@ -193,8 +193,8 @@ int pxa2xx_pcmcia_dettach(void *opaque)
return -ENOENT;
s->card->detach(s->card->state);
- s->card->slot = 0;
- s->card = 0;
+ s->card->slot = NULL;
+ s->card = NULL;
s->slot.attached = 0;
diff --git a/hw/pxa2xx_template.h b/hw/pxa2xx_template.h
index 40f4e4d21..1cbe36cb8 100644
--- a/hw/pxa2xx_template.h
+++ b/hw/pxa2xx_template.h
@@ -403,7 +403,7 @@ static void glue(pxa2xx_draw_line25_, BITS)(void *opaque,
/* Overlay planes disabled, no transparency */
static drawfn glue(pxa2xx_draw_fn_, BITS)[16] =
{
- [0 ... 0xf] = 0,
+ [0 ... 0xf] = NULL,
[pxa_lcdc_2bpp] = glue(pxa2xx_draw_line2_, BITS),
[pxa_lcdc_4bpp] = glue(pxa2xx_draw_line4_, BITS),
[pxa_lcdc_8bpp] = glue(pxa2xx_draw_line8_, BITS),
@@ -416,7 +416,7 @@ static drawfn glue(pxa2xx_draw_fn_, BITS)[16] =
/* Overlay planes enabled, transparency used */
static drawfn glue(glue(pxa2xx_draw_fn_, BITS), t)[16] =
{
- [0 ... 0xf] = 0,
+ [0 ... 0xf] = NULL,
[pxa_lcdc_4bpp] = glue(pxa2xx_draw_line4_, BITS),
[pxa_lcdc_8bpp] = glue(pxa2xx_draw_line8_, BITS),
[pxa_lcdc_16bpp] = glue(pxa2xx_draw_line16t_, BITS),
diff --git a/hw/pxa2xx_timer.c b/hw/pxa2xx_timer.c
index 43bad2c9c..d992cc3c4 100644
--- a/hw/pxa2xx_timer.c
+++ b/hw/pxa2xx_timer.c
@@ -465,7 +465,7 @@ void pxa25x_timer_init(target_phys_addr_t base, qemu_irq *irqs)
{
pxa2xx_timer_info *s = pxa2xx_timer_init(base, irqs);
s->freq = PXA25X_FREQ;
- s->tm4 = 0;
+ s->tm4 = NULL;
}
void pxa27x_timer_init(target_phys_addr_t base,
diff --git a/hw/qdev.c b/hw/qdev.c
index 43b1beb25..a589d7240 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -137,7 +137,7 @@ static int set_property(const char *name, const char *value, void *opaque)
if (strcmp(name, "bus") == 0)
return 0;
- if (-1 == qdev_prop_parse(dev, name, value)) {
+ if (qdev_prop_parse(dev, name, value) == -1) {
qemu_error("can't set property \"%s\" to \"%s\" for \"%s\"\n",
name, value, dev->info->name);
return -1;
diff --git a/hw/qdev.h b/hw/qdev.h
index 623ded52f..dfdad90fb 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -132,7 +132,7 @@ CharDriverState *qdev_init_chardev(DeviceState *dev);
BusState *qdev_get_parent_bus(DeviceState *dev);
-/* Convery from a base type to a parent type, with compile time checking. */
+/* Convert from a base type to a parent type, with compile time checking. */
#ifdef __GNUC__
#define DO_UPCAST(type, field, dev) ( __extension__ ( { \
char __attribute__((unused)) offset_must_be_zero[ \
diff --git a/hw/realview.c b/hw/realview.c
index a55fba7bc..a18e7735c 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -196,7 +196,7 @@ static void realview_init(ram_addr_t ram_size,
arm_load_kernel(first_cpu, &realview_binfo);
}
-QEMUMachine realview_machine = {
+static QEMUMachine realview_machine = {
.name = "realview",
.desc = "ARM RealView Emulation Baseboard (ARM926EJ-S)",
.init = realview_init,
diff --git a/hw/serial.c b/hw/serial.c
index a22770fbb..6e8c6e165 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -98,13 +98,13 @@
#define RECV_FIFO 1
#define MAX_XMIT_RETRY 4
-struct SerialFIFO {
+typedef struct SerialFIFO {
uint8_t data[UART_FIFO_LENGTH];
uint8_t count;
uint8_t itl; /* Interrupt Trigger Level */
uint8_t tail;
uint8_t head;
-} typedef SerialFIFO;
+} SerialFIFO;
struct SerialState {
uint16_t divider;
diff --git a/hw/sh7750.c b/hw/sh7750.c
index cf9cf1615..933bbc0c7 100644
--- a/hw/sh7750.c
+++ b/hw/sh7750.c
@@ -69,7 +69,7 @@ typedef struct SH7750State {
struct intc_desc intc;
} SH7750State;
-static int inline has_bcr3_and_bcr4(SH7750State * s)
+static inline int has_bcr3_and_bcr4(SH7750State * s)
{
return (s->cpu->features & SH_FEATURE_BCR3_AND_BCR4);
}
diff --git a/hw/sh7750_regnames.c b/hw/sh7750_regnames.c
index d4b519da9..5a5a2d80d 100644
--- a/hw/sh7750_regnames.c
+++ b/hw/sh7750_regnames.c
@@ -81,7 +81,7 @@ static regname_t regnames[] = {
REGNAME(SH7750_BCR3_A7)
REGNAME(SH7750_BCR4_A7)
REGNAME(SH7750_SDMR2_A7)
- REGNAME(SH7750_SDMR3_A7) {(uint32_t) - 1, 0}
+ REGNAME(SH7750_SDMR3_A7) {(uint32_t) - 1, NULL}
};
const char *regname(uint32_t addr)
diff --git a/hw/sm501.c b/hw/sm501.c
index fc34a99f9..612a8e5c6 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1096,7 +1096,7 @@ void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
/* bridge to serial emulation module */
if (chr)
serial_mm_init(base + MMIO_BASE_OFFSET + SM501_UART0, 2,
- 0, /* TODO : chain irq to IRL */
+ NULL, /* TODO : chain irq to IRL */
115200, chr, 1);
/* create qemu graphic console */
diff --git a/hw/tsc210x.c b/hw/tsc210x.c
index 6bbe24d2f..e851ca10a 100644
--- a/hw/tsc210x.c
+++ b/hw/tsc210x.c
@@ -331,7 +331,7 @@ static void tsc2102_audio_output_update(TSC210xState *s)
s->codec.out.size = 0;
AUD_set_active_out(s->dac_voice[0], 0);
AUD_close_out(&s->card, s->dac_voice[0]);
- s->dac_voice[0] = 0;
+ s->dac_voice[0] = NULL;
}
s->codec.cts = 0;
diff --git a/hw/usb-bt.c b/hw/usb-bt.c
index 4c60d424f..70fd4dd53 100644
--- a/hw/usb-bt.c
+++ b/hw/usb-bt.c
@@ -363,7 +363,7 @@ static inline int usb_bt_fifo_dequeue(struct usb_hci_in_fifo_s *fifo,
return len;
}
-static void inline usb_bt_fifo_out_enqueue(struct USBBtState *s,
+static inline void usb_bt_fifo_out_enqueue(struct USBBtState *s,
struct usb_hci_out_fifo_s *fifo,
void (*send)(struct HCIInfo *, const uint8_t *, int),
int (*complete)(const uint8_t *, int),
diff --git a/hw/virtio.h b/hw/virtio.h
index c441a93e5..0f9be7d10 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -30,7 +30,7 @@
/* We've given up on this device. */
#define VIRTIO_CONFIG_S_FAILED 0x80
-/* We notify when the ring is completely used, even if the guest is supressing
+/* We notify when the ring is completely used, even if the guest is suppressing
* callbacks */
#define VIRTIO_F_NOTIFY_ON_EMPTY 24
/* We support indirect buffer descriptors */
diff --git a/hw/xen_blkif.h b/hw/xen_blkif.h
index 738b8fe53..c0f413622 100644
--- a/hw/xen_blkif.h
+++ b/hw/xen_blkif.h
@@ -70,7 +70,7 @@ enum blkif_protocol {
BLKIF_PROTOCOL_X86_64 = 3,
};
-static void inline blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_request_t *src)
+static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_request_t *src)
{
int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST;
@@ -85,7 +85,7 @@ static void inline blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
dst->seg[i] = src->seg[i];
}
-static void inline blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_request_t *src)
+static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_request_t *src)
{
int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST;
diff --git a/linux-user/arm/nwfpe/fpa11.c b/linux-user/arm/nwfpe/fpa11.c
index 67e65e523..3ff80ebc8 100644
--- a/linux-user/arm/nwfpe/fpa11.c
+++ b/linux-user/arm/nwfpe/fpa11.c
@@ -30,7 +30,7 @@
#include <stdio.h>
-FPA11* qemufpa=0;
+FPA11* qemufpa = NULL;
CPUARMState* user_registers;
/* Reset the FPA11 chip. Called to initialize and reset the emulator. */
diff --git a/linux-user/arm/nwfpe/fpa11_cprt.c b/linux-user/arm/nwfpe/fpa11_cprt.c
index fafa120c9..c80b12400 100644
--- a/linux-user/arm/nwfpe/fpa11_cprt.c
+++ b/linux-user/arm/nwfpe/fpa11_cprt.c
@@ -147,7 +147,7 @@ unsigned int PerformFIX(const unsigned int opcode)
}
-static unsigned int __inline__
+static __inline unsigned int
PerformComparisonOperation(floatx80 Fn, floatx80 Fm)
{
FPA11 *fpa11 = GET_FPA11();
diff --git a/linux-user/arm/nwfpe/fpopcode.h b/linux-user/arm/nwfpe/fpopcode.h
index 0b501dc6e..d62011458 100644
--- a/linux-user/arm/nwfpe/fpopcode.h
+++ b/linux-user/arm/nwfpe/fpopcode.h
@@ -366,21 +366,22 @@ TABLE 5
/* Get the rounding mode from the opcode. */
#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)
+extern const floatx80 floatx80Constant[];
+extern const float64 float64Constant[];
+extern const float32 float32Constant[];
+
static inline floatx80 getExtendedConstant(const unsigned int nIndex)
{
- extern const floatx80 floatx80Constant[];
return floatx80Constant[nIndex];
}
static inline float64 getDoubleConstant(const unsigned int nIndex)
{
- extern const float64 float64Constant[];
return float64Constant[nIndex];
}
static inline float32 getSingleConstant(const unsigned int nIndex)
{
- extern const float32 float32Constant[];
return float32Constant[nIndex];
}
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 07ce05157..144fb7cbc 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -35,7 +35,7 @@
#if defined(CONFIG_USE_NPTL)
static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER;
-static int __thread mmap_lock_count;
+static __thread int mmap_lock_count;
void mmap_lock(void)
{
diff --git a/qemu-config.c b/qemu-config.c
index 636fa64b4..8ec7aca19 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -190,7 +190,7 @@ int qemu_set_option(const char *str)
return -1;
}
- if (-1 == qemu_opt_set(opts, arg, str+offset+1)) {
+ if (qemu_opt_set(opts, arg, str+offset+1) == -1) {
fprintf(stderr, "failed to set \"%s\" for %s \"%s\"\n",
arg, lists[i]->name, id);
return -1;
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index a889fed99..a25fd3ec4 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -15,7 +15,7 @@ STEXI
Show the help for all commands or just for command @var{cmd}.
ETEXI
- { "commit", "device:s", do_commit,
+ { "commit", "device:B", do_commit,
"device|all", "commit changes to the disk images (if -snapshot is used) or backing files" },
STEXI
@item commit
diff --git a/qemu-option.c b/qemu-option.c
index 88298e4b5..9fe1f9547 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -267,7 +267,7 @@ int set_option_parameter(QEMUOptionParameter *list, const char *name,
// Process parameter
switch (list->type) {
case OPT_FLAG:
- if (-1 == parse_option_bool(name, value, &flag))
+ if (parse_option_bool(name, value, &flag) == -1)
return -1;
list->value.n = flag;
break;
@@ -282,7 +282,7 @@ int set_option_parameter(QEMUOptionParameter *list, const char *name,
break;
case OPT_SIZE:
- if (-1 == parse_option_size(name, value, &list->value.n))
+ if (parse_option_size(name, value, &list->value.n) == -1)
return -1;
break;
@@ -745,7 +745,7 @@ int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname
}
if (strcmp(option, "id") != 0) {
/* store and parse */
- if (-1 == qemu_opt_set(opts, option, value)) {
+ if (qemu_opt_set(opts, option, value) == -1) {
return -1;
}
}
diff --git a/sh4-dis.c b/sh4-dis.c
index d183176e1..a502a6188 100644
--- a/sh4-dis.c
+++ b/sh4-dis.c
@@ -1164,17 +1164,14 @@ const sh_opcode_info sh_table[] =
#endif
static void print_movxy
- PARAMS ((const sh_opcode_info *, int, int, fprintf_ftype, void *));
-static void print_insn_ddt PARAMS ((int, struct disassemble_info *));
-static void print_dsp_reg PARAMS ((int, fprintf_ftype, void *));
-static void print_insn_ppi PARAMS ((int, struct disassemble_info *));
+ (const sh_opcode_info *, int, int, fprintf_ftype, void *);
+static void print_insn_ddt (int, struct disassemble_info *);
+static void print_dsp_reg (int, fprintf_ftype, void *);
+static void print_insn_ppi (int, struct disassemble_info *);
static void
-print_movxy (op, rn, rm, fprintf_fn, stream)
- const sh_opcode_info *op;
- int rn, rm;
- fprintf_ftype fprintf_fn;
- void *stream;
+print_movxy (const sh_opcode_info *op, int rn, int rm,
+ fprintf_ftype fprintf_fn, void *stream)
{
int n;
@@ -1248,9 +1245,7 @@ print_movxy (op, rn, rm, fprintf_fn, stream)
Return nonzero if a field b of a parallel processing insns follows. */
static void
-print_insn_ddt (insn, info)
- int insn;
- struct disassemble_info *info;
+print_insn_ddt (int insn, struct disassemble_info *info)
{
fprintf_ftype fprintf_fn = info->fprintf_func;
void *stream = info->stream;
@@ -1337,10 +1332,7 @@ print_insn_ddt (insn, info)
}
static void
-print_dsp_reg (rm, fprintf_fn, stream)
- int rm;
- fprintf_ftype fprintf_fn;
- void *stream;
+print_dsp_reg (int rm, fprintf_ftype fprintf_fn, void *stream)
{
switch (rm)
{
@@ -1381,9 +1373,7 @@ print_dsp_reg (rm, fprintf_fn, stream)
}
static void
-print_insn_ppi (field_b, info)
- int field_b;
- struct disassemble_info *info;
+print_insn_ppi (int field_b, struct disassemble_info *info)
{
static const char *sx_tab[] = { "x0", "x1", "a0", "a1" };
static const char *sy_tab[] = { "y0", "y1", "m0", "m1" };
@@ -1528,9 +1518,7 @@ print_insn_ppi (field_b, info)
/* FIXME mvs: movx insns print as ".word 0x%03x", insn & 0xfff
(ie. the upper nibble is missing). */
int
-print_insn_sh (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
{
fprintf_ftype fprintf_fn = info->fprintf_func;
void *stream = info->stream;
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index e9d2732df..fe222dccd 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -89,7 +89,7 @@ void helper_store_fpcr (uint64_t val)
}
}
-spinlock_t intr_cpu_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t intr_cpu_lock = SPIN_LOCK_UNLOCKED;
uint64_t helper_rs(void)
{
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 1566eacab..1cf0dc37b 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -792,7 +792,7 @@ int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run)
#ifdef KVM_CAP_SET_GUEST_DEBUG
int kvm_arch_insert_sw_breakpoint(CPUState *env, struct kvm_sw_breakpoint *bp)
{
- const static uint8_t int3 = 0xcc;
+ static const uint8_t int3 = 0xcc;
if (cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&bp->saved_insn, 1, 0) ||
cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&int3, 1, 1))
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index dfeb8ae84..e91ea39dd 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -91,7 +91,7 @@ typedef struct DisasContext {
int singlestep_enabled;
} DisasContext;
-const static char *regnames[] =
+static const char *regnames[] =
{
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
@@ -99,7 +99,7 @@ const static char *regnames[] =
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
};
-const static char *special_regnames[] =
+static const char *special_regnames[] =
{
"rpc", "rmsr", "sr2", "sr3", "sr4", "sr5", "sr6", "sr7",
"sr8", "sr9", "sr10", "sr11", "sr12", "sr13", "sr14", "sr15",
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 194414c74..d3dab33a3 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -1868,7 +1868,7 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,
#define FLOAT_SNAN64 0x7fffffffffffffffULL
/* convert MIPS rounding mode in FCR31 to IEEE library */
-unsigned int ieee_rm[] = {
+static unsigned int ieee_rm[] = {
float_round_nearest_even,
float_round_to_zero,
float_round_up,
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 72692efe0..aabb69c2d 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -8298,8 +8298,7 @@ gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
qemu_log("search pc %d\n", search_pc);
pc_start = tb->pc;
- /* Leave some spare opc slots for branch handling. */
- gen_opc_end = gen_opc_buf + OPC_MAX_SIZE - 16;
+ gen_opc_end = gen_opc_buf + OPC_MAX_SIZE;
ctx.pc = pc_start;
ctx.saved_pc = -1;
ctx.singlestep_enabled = env->singlestep_enabled;
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index c8e8b6a4e..8844ad275 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -2814,7 +2814,7 @@ static void gen_std(DisasContext *ctx)
#endif
/*** Integer load and store with byte reverse ***/
/* lhbrx */
-static void inline gen_qemu_ld16ur(DisasContext *ctx, TCGv arg1, TCGv arg2)
+static inline void gen_qemu_ld16ur(DisasContext *ctx, TCGv arg1, TCGv arg2)
{
tcg_gen_qemu_ld16u(arg1, arg2, ctx->mem_idx);
if (likely(!ctx->le_mode)) {
@@ -2824,7 +2824,7 @@ static void inline gen_qemu_ld16ur(DisasContext *ctx, TCGv arg1, TCGv arg2)
GEN_LDX(lhbr, ld16ur, 0x16, 0x18, PPC_INTEGER);
/* lwbrx */
-static void inline gen_qemu_ld32ur(DisasContext *ctx, TCGv arg1, TCGv arg2)
+static inline void gen_qemu_ld32ur(DisasContext *ctx, TCGv arg1, TCGv arg2)
{
tcg_gen_qemu_ld32u(arg1, arg2, ctx->mem_idx);
if (likely(!ctx->le_mode)) {
@@ -2834,7 +2834,7 @@ static void inline gen_qemu_ld32ur(DisasContext *ctx, TCGv arg1, TCGv arg2)
GEN_LDX(lwbr, ld32ur, 0x16, 0x10, PPC_INTEGER);
/* sthbrx */
-static void inline gen_qemu_st16r(DisasContext *ctx, TCGv arg1, TCGv arg2)
+static inline void gen_qemu_st16r(DisasContext *ctx, TCGv arg1, TCGv arg2)
{
if (likely(!ctx->le_mode)) {
TCGv t0 = tcg_temp_new();
@@ -2849,7 +2849,7 @@ static void inline gen_qemu_st16r(DisasContext *ctx, TCGv arg1, TCGv arg2)
GEN_STX(sthbr, st16r, 0x16, 0x1C, PPC_INTEGER);
/* stwbrx */
-static void inline gen_qemu_st32r(DisasContext *ctx, TCGv arg1, TCGv arg2)
+static inline void gen_qemu_st32r(DisasContext *ctx, TCGv arg1, TCGv arg2)
{
if (likely(!ctx->le_mode)) {
TCGv t0 = tcg_temp_new();
diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c
index 6dc8503a0..529df0ca9 100644
--- a/target-sh4/op_helper.c
+++ b/target-sh4/op_helper.c
@@ -145,7 +145,7 @@ void helper_discard_movcal_backup(void)
memory_content *next = current->next;
free (current);
env->movcal_backup = current = next;
- if (current == 0)
+ if (current == NULL)
env->movcal_backup_tail = &(env->movcal_backup);
}
}
@@ -161,7 +161,7 @@ void helper_ocbi(uint32_t address)
memory_content *next = (*current)->next;
stl(a, (*current)->value);
- if (next == 0)
+ if (next == NULL)
{
env->movcal_backup_tail = current;
}
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index a9558dad8..8992d1c55 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -2112,6 +2112,8 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign)
target_ulong last_addr = addr;
#endif
+ asi &= 0xff;
+
if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
|| ((env->def->features & CPU_FEATURE_HYPV)
&& asi >= 0x30 && asi < 0x80
@@ -2406,6 +2408,9 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
#ifdef DEBUG_ASI
dump_asi("write", addr, asi, size, val);
#endif
+
+ asi &= 0xff;
+
if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
|| ((env->def->features & CPU_FEATURE_HYPV)
&& asi >= 0x30 && asi < 0x80
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 928aa61ad..bf6df50c8 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -3152,6 +3152,7 @@ static void disas_sparc_insn(DisasContext * dc)
break;
case 0x3: /* V9 wrasi */
tcg_gen_xor_tl(cpu_dst, cpu_src1, cpu_src2);
+ tcg_gen_andi_tl(cpu_dst, cpu_dst, 0xff);
tcg_gen_trunc_tl_i32(cpu_asi, cpu_dst);
break;
case 0x6: /* V9 wrfprs */
diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 8c385782d..59e89d486 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -907,7 +907,7 @@ static inline void tcg_out_qemu_ld(TCGContext *s, int cond,
if (opc == 3)
data_reg2 = *args++;
else
- data_reg2 = 0; /* surpress warning */
+ data_reg2 = 0; /* suppress warning */
addr_reg = *args++;
#ifdef CONFIG_SOFTMMU
# if TARGET_LONG_BITS == 64
@@ -1105,7 +1105,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, int cond,
if (opc == 3)
data_reg2 = *args++;
else
- data_reg2 = 0; /* surpress warning */
+ data_reg2 = 0; /* suppress warning */
addr_reg = *args++;
#ifdef CONFIG_SOFTMMU
# if TARGET_LONG_BITS == 64
diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c
index 5960c0323..ddce60c81 100644
--- a/tcg/hppa/tcg-target.c
+++ b/tcg/hppa/tcg-target.c
@@ -382,7 +382,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
if (opc == 3)
data_reg2 = *args++;
else
- data_reg2 = 0; /* surpress warning */
+ data_reg2 = 0; /* suppress warning */
addr_reg = *args++;
#if TARGET_LONG_BITS == 64
addr_reg2 = *args++;
@@ -554,7 +554,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
if (opc == 3)
data_reg2 = *args++;
else
- data_reg2 = 0; /* surpress warning */
+ data_reg2 = 0; /* suppress warning */
addr_reg = *args++;
#if TARGET_LONG_BITS == 64
addr_reg2 = *args++;
diff --git a/usb-linux.c b/usb-linux.c
index c434e4f8a..2b7b09214 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -922,6 +922,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
dev->bus_num = bus_num;
dev->addr = addr;
+ dev->fd = fd;
/* read the device description */
dev->descr_len = read(fd, dev->descr, sizeof(dev->descr));
@@ -979,6 +980,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
hostdev_link(dev);
+ qdev_init(&d->qdev);
return (USBDevice *) dev;
fail:
diff --git a/vl.c b/vl.c
index 3b49c5678..28e868fcc 100644
--- a/vl.c
+++ b/vl.c
@@ -5202,7 +5202,7 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "parse error: %s\n", optarg);
exit(1);
}
- if (NULL == qemu_chr_open_opts(opts, NULL)) {
+ if (qemu_chr_open_opts(opts, NULL) == NULL) {
exit(1);
}
break;
diff --git a/vnc.c b/vnc.c
index 5eaef6a3e..592c9b398 100644
--- a/vnc.c
+++ b/vnc.c
@@ -918,8 +918,8 @@ static void vnc_disconnect_finish(VncState *vs)
if (!vs->vd->clients)
dcl->idle = 1;
- qemu_free(vs);
vnc_remove_timer(vs->vd);
+ qemu_free(vs);
}
int vnc_client_io_error(VncState *vs, int ret, int last_errno)