trivial patches for 2015-10-08
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJWFp75AAoJEL7lnXSkw9fbImgIALGEo20bKy2X624iPgTePuPb e34TjoRoB7s3rZ2SrVCIZCAsSKPtt+qQcGmJxt1YUtW0yD32aDJWQ3mm7EQTtjc+ 6dNZF5eI0322YPMePzAb1SvEc+T4b1otUS/wxENnA4D8s0lBVn1L47Ajt2E8/SP7 rv0XTUnzwc5s4qjNNUqidvrSvmYqj5DhMh3veSb+FDm3DSKlB3Z1eq3yx0+g2ghR zsa2cUnX/6y26paeMqCMiFOAWSqQa80TBjgDyRiul2jrPeaM/As2Cr657MKugvi9 4vMg9CqmLiwerTkicv5kOsUFAetdLCuvnqNqol3DFRxJ+4bbOp3VQccrBXWtZY0= =QRsk -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-10-08' into staging trivial patches for 2015-10-08 # gpg: Signature made Thu 08 Oct 2015 17:51:05 BST using RSA key ID A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" * remotes/mjt/tags/pull-trivial-patches-2015-10-08: tests: Unique test path for /string-visitor/output linux-user: Remove type casts to union type linux-user: Use g_new() & friends where that makes obvious sense rocker: Use g_new() & friends where that makes obvious sense .travis.yml: Run make check for all targets, not just some hw: char: Remove unnecessary variable hw: timer: Remove unnecessary variable qapi: add missing @ MAINTAINERS: Add NSIS file for W32, W64 hosts target-ppc: Remove unnecessary variable target-microblaze: Remove unnecessary variable s/cpu_get_real_ticks/cpu_get_host_ticks/ pc: check for underflow in load_linux pci-assign: do not include sys/io.h block/ssh: remove dead code imx_serial: Generate interrupt on tx empty if enabled sdhci: Change debug prints to compile unconditionally sdhci: use PRIx64 for uint64_t type Add .dir-locals.el file to configure emacs coding style Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
						commit
						8be6e623a2
					
				| 
						 | 
				
			
			@ -0,0 +1,2 @@
 | 
			
		|||
((c-mode . ((c-file-style . "stroustrup")
 | 
			
		||||
	    (indent-tabs-mode . nil))))
 | 
			
		||||
							
								
								
									
										10
									
								
								.travis.yml
								
								
								
								
							
							
						
						
									
										10
									
								
								.travis.yml
								
								
								
								
							| 
						 | 
				
			
			@ -54,15 +54,7 @@ matrix:
 | 
			
		|||
  include:
 | 
			
		||||
    # Make check target (we only do this once)
 | 
			
		||||
    - env:
 | 
			
		||||
        - TARGETS=alpha-softmmu,arm-softmmu,aarch64-softmmu,cris-softmmu,
 | 
			
		||||
                  i386-softmmu,x86_64-softmmu,m68k-softmmu,microblaze-softmmu,
 | 
			
		||||
                  microblazeel-softmmu,mips-softmmu,mips64-softmmu,
 | 
			
		||||
                  mips64el-softmmu,mipsel-softmmu,or32-softmmu,ppc-softmmu,
 | 
			
		||||
                  ppc64-softmmu,ppcemb-softmmu,s390x-softmmu,sh4-softmmu,
 | 
			
		||||
                  sh4eb-softmmu,sparc-softmmu,sparc64-softmmu,
 | 
			
		||||
                  unicore32-softmmu,unicore32-linux-user,
 | 
			
		||||
                  lm32-softmmu,moxie-softmmu,tricore-softmmu,xtensa-softmmu,
 | 
			
		||||
                  xtensaeb-softmmu
 | 
			
		||||
        - TARGETS=alpha-softmmu,arm-softmmu,aarch64-softmmu,cris-softmmu,i386-softmmu,x86_64-softmmu,m68k-softmmu,microblaze-softmmu,microblazeel-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,or32-softmmu,ppc-softmmu,ppc64-softmmu,ppcemb-softmmu,s390x-softmmu,sh4-softmmu,sh4eb-softmmu,sparc-softmmu,sparc64-softmmu,unicore32-softmmu,unicore32-linux-user,lm32-softmmu,moxie-softmmu,tricore-softmmu,xtensa-softmmu,xtensaeb-softmmu
 | 
			
		||||
          TEST_CMD="make check"
 | 
			
		||||
      compiler: gcc
 | 
			
		||||
    # Debug related options
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -275,6 +275,7 @@ L: qemu-devel@nongnu.org
 | 
			
		|||
M: Stefan Weil <sw@weilnetz.de>
 | 
			
		||||
S: Maintained
 | 
			
		||||
F: *win32*
 | 
			
		||||
F: qemu.nsi
 | 
			
		||||
 | 
			
		||||
ARM Machines
 | 
			
		||||
------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -193,7 +193,7 @@ sftp_error_report(BDRVSSHState *s, const char *fs, ...)
 | 
			
		|||
static int parse_uri(const char *filename, QDict *options, Error **errp)
 | 
			
		||||
{
 | 
			
		||||
    URI *uri = NULL;
 | 
			
		||||
    QueryParams *qp = NULL;
 | 
			
		||||
    QueryParams *qp;
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    uri = uri_parse(filename);
 | 
			
		||||
| 
						 | 
				
			
			@ -249,9 +249,6 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
 | 
			
		|||
    return 0;
 | 
			
		||||
 | 
			
		||||
 err:
 | 
			
		||||
    if (qp) {
 | 
			
		||||
      query_params_free(qp);
 | 
			
		||||
    }
 | 
			
		||||
    if (uri) {
 | 
			
		||||
      uri_free(uri);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -108,7 +108,7 @@ void cpu_list_unlock(void)
 | 
			
		|||
 | 
			
		||||
uint64_t cpu_get_tsc(CPUX86State *env)
 | 
			
		||||
{
 | 
			
		||||
    return cpu_get_real_ticks();
 | 
			
		||||
    return cpu_get_host_ticks();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void write_dt(void *ptr, unsigned long addr, unsigned long limit,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										6
									
								
								cpus.c
								
								
								
								
							
							
						
						
									
										6
									
								
								cpus.c
								
								
								
								
							| 
						 | 
				
			
			@ -199,7 +199,7 @@ int64_t cpu_get_ticks(void)
 | 
			
		|||
 | 
			
		||||
    ticks = timers_state.cpu_ticks_offset;
 | 
			
		||||
    if (timers_state.cpu_ticks_enabled) {
 | 
			
		||||
        ticks += cpu_get_real_ticks();
 | 
			
		||||
        ticks += cpu_get_host_ticks();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (timers_state.cpu_ticks_prev > ticks) {
 | 
			
		||||
| 
						 | 
				
			
			@ -247,7 +247,7 @@ void cpu_enable_ticks(void)
 | 
			
		|||
    /* Here, the really thing protected by seqlock is cpu_clock_offset. */
 | 
			
		||||
    seqlock_write_lock(&timers_state.vm_clock_seqlock);
 | 
			
		||||
    if (!timers_state.cpu_ticks_enabled) {
 | 
			
		||||
        timers_state.cpu_ticks_offset -= cpu_get_real_ticks();
 | 
			
		||||
        timers_state.cpu_ticks_offset -= cpu_get_host_ticks();
 | 
			
		||||
        timers_state.cpu_clock_offset -= get_clock();
 | 
			
		||||
        timers_state.cpu_ticks_enabled = 1;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -263,7 +263,7 @@ void cpu_disable_ticks(void)
 | 
			
		|||
    /* Here, the really thing protected by seqlock is cpu_clock_offset. */
 | 
			
		||||
    seqlock_write_lock(&timers_state.vm_clock_seqlock);
 | 
			
		||||
    if (timers_state.cpu_ticks_enabled) {
 | 
			
		||||
        timers_state.cpu_ticks_offset += cpu_get_real_ticks();
 | 
			
		||||
        timers_state.cpu_ticks_offset += cpu_get_host_ticks();
 | 
			
		||||
        timers_state.cpu_clock_offset = cpu_get_clock_locked();
 | 
			
		||||
        timers_state.cpu_ticks_enabled = 0;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -182,15 +182,13 @@ static void serial_receive(void *opaque, const uint8_t *buf, int size)
 | 
			
		|||
static int serial_can_receive(void *opaque)
 | 
			
		||||
{
 | 
			
		||||
    ETRAXSerial *s = opaque;
 | 
			
		||||
    int r;
 | 
			
		||||
 | 
			
		||||
    /* Is the receiver enabled?  */
 | 
			
		||||
    if (!(s->regs[RW_REC_CTRL] & (1 << 3))) {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    r = sizeof(s->rx_fifo) - s->rx_fifo_len;
 | 
			
		||||
    return r;
 | 
			
		||||
    return sizeof(s->rx_fifo) - s->rx_fifo_len;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void serial_event(void *opaque, int event)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,7 +66,9 @@ static void imx_update(IMXSerialState *s)
 | 
			
		|||
    uint32_t flags;
 | 
			
		||||
 | 
			
		||||
    flags = (s->usr1 & s->ucr1) & (USR1_TRDY|USR1_RRDY);
 | 
			
		||||
    if (!(s->ucr1 & UCR1_TXMPTYEN)) {
 | 
			
		||||
    if (s->ucr1 & UCR1_TXMPTYEN) {
 | 
			
		||||
        flags |= (s->uts1 & UTS1_TXEMPTY);
 | 
			
		||||
    } else {
 | 
			
		||||
        flags &= ~USR1_TRDY;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,6 @@
 | 
			
		|||
 */
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <sys/io.h>
 | 
			
		||||
#include <sys/mman.h>
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -985,6 +985,10 @@ static void load_linux(PCMachineState *pcms,
 | 
			
		|||
        setup_size = 4;
 | 
			
		||||
    }
 | 
			
		||||
    setup_size = (setup_size+1)*512;
 | 
			
		||||
    if (setup_size > kernel_size) {
 | 
			
		||||
        fprintf(stderr, "qemu: invalid kernel header\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    kernel_size -= setup_size;
 | 
			
		||||
 | 
			
		||||
    setup  = g_malloc(setup_size);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -848,7 +848,7 @@ static target_ulong h_xirr_x(PowerPCCPU *cpu, sPAPRMachineState *spapr,
 | 
			
		|||
    uint32_t xirr = icp_accept(ss);
 | 
			
		||||
 | 
			
		||||
    args[0] = xirr;
 | 
			
		||||
    args[1] = cpu_get_real_ticks();
 | 
			
		||||
    args[1] = cpu_get_host_ticks();
 | 
			
		||||
    return H_SUCCESS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1362,7 +1362,7 @@ static int pci_rocker_init(PCIDevice *dev)
 | 
			
		|||
        r->fp_ports = ROCKER_FP_PORTS_MAX;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    r->rings = g_malloc(sizeof(DescRing *) * rocker_pci_ring_count(r));
 | 
			
		||||
    r->rings = g_new(DescRing *, rocker_pci_ring_count(r));
 | 
			
		||||
    if (!r->rings) {
 | 
			
		||||
        goto err_rings_alloc;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -142,7 +142,7 @@ bool desc_ring_set_size(DescRing *ring, uint32_t size)
 | 
			
		|||
    ring->size = size;
 | 
			
		||||
    ring->head = ring->tail = 0;
 | 
			
		||||
 | 
			
		||||
    ring->info = g_realloc(ring->info, size * sizeof(DescInfo));
 | 
			
		||||
    ring->info = g_renew(DescInfo, ring->info, size);
 | 
			
		||||
    if (!ring->info) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -345,7 +345,7 @@ DescRing *desc_ring_alloc(Rocker *r, int index)
 | 
			
		|||
{
 | 
			
		||||
    DescRing *ring;
 | 
			
		||||
 | 
			
		||||
    ring = g_malloc0(sizeof(DescRing));
 | 
			
		||||
    ring = g_new0(DescRing, 1);
 | 
			
		||||
    if (!ring) {
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -218,7 +218,7 @@ FpPort *fp_port_alloc(Rocker *r, char *sw_name,
 | 
			
		|||
                      MACAddr *start_mac, unsigned int index,
 | 
			
		||||
                      NICPeers *peers)
 | 
			
		||||
{
 | 
			
		||||
    FpPort *port = g_malloc0(sizeof(FpPort));
 | 
			
		||||
    FpPort *port = g_new0(FpPort, 1);
 | 
			
		||||
 | 
			
		||||
    if (!port) {
 | 
			
		||||
        return NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -367,7 +367,7 @@ static OfDpaFlow *of_dpa_flow_alloc(uint64_t cookie)
 | 
			
		|||
    OfDpaFlow *flow;
 | 
			
		||||
    int64_t now = qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) / 1000;
 | 
			
		||||
 | 
			
		||||
    flow = g_malloc0(sizeof(OfDpaFlow));
 | 
			
		||||
    flow = g_new0(OfDpaFlow, 1);
 | 
			
		||||
    if (!flow) {
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -811,7 +811,7 @@ static int of_dpa_group_get_stats(OfDpa *of_dpa, uint32_t id)
 | 
			
		|||
 | 
			
		||||
static OfDpaGroup *of_dpa_group_alloc(uint32_t id)
 | 
			
		||||
{
 | 
			
		||||
    OfDpaGroup *group = g_malloc0(sizeof(OfDpaGroup));
 | 
			
		||||
    OfDpaGroup *group = g_new0(OfDpaGroup, 1);
 | 
			
		||||
 | 
			
		||||
    if (!group) {
 | 
			
		||||
        return NULL;
 | 
			
		||||
| 
						 | 
				
			
			@ -2039,15 +2039,14 @@ static int of_dpa_cmd_add_l2_flood(OfDpa *of_dpa, OfDpaGroup *group,
 | 
			
		|||
    group->l2_flood.group_count =
 | 
			
		||||
        rocker_tlv_get_le16(group_tlvs[ROCKER_TLV_OF_DPA_GROUP_COUNT]);
 | 
			
		||||
 | 
			
		||||
    tlvs = g_malloc0((group->l2_flood.group_count + 1) *
 | 
			
		||||
                     sizeof(RockerTlv *));
 | 
			
		||||
    tlvs = g_new0(RockerTlv *, group->l2_flood.group_count + 1);
 | 
			
		||||
    if (!tlvs) {
 | 
			
		||||
        return -ROCKER_ENOMEM;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    g_free(group->l2_flood.group_ids);
 | 
			
		||||
    group->l2_flood.group_ids =
 | 
			
		||||
        g_malloc0(group->l2_flood.group_count * sizeof(uint32_t));
 | 
			
		||||
        g_new0(uint32_t, group->l2_flood.group_count);
 | 
			
		||||
    if (!group->l2_flood.group_ids) {
 | 
			
		||||
        err = -ROCKER_ENOMEM;
 | 
			
		||||
        goto err_out;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -834,7 +834,7 @@ static void cpu_ppc_set_tb_clk (void *opaque, uint32_t freq)
 | 
			
		|||
static void timebase_pre_save(void *opaque)
 | 
			
		||||
{
 | 
			
		||||
    PPCTimebase *tb = opaque;
 | 
			
		||||
    uint64_t ticks = cpu_get_real_ticks();
 | 
			
		||||
    uint64_t ticks = cpu_get_host_ticks();
 | 
			
		||||
    PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu);
 | 
			
		||||
 | 
			
		||||
    if (!first_ppc_cpu->env.tb_env) {
 | 
			
		||||
| 
						 | 
				
			
			@ -878,7 +878,7 @@ static int timebase_post_load(void *opaque, int version_id)
 | 
			
		|||
                                     NANOSECONDS_PER_SECOND);
 | 
			
		||||
    guest_tb = tb_remote->guest_timebase + MIN(0, migration_duration_tb);
 | 
			
		||||
 | 
			
		||||
    tb_off_adj = guest_tb - cpu_get_real_ticks();
 | 
			
		||||
    tb_off_adj = guest_tb - cpu_get_host_ticks();
 | 
			
		||||
 | 
			
		||||
    tb_off = first_ppc_cpu->env.tb_env->tb_offset;
 | 
			
		||||
    trace_ppc_tb_adjust(tb_off, tb_off_adj, tb_off_adj - tb_off,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,7 @@
 | 
			
		|||
 * with this program; if not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include "hw/hw.h"
 | 
			
		||||
#include "sysemu/block-backend.h"
 | 
			
		||||
#include "sysemu/blockdev.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -36,24 +37,24 @@
 | 
			
		|||
#define SDHC_DEBUG                        0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if SDHC_DEBUG == 0
 | 
			
		||||
    #define DPRINT_L1(fmt, args...)       do { } while (0)
 | 
			
		||||
    #define DPRINT_L2(fmt, args...)       do { } while (0)
 | 
			
		||||
    #define ERRPRINT(fmt, args...)        do { } while (0)
 | 
			
		||||
#elif SDHC_DEBUG == 1
 | 
			
		||||
    #define DPRINT_L1(fmt, args...)       \
 | 
			
		||||
        do {fprintf(stderr, "QEMU SDHC: "fmt, ## args); } while (0)
 | 
			
		||||
    #define DPRINT_L2(fmt, args...)       do { } while (0)
 | 
			
		||||
    #define ERRPRINT(fmt, args...)        \
 | 
			
		||||
        do {fprintf(stderr, "QEMU SDHC ERROR: "fmt, ## args); } while (0)
 | 
			
		||||
#else
 | 
			
		||||
    #define DPRINT_L1(fmt, args...)       \
 | 
			
		||||
        do {fprintf(stderr, "QEMU SDHC: "fmt, ## args); } while (0)
 | 
			
		||||
    #define DPRINT_L2(fmt, args...)       \
 | 
			
		||||
        do {fprintf(stderr, "QEMU SDHC: "fmt, ## args); } while (0)
 | 
			
		||||
    #define ERRPRINT(fmt, args...)        \
 | 
			
		||||
        do {fprintf(stderr, "QEMU SDHC ERROR: "fmt, ## args); } while (0)
 | 
			
		||||
#endif
 | 
			
		||||
#define DPRINT_L1(fmt, args...) \
 | 
			
		||||
    do { \
 | 
			
		||||
        if (SDHC_DEBUG) { \
 | 
			
		||||
            fprintf(stderr, "QEMU SDHC: " fmt, ## args); \
 | 
			
		||||
        } \
 | 
			
		||||
    } while (0)
 | 
			
		||||
#define DPRINT_L2(fmt, args...) \
 | 
			
		||||
    do { \
 | 
			
		||||
        if (SDHC_DEBUG > 1) { \
 | 
			
		||||
            fprintf(stderr, "QEMU SDHC: " fmt, ## args); \
 | 
			
		||||
        } \
 | 
			
		||||
    } while (0)
 | 
			
		||||
#define ERRPRINT(fmt, args...) \
 | 
			
		||||
    do { \
 | 
			
		||||
        if (SDHC_DEBUG) { \
 | 
			
		||||
            fprintf(stderr, "QEMU SDHC ERROR: " fmt, ## args); \
 | 
			
		||||
        } \
 | 
			
		||||
    } while (0)
 | 
			
		||||
 | 
			
		||||
/* Default SD/MMC host controller features information, which will be
 | 
			
		||||
 * presented in CAPABILITIES register of generic SD host controller at reset.
 | 
			
		||||
| 
						 | 
				
			
			@ -719,7 +720,8 @@ static void sdhci_do_adma(SDHCIState *s)
 | 
			
		|||
            break;
 | 
			
		||||
        case SDHC_ADMA_ATTR_ACT_LINK:   /* link to next descriptor table */
 | 
			
		||||
            s->admasysaddr = dscr.addr;
 | 
			
		||||
            DPRINT_L1("ADMA link: admasysaddr=0x%lx\n", s->admasysaddr);
 | 
			
		||||
            DPRINT_L1("ADMA link: admasysaddr=0x%" PRIx64 "\n",
 | 
			
		||||
                      s->admasysaddr);
 | 
			
		||||
            break;
 | 
			
		||||
        default:
 | 
			
		||||
            s->admasysaddr += dscr.incr;
 | 
			
		||||
| 
						 | 
				
			
			@ -727,7 +729,8 @@ static void sdhci_do_adma(SDHCIState *s)
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        if (dscr.attr & SDHC_ADMA_ATTR_INT) {
 | 
			
		||||
            DPRINT_L1("ADMA interrupt: admasysaddr=0x%lx\n", s->admasysaddr);
 | 
			
		||||
            DPRINT_L1("ADMA interrupt: admasysaddr=0x%" PRIx64 "\n",
 | 
			
		||||
                      s->admasysaddr);
 | 
			
		||||
            if (s->norintstsen & SDHC_NISEN_DMA) {
 | 
			
		||||
                s->norintsts |= SDHC_NIS_DMA;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -590,10 +590,8 @@ static void nvram_writel (void *opaque, hwaddr addr, uint32_t value)
 | 
			
		|||
static uint32_t nvram_readb (void *opaque, hwaddr addr)
 | 
			
		||||
{
 | 
			
		||||
    M48t59State *NVRAM = opaque;
 | 
			
		||||
    uint32_t retval;
 | 
			
		||||
 | 
			
		||||
    retval = m48t59_read(NVRAM, addr);
 | 
			
		||||
    return retval;
 | 
			
		||||
    return m48t59_read(NVRAM, addr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t nvram_readw (void *opaque, hwaddr addr)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -857,7 +857,7 @@ int64_t cpu_icount_to_ns(int64_t icount);
 | 
			
		|||
 | 
			
		||||
#if defined(_ARCH_PPC)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t retval;
 | 
			
		||||
#ifdef _ARCH_PPC64
 | 
			
		||||
| 
						 | 
				
			
			@ -883,7 +883,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
 | 
			
		||||
#elif defined(__i386__)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t val;
 | 
			
		||||
    asm volatile ("rdtsc" : "=A" (val));
 | 
			
		||||
| 
						 | 
				
			
			@ -892,7 +892,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
 | 
			
		||||
#elif defined(__x86_64__)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    uint32_t low,high;
 | 
			
		||||
    int64_t val;
 | 
			
		||||
| 
						 | 
				
			
			@ -905,7 +905,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
 | 
			
		||||
#elif defined(__hppa__)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    int val;
 | 
			
		||||
    asm volatile ("mfctl %%cr16, %0" : "=r"(val));
 | 
			
		||||
| 
						 | 
				
			
			@ -914,7 +914,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
 | 
			
		||||
#elif defined(__ia64)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t val;
 | 
			
		||||
    asm volatile ("mov %0 = ar.itc" : "=r"(val) :: "memory");
 | 
			
		||||
| 
						 | 
				
			
			@ -923,7 +923,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
 | 
			
		||||
#elif defined(__s390__)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    int64_t val;
 | 
			
		||||
    asm volatile("stck 0(%1)" : "=m" (val) : "a" (&val) : "cc");
 | 
			
		||||
| 
						 | 
				
			
			@ -932,7 +932,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
 | 
			
		||||
#elif defined(__sparc__)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks (void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks (void)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_LP64)
 | 
			
		||||
    uint64_t        rval;
 | 
			
		||||
| 
						 | 
				
			
			@ -970,7 +970,7 @@ static inline int64_t cpu_get_real_ticks (void)
 | 
			
		|||
                              : "=r" (value));          \
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    /* On kernels >= 2.6.25 rdhwr <reg>, $2 and $3 are emulated */
 | 
			
		||||
    uint32_t count;
 | 
			
		||||
| 
						 | 
				
			
			@ -986,7 +986,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
 | 
			
		||||
#elif defined(__alpha__)
 | 
			
		||||
 | 
			
		||||
static inline int64_t cpu_get_real_ticks(void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks(void)
 | 
			
		||||
{
 | 
			
		||||
    uint64_t cc;
 | 
			
		||||
    uint32_t cur, ofs;
 | 
			
		||||
| 
						 | 
				
			
			@ -1001,7 +1001,7 @@ static inline int64_t cpu_get_real_ticks(void)
 | 
			
		|||
/* The host CPU doesn't have an easily accessible cycle counter.
 | 
			
		||||
   Just return a monotonically increasing value.  This will be
 | 
			
		||||
   totally wrong, but hopefully better than nothing.  */
 | 
			
		||||
static inline int64_t cpu_get_real_ticks (void)
 | 
			
		||||
static inline int64_t cpu_get_host_ticks (void)
 | 
			
		||||
{
 | 
			
		||||
    static int64_t ticks = 0;
 | 
			
		||||
    return ticks++;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2853,7 +2853,7 @@ static int fill_note_info(struct elf_note_info *info,
 | 
			
		|||
    TaskState *ts = (TaskState *)cpu->opaque;
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    info->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote));
 | 
			
		||||
    info->notes = g_new0(struct memelfnote, NUMNOTES);
 | 
			
		||||
    if (info->notes == NULL)
 | 
			
		||||
        return (-ENOMEM);
 | 
			
		||||
    info->prstatus = g_malloc0(sizeof (*info->prstatus));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -215,7 +215,7 @@ void cpu_list_unlock(void)
 | 
			
		|||
 | 
			
		||||
uint64_t cpu_get_tsc(CPUX86State *env)
 | 
			
		||||
{
 | 
			
		||||
    return cpu_get_real_ticks();
 | 
			
		||||
    return cpu_get_host_ticks();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void write_dt(void *ptr, unsigned long addr, unsigned long limit,
 | 
			
		||||
| 
						 | 
				
			
			@ -1425,7 +1425,7 @@ void cpu_loop (CPUSPARCState *env)
 | 
			
		|||
#ifdef TARGET_PPC
 | 
			
		||||
static inline uint64_t cpu_ppc_get_tb(CPUPPCState *env)
 | 
			
		||||
{
 | 
			
		||||
    return cpu_get_real_ticks();
 | 
			
		||||
    return cpu_get_host_ticks();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint64_t cpu_ppc_load_tbl(CPUPPCState *env)
 | 
			
		||||
| 
						 | 
				
			
			@ -4270,7 +4270,7 @@ int main(int argc, char **argv, char **envp)
 | 
			
		|||
    }
 | 
			
		||||
    target_argv[target_argc] = NULL;
 | 
			
		||||
 | 
			
		||||
    ts = g_malloc0 (sizeof(TaskState));
 | 
			
		||||
    ts = g_new0(TaskState, 1);
 | 
			
		||||
    init_task_state(ts);
 | 
			
		||||
    /* build Task State */
 | 
			
		||||
    ts->info = info;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2728,8 +2728,9 @@ static inline abi_long host_to_target_semarray(int semid, abi_ulong target_addr,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static inline abi_long do_semctl(int semid, int semnum, int cmd,
 | 
			
		||||
                                 union target_semun target_su)
 | 
			
		||||
                                 abi_ulong target_arg)
 | 
			
		||||
{
 | 
			
		||||
    union target_semun target_su = { .buf = target_arg };
 | 
			
		||||
    union semun arg;
 | 
			
		||||
    struct semid_ds dsarg;
 | 
			
		||||
    unsigned short *array = NULL;
 | 
			
		||||
| 
						 | 
				
			
			@ -3251,8 +3252,7 @@ static abi_long do_ipc(unsigned int call, abi_long first,
 | 
			
		|||
         * ptr argument. */
 | 
			
		||||
        abi_ulong atptr;
 | 
			
		||||
        get_user_ual(atptr, ptr);
 | 
			
		||||
        ret = do_semctl(first, second, third,
 | 
			
		||||
                (union target_semun) atptr);
 | 
			
		||||
        ret = do_semctl(first, second, third, atptr);
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -4566,7 +4566,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
 | 
			
		|||
        new_thread_info info;
 | 
			
		||||
        pthread_attr_t attr;
 | 
			
		||||
 | 
			
		||||
        ts = g_malloc0(sizeof(TaskState));
 | 
			
		||||
        ts = g_new0(TaskState, 1);
 | 
			
		||||
        init_task_state(ts);
 | 
			
		||||
        /* we create a new CPU instance. */
 | 
			
		||||
        new_env = cpu_copy(env);
 | 
			
		||||
| 
						 | 
				
			
			@ -7550,7 +7550,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 | 
			
		|||
#endif
 | 
			
		||||
#ifdef TARGET_NR_semctl
 | 
			
		||||
    case TARGET_NR_semctl:
 | 
			
		||||
        ret = do_semctl(arg1, arg2, arg3, (union target_semun)(abi_ulong)arg4);
 | 
			
		||||
        ret = do_semctl(arg1, arg2, arg3, arg4);
 | 
			
		||||
        break;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef TARGET_NR_msgctl
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
{ 'include': 'block-core.json' }
 | 
			
		||||
 | 
			
		||||
##
 | 
			
		||||
# BiosAtaTranslation:
 | 
			
		||||
# @BiosAtaTranslation:
 | 
			
		||||
#
 | 
			
		||||
# Policy that BIOS should use to interpret cylinder/head/sector
 | 
			
		||||
# addresses.  Note that Bochs BIOS and SeaBIOS will not actually
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,7 +34,7 @@ uint64_t helper_load_pcc(CPUAlphaState *env)
 | 
			
		|||
#else
 | 
			
		||||
    /* In user-mode, QEMU_CLOCK_VIRTUAL doesn't exist.  Just pass through the host cpu
 | 
			
		||||
       clock ticks.  Also, don't bother taking PCC_OFS into account.  */
 | 
			
		||||
    return (uint32_t)cpu_get_real_ticks();
 | 
			
		||||
    return (uint32_t)cpu_get_host_ticks();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -150,9 +150,7 @@ uint32_t helper_clz(uint32_t t0)
 | 
			
		|||
 | 
			
		||||
uint32_t helper_carry(uint32_t a, uint32_t b, uint32_t cf)
 | 
			
		||||
{
 | 
			
		||||
    uint32_t ncf;
 | 
			
		||||
    ncf = compute_carry(a, b, cf);
 | 
			
		||||
    return ncf;
 | 
			
		||||
    return compute_carry(a, b, cf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline int div_prepare(CPUMBState *env, uint32_t a, uint32_t b)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1782,8 +1782,7 @@ uint32_t kvmppc_get_tbfreq(void)
 | 
			
		|||
 | 
			
		||||
    ns++;
 | 
			
		||||
 | 
			
		||||
    retval = atoi(ns);
 | 
			
		||||
    return retval;
 | 
			
		||||
    return atoi(ns);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool kvmppc_get_host_serial(char **value)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -248,39 +248,39 @@ int main(int argc, char **argv)
 | 
			
		|||
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/int",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_int, false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/int",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/int-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_int, true);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/bool",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_bool, false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/bool",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/bool-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_bool, true);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/number",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_number, false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/number",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/number-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_number, true);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/string",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_string, false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/string",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/string-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_string, true);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/no-string",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_no_string,
 | 
			
		||||
                            false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/no-string",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/no-string-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_no_string,
 | 
			
		||||
                            true);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/enum",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_enum, false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/enum",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/enum-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_enum, true);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/enum-errors",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_enum_errors,
 | 
			
		||||
                            false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/enum-errors",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/enum-errors-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_enum_errors,
 | 
			
		||||
                            true);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/intList",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_intList, false);
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/intList",
 | 
			
		||||
    output_visitor_test_add("/string-visitor/output/intList-human",
 | 
			
		||||
                            &out_visitor_data, test_visitor_out_intList, true);
 | 
			
		||||
 | 
			
		||||
    g_test_run();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue