Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-0…
Browse files Browse the repository at this point in the history
…3-27' into staging

trivial patches for 2014-03-27

# gpg: Signature made Thu 27 Mar 2014 15:23:53 GMT using RSA key ID 74F0C838
# gpg: Good signature from "Michael Tokarev <[email protected]>"
# gpg:                 aka "Michael Tokarev <[email protected]>"
# gpg:                 aka "Michael Tokarev <[email protected]>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: E190 8639 3B10 B51B AC2C  8B73 5253 C5AD 74F0 C838

* remotes/mjt/tags/trivial-patches-2014-03-27: (23 commits)
  linux-user: remove duplicate statement
  hw/timer/grlib_gptimer: remove unnecessary assignment
  hw/pci-host/apb.c: Avoid shifting left into sign bit
  hw/intc/xilinx_intc: Avoid shifting left into sign bit
  hw/intc/slavio_intctl: Avoid shifting left into sign bit
  tests/libqos/pci-pc: Avoid shifting left into sign bit
  hw/ppc: Avoid shifting left into sign bit
  hw/intc/openpic: Avoid shifting left into sign bit
  hw/usb/hcd-ohci.c: Avoid shifting left into sign bit
  target-mips: Avoid shifting left into sign bit
  hw/i386/acpi_build.c: Avoid shifting left into sign bit
  hw/pci/pci_host.c: Avoid shifting left into sign bit
  hw/intc/apic.c: Use uint32_t for mask word in foreach_apic
  target-i386: Avoid shifting left into sign bit
  CODING_STYLE: Section about mixed declarations
  doc: update default PowerPC framebuffer settings
  doc: update sun4m documentation
  fix return check for KVM_GET_DIRTY_LOG ioctl
  target-i386: Add missing 'static' and 'const' attributes
  util: Add 'static' attribute to function implementation
  ...

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed Mar 27, 2014
2 parents 6ff45f0 + 3768d50 commit c6c09ba
Show file tree
Hide file tree
Showing 31 changed files with 276 additions and 261 deletions.
7 changes: 7 additions & 0 deletions CODING_STYLE
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,10 @@ and clarity it comes on a line by itself:
Rationale: a consistent (except for functions...) bracing style reduces
ambiguity and avoids needless churn when lines are added or removed.
Furthermore, it is the QEMU coding style.

5. Declarations

Mixed declarations (interleaving statements and declarations within blocks)
are not allowed; declarations should be at the beginning of blocks. In other
words, the code should not generate warnings if using GCC's
-Wdeclaration-after-statement option.
2 changes: 1 addition & 1 deletion hw/i386/acpi-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)

build_append_byte(notify, 0x7B); /* AndOp */
build_append_byte(notify, 0x68); /* Arg0Op */
build_append_int(notify, 0x1 << i);
build_append_int(notify, 0x1U << i);
build_append_byte(notify, 0x00); /* NullName */
build_append_byte(notify, 0x86); /* NotifyOp */
build_append_nameseg(notify, "S%.02X_", PCI_DEVFN(i, 0));
Expand Down
2 changes: 1 addition & 1 deletion hw/ide/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static const VMStateDescription vmstate_bmdma_current = {
}
};

const VMStateDescription vmstate_bmdma_status = {
static const VMStateDescription vmstate_bmdma_status = {
.name ="ide bmdma/status",
.version_id = 1,
.minimum_version_id = 1,
Expand Down
6 changes: 3 additions & 3 deletions hw/intc/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ static void apic_external_nmi(APICCommonState *s)

#define foreach_apic(apic, deliver_bitmask, code) \
{\
int __i, __j, __mask;\
int __i, __j;\
for(__i = 0; __i < MAX_APIC_WORDS; __i++) {\
__mask = deliver_bitmask[__i];\
uint32_t __mask = deliver_bitmask[__i];\
if (__mask) {\
for(__j = 0; __j < 32; __j++) {\
if (__mask & (1 << __j)) {\
if (__mask & (1U << __j)) {\
apic = local_apics[__i * 32 + __j];\
if (apic) {\
code;\
Expand Down
14 changes: 7 additions & 7 deletions hw/intc/openpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static FslMpicInfo fsl_mpic_42 = {
#define TCCR_TOG 0x80000000 /* toggles when decrement to zero */

#define IDR_EP_SHIFT 31
#define IDR_EP_MASK (1 << IDR_EP_SHIFT)
#define IDR_EP_MASK (1U << IDR_EP_SHIFT)
#define IDR_CI0_SHIFT 30
#define IDR_CI1_SHIFT 29
#define IDR_P1_SHIFT 1
Expand Down Expand Up @@ -220,17 +220,17 @@ typedef struct IRQSource {
} IRQSource;

#define IVPR_MASK_SHIFT 31
#define IVPR_MASK_MASK (1 << IVPR_MASK_SHIFT)
#define IVPR_MASK_MASK (1U << IVPR_MASK_SHIFT)
#define IVPR_ACTIVITY_SHIFT 30
#define IVPR_ACTIVITY_MASK (1 << IVPR_ACTIVITY_SHIFT)
#define IVPR_ACTIVITY_MASK (1U << IVPR_ACTIVITY_SHIFT)
#define IVPR_MODE_SHIFT 29
#define IVPR_MODE_MASK (1 << IVPR_MODE_SHIFT)
#define IVPR_MODE_MASK (1U << IVPR_MODE_SHIFT)
#define IVPR_POLARITY_SHIFT 23
#define IVPR_POLARITY_MASK (1 << IVPR_POLARITY_SHIFT)
#define IVPR_POLARITY_MASK (1U << IVPR_POLARITY_SHIFT)
#define IVPR_SENSE_SHIFT 22
#define IVPR_SENSE_MASK (1 << IVPR_SENSE_SHIFT)
#define IVPR_SENSE_MASK (1U << IVPR_SENSE_SHIFT)

#define IVPR_PRIORITY_MASK (0xF << 16)
#define IVPR_PRIORITY_MASK (0xFU << 16)
#define IVPR_PRIORITY(_ivprr_) ((int)(((_ivprr_) & IVPR_PRIORITY_MASK) >> 16))
#define IVPR_VECTOR(opp, _ivprr_) ((_ivprr_) & (opp)->vector_mask)

Expand Down
2 changes: 1 addition & 1 deletion hw/intc/slavio_intctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs)
CPU_IRQ_TIMER_IN;
if (i == s->target_cpu) {
for (j = 0; j < 32; j++) {
if ((s->intregm_pending & (1 << j)) && intbit_to_level[j]) {
if ((s->intregm_pending & (1U << j)) && intbit_to_level[j]) {
s->slaves[i].intreg_pending |= 1 << intbit_to_level[j];
}
}
Expand Down
3 changes: 2 additions & 1 deletion hw/intc/xilinx_intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ static void update_irq(struct xlx_pic *p)

/* Update the vector register. */
for (i = 0; i < 32; i++) {
if (p->regs[R_IPR] & (1 << i))
if (p->regs[R_IPR] & (1U << i)) {
break;
}
}
if (i == 32)
i = ~0;
Expand Down
10 changes: 5 additions & 5 deletions hw/pci-host/apb.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ do { printf("APB: " fmt , ## __VA_ARGS__); } while (0)
#define PBM_PCI_IMR_MASK 0x7fffffff
#define PBM_PCI_IMR_ENABLED 0x80000000

#define POR (1 << 31)
#define SOFT_POR (1 << 30)
#define SOFT_XIR (1 << 29)
#define BTN_POR (1 << 28)
#define BTN_XIR (1 << 27)
#define POR (1U << 31)
#define SOFT_POR (1U << 30)
#define SOFT_XIR (1U << 29)
#define BTN_POR (1U << 28)
#define BTN_XIR (1U << 27)
#define RESET_MASK 0xf8000000
#define RESET_WCMASK 0x98000000
#define RESET_WMASK 0x60000000
Expand Down
3 changes: 2 additions & 1 deletion hw/pci/pci_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ static uint64_t pci_host_data_read(void *opaque,
{
PCIHostState *s = opaque;
uint32_t val;
if (!(s->config_reg & (1 << 31)))
if (!(s->config_reg & (1U << 31))) {
return 0xffffffff;
}
val = pci_data_read(s->bus, s->config_reg | (addr & 3), len);
PCI_DPRINTF("read addr " TARGET_FMT_plx " len %d val %x\n",
addr, len, val);
Expand Down
2 changes: 1 addition & 1 deletion hw/ppc/ppc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ static void cpu_4xx_wdt_cb (void *opaque)
case 0x1:
timer_mod(ppc40x_timer->wdt_timer, next);
ppc40x_timer->wdt_next = next;
env->spr[SPR_40x_TSR] |= 1 << 31;
env->spr[SPR_40x_TSR] |= 1U << 31;
break;
case 0x2:
timer_mod(ppc40x_timer->wdt_timer, next);
Expand Down
4 changes: 2 additions & 2 deletions hw/ppc/ppc440_bamboo.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env,

tlb->attr = 0;
tlb->prot = PAGE_VALID | ((PAGE_READ | PAGE_WRITE | PAGE_EXEC) << 4);
tlb->size = 1 << 31; /* up to 0x80000000 */
tlb->size = 1U << 31; /* up to 0x80000000 */
tlb->EPN = va & TARGET_PAGE_MASK;
tlb->RPN = pa & TARGET_PAGE_MASK;
tlb->PID = 0;

tlb = &env->tlb.tlbe[1];
tlb->attr = 0;
tlb->prot = PAGE_VALID | ((PAGE_READ | PAGE_WRITE | PAGE_EXEC) << 4);
tlb->size = 1 << 31; /* up to 0xffffffff */
tlb->size = 1U << 31; /* up to 0xffffffff */
tlb->EPN = 0x80000000 & TARGET_PAGE_MASK;
tlb->RPN = 0x80000000 & TARGET_PAGE_MASK;
tlb->PID = 0;
Expand Down
2 changes: 1 addition & 1 deletion hw/ppc/ppc4xx_devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void ppcuic_set_irq (void *opaque, int irq_num, int level)
uint32_t mask, sr;

uic = opaque;
mask = 1 << (31-irq_num);
mask = 1U << (31-irq_num);
LOG_UIC("%s: irq %d level %d uicsr %08" PRIx32
" mask %08" PRIx32 " => %08" PRIx32 " %08" PRIx32 "\n",
__func__, irq_num, level,
Expand Down
24 changes: 12 additions & 12 deletions hw/ppc/ppc_booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
/* Timer Control Register */

#define TCR_WP_SHIFT 30 /* Watchdog Timer Period */
#define TCR_WP_MASK (0x3 << TCR_WP_SHIFT)
#define TCR_WP_MASK (0x3U << TCR_WP_SHIFT)
#define TCR_WRC_SHIFT 28 /* Watchdog Timer Reset Control */
#define TCR_WRC_MASK (0x3 << TCR_WRC_SHIFT)
#define TCR_WIE (1 << 27) /* Watchdog Timer Interrupt Enable */
#define TCR_DIE (1 << 26) /* Decrementer Interrupt Enable */
#define TCR_WRC_MASK (0x3U << TCR_WRC_SHIFT)
#define TCR_WIE (1U << 27) /* Watchdog Timer Interrupt Enable */
#define TCR_DIE (1U << 26) /* Decrementer Interrupt Enable */
#define TCR_FP_SHIFT 24 /* Fixed-Interval Timer Period */
#define TCR_FP_MASK (0x3 << TCR_FP_SHIFT)
#define TCR_FIE (1 << 23) /* Fixed-Interval Timer Interrupt Enable */
#define TCR_ARE (1 << 22) /* Auto-Reload Enable */
#define TCR_FP_MASK (0x3U << TCR_FP_SHIFT)
#define TCR_FIE (1U << 23) /* Fixed-Interval Timer Interrupt Enable */
#define TCR_ARE (1U << 22) /* Auto-Reload Enable */

/* Timer Control Register (e500 specific fields) */

Expand All @@ -53,12 +53,12 @@

/* Timer Status Register */

#define TSR_FIS (1 << 26) /* Fixed-Interval Timer Interrupt Status */
#define TSR_DIS (1 << 27) /* Decrementer Interrupt Status */
#define TSR_FIS (1U << 26) /* Fixed-Interval Timer Interrupt Status */
#define TSR_DIS (1U << 27) /* Decrementer Interrupt Status */
#define TSR_WRS_SHIFT 28 /* Watchdog Timer Reset Status */
#define TSR_WRS_MASK (0x3 << TSR_WRS_SHIFT)
#define TSR_WIS (1 << 30) /* Watchdog Timer Interrupt Status */
#define TSR_ENW (1 << 31) /* Enable Next Watchdog Timer */
#define TSR_WRS_MASK (0x3U << TSR_WRS_SHIFT)
#define TSR_WIS (1U << 30) /* Watchdog Timer Interrupt Status */
#define TSR_ENW (1U << 31) /* Enable Next Watchdog Timer */

typedef struct booke_timer_t booke_timer_t;
struct booke_timer_t {
Expand Down
4 changes: 2 additions & 2 deletions hw/ppc/virtex_ml507.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env,

tlb->attr = 0;
tlb->prot = PAGE_VALID | ((PAGE_READ | PAGE_WRITE | PAGE_EXEC) << 4);
tlb->size = 1 << 31; /* up to 0x80000000 */
tlb->size = 1U << 31; /* up to 0x80000000 */
tlb->EPN = va & TARGET_PAGE_MASK;
tlb->RPN = pa & TARGET_PAGE_MASK;
tlb->PID = 0;

tlb = &env->tlb.tlbe[1];
tlb->attr = 0;
tlb->prot = PAGE_VALID | ((PAGE_READ | PAGE_WRITE | PAGE_EXEC) << 4);
tlb->size = 1 << 31; /* up to 0xffffffff */
tlb->size = 1U << 31; /* up to 0xffffffff */
tlb->EPN = 0x80000000 & TARGET_PAGE_MASK;
tlb->RPN = 0x80000000 & TARGET_PAGE_MASK;
tlb->PID = 0;
Expand Down
1 change: 0 additions & 1 deletion hw/timer/grlib_gptimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ static void grlib_gptimer_reset(DeviceState *d)

unit->scaler = 0;
unit->reload = 0;
unit->config = 0;

unit->config = unit->nr_timers;
unit->config |= unit->irq_line << 3;
Expand Down
32 changes: 16 additions & 16 deletions hw/usb/hcd-ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ struct ohci_iso_td {
#define OHCI_STATUS_OCR (1<<3)
#define OHCI_STATUS_SOC ((1<<6)|(1<<7))

#define OHCI_INTR_SO (1<<0) /* Scheduling overrun */
#define OHCI_INTR_WD (1<<1) /* HcDoneHead writeback */
#define OHCI_INTR_SF (1<<2) /* Start of frame */
#define OHCI_INTR_RD (1<<3) /* Resume detect */
#define OHCI_INTR_UE (1<<4) /* Unrecoverable error */
#define OHCI_INTR_FNO (1<<5) /* Frame number overflow */
#define OHCI_INTR_RHSC (1<<6) /* Root hub status change */
#define OHCI_INTR_OC (1<<30) /* Ownership change */
#define OHCI_INTR_MIE (1<<31) /* Master Interrupt Enable */
#define OHCI_INTR_SO (1U<<0) /* Scheduling overrun */
#define OHCI_INTR_WD (1U<<1) /* HcDoneHead writeback */
#define OHCI_INTR_SF (1U<<2) /* Start of frame */
#define OHCI_INTR_RD (1U<<3) /* Resume detect */
#define OHCI_INTR_UE (1U<<4) /* Unrecoverable error */
#define OHCI_INTR_FNO (1U<<5) /* Frame number overflow */
#define OHCI_INTR_RHSC (1U<<6) /* Root hub status change */
#define OHCI_INTR_OC (1U<<30) /* Ownership change */
#define OHCI_INTR_MIE (1U<<31) /* Master Interrupt Enable */

#define OHCI_HCCA_SIZE 0x100
#define OHCI_HCCA_MASK 0xffffff00
Expand All @@ -253,7 +253,7 @@ struct ohci_iso_td {
#define OHCI_FMI_FSMPS 0xffff0000
#define OHCI_FMI_FIT 0x80000000

#define OHCI_FR_RT (1<<31)
#define OHCI_FR_RT (1U<<31)

#define OHCI_LS_THRESH 0x628

Expand All @@ -265,12 +265,12 @@ struct ohci_iso_td {
#define OHCI_RHA_NOCP (1<<12)
#define OHCI_RHA_POTPGT_MASK 0xff000000

#define OHCI_RHS_LPS (1<<0)
#define OHCI_RHS_OCI (1<<1)
#define OHCI_RHS_DRWE (1<<15)
#define OHCI_RHS_LPSC (1<<16)
#define OHCI_RHS_OCIC (1<<17)
#define OHCI_RHS_CRWE (1<<31)
#define OHCI_RHS_LPS (1U<<0)
#define OHCI_RHS_OCI (1U<<1)
#define OHCI_RHS_DRWE (1U<<15)
#define OHCI_RHS_LPSC (1U<<16)
#define OHCI_RHS_OCIC (1U<<17)
#define OHCI_RHS_CRWE (1U<<31)

#define OHCI_PORT_CCS (1<<0)
#define OHCI_PORT_PES (1<<1)
Expand Down
2 changes: 1 addition & 1 deletion kvm-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section)

d.slot = mem->slot;

if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) < 0) {
DPRINTF("ioctl failed %d\n", errno);
ret = -1;
break;
Expand Down
2 changes: 0 additions & 2 deletions linux-user/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4043,8 +4043,6 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
struct target_rt_sigframe *frame;
abi_ulong info_addr, uc_addr;

frame_addr = get_sigframe(ka, env, sizeof *frame);

frame_addr = get_sigframe(ka, env, sizeof(*frame));
if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) {
goto give_sigsegv;
Expand Down
11 changes: 6 additions & 5 deletions qemu-doc.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ The following options are specific to the PowerPC emulation:

@item -g @var{W}x@var{H}[x@var{DEPTH}]

Set the initial VGA graphic mode. The default is 800x600x15.
Set the initial VGA graphic mode. The default is 800x600x32.

@item -prom-env @var{string}

Expand Down Expand Up @@ -1996,7 +1996,7 @@ QEMU emulates the following sun4m peripherals:
@item
IOMMU
@item
TCX Frame buffer
TCX or cgthree Frame buffer
@item
Lance (Am7990) Ethernet
@item
Expand All @@ -2023,7 +2023,7 @@ firmware implementation. The goal is to implement a 100% IEEE

A sample Linux 2.6 series kernel and ram disk image are available on
the QEMU web site. There are still issues with NetBSD and OpenBSD, but
some kernel versions work. Please note that currently Solaris kernels
some kernel versions work. Please note that currently older Solaris kernels
don't work probably due to interface issues between OpenBIOS and
Solaris.

Expand All @@ -2035,8 +2035,9 @@ The following options are specific to the Sparc32 emulation:

@item -g @var{W}x@var{H}x[x@var{DEPTH}]

Set the initial TCX graphic mode. The default is 1024x768x8, currently
the only other possible mode is 1024x768x24.
Set the initial graphics mode. For TCX, the default is 1024x768x8 with the
option of 1024x768x24. For cgthree, the default is 1024x768x8 with the option
of 1152x900x8 for people who wish to use OBP.

@item -prom-env @var{string}

Expand Down
10 changes: 9 additions & 1 deletion qemu-options.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ Rotate graphical output some deg left (only PXA LCD).
ETEXI

DEF("vga", HAS_ARG, QEMU_OPTION_vga,
"-vga [std|cirrus|vmware|qxl|xenfb|none]\n"
"-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|none]\n"
" select video card type\n", QEMU_ARCH_ALL)
STEXI
@item -vga @var{type}
Expand All @@ -1068,6 +1068,14 @@ card.
QXL paravirtual graphic card. It is VGA compatible (including VESA
2.0 VBE support). Works best with qxl guest drivers installed though.
Recommended choice when using the spice protocol.
@item tcx
(sun4m only) Sun TCX framebuffer. This is the default framebuffer for
sun4m machines and offers both 8-bit and 24-bit colour depths at a
fixed resolution of 1024x768.
@item cg3
(sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
resolutions aimed at people wishing to run older Solaris versions.
@item none
Disable VGA card.
@end table
Expand Down
2 changes: 1 addition & 1 deletion target-arm/machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static bool m_needed(void *opaque)
return arm_feature(env, ARM_FEATURE_M);
}

const VMStateDescription vmstate_m = {
static const VMStateDescription vmstate_m = {
.name = "cpu/m",
.version_id = 1,
.minimum_version_id = 1,
Expand Down
2 changes: 1 addition & 1 deletion target-i386/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ typedef struct X86RegisterInfo32 {

#define REGISTER(reg) \
[R_##reg] = { .name = #reg, .qapi_enum = X86_CPU_REGISTER32_##reg }
X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = {
static const X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = {
REGISTER(EAX),
REGISTER(ECX),
REGISTER(EDX),
Expand Down
Loading

0 comments on commit c6c09ba

Please sign in to comment.