Merge remote-tracking branch 'mjt/trivial-patches' into staging
# By Stefan Weil (9) and others # Via Michael Tokarev * mjt/trivial-patches: eeprom93xx: fix coding style hw/ppc/mac.h: remove unused BIOS_FILENAME definition Don't crash on keyboard input with no handler libcacard/vcard_emul_nss: Remove unused statement (value stored is never read) libcacard/cac: Remove unused statement (value stored is never read) virtio-net: fix the indent misc: Replace 'struct QEMUTimer' by 'QEMUTimer' qobject: Fix compiler warning (missing gnu_printf format attribute) acpi-build: Fix compiler warning (missing gnu_printf format attribute) .gitignore: Ignore config.status gtk: Replace conditional debug messages by trace methods console: Replace conditional debug messages by trace methods trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies) trace: Remove trace.h from console.h (less dependencies) Message-id: 1385408466-13183-1-git-send-email-mjt@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@amazon.com>
This commit is contained in:
commit
783eb67e7a
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ config-all-devices.*
|
||||
config-all-disas.*
|
||||
config-host.*
|
||||
config-target.*
|
||||
config.status
|
||||
trace/generated-tracers.h
|
||||
trace/generated-tracers.c
|
||||
trace/generated-tracers-dtrace.h
|
||||
|
@ -120,8 +120,8 @@ typedef struct {
|
||||
uint64_t char_tx_time;
|
||||
CharDriverState *chr;
|
||||
qemu_irq irq;
|
||||
struct QEMUTimer *fifo_trigger_handle;
|
||||
struct QEMUTimer *tx_time_handle;
|
||||
QEMUTimer *fifo_trigger_handle;
|
||||
QEMUTimer *tx_time_handle;
|
||||
} UartState;
|
||||
|
||||
static void uart_update_status(UartState *s)
|
||||
|
@ -23,6 +23,7 @@
|
||||
*/
|
||||
#include "hw/hw.h"
|
||||
#include "hw/loader.h"
|
||||
#include "trace.h"
|
||||
#include "ui/console.h"
|
||||
#include "hw/pci/pci.h"
|
||||
|
||||
|
@ -285,7 +285,8 @@ static inline void build_append_array(GArray *array, GArray *val)
|
||||
g_array_append_vals(array, val->data, val->len);
|
||||
}
|
||||
|
||||
static void build_append_nameseg(GArray *array, const char *format, ...)
|
||||
static void GCC_FMT_ATTR(2, 3)
|
||||
build_append_nameseg(GArray *array, const char *format, ...)
|
||||
{
|
||||
/* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
|
||||
char s[] = "XXXX";
|
||||
@ -630,7 +631,7 @@ build_append_notify(GArray *device, const char *name,
|
||||
GArray *method = build_alloc_array();
|
||||
uint8_t op = 0x14; /* MethodOp */
|
||||
|
||||
build_append_nameseg(method, name);
|
||||
build_append_nameseg(method, "%s", name);
|
||||
build_append_byte(method, 0x02); /* MethodFlags: ArgCount */
|
||||
for (i = skip; i < count; i++) {
|
||||
GArray *target = build_alloc_array();
|
||||
|
@ -1428,7 +1428,7 @@ static NetClientInfo net_virtio_info = {
|
||||
.size = sizeof(NICState),
|
||||
.can_receive = virtio_net_can_receive,
|
||||
.receive = virtio_net_receive,
|
||||
.cleanup = virtio_net_cleanup,
|
||||
.cleanup = virtio_net_cleanup,
|
||||
.link_status_changed = virtio_net_set_link_status,
|
||||
.query_rx_filter = virtio_net_query_rxfilter,
|
||||
};
|
||||
|
@ -126,7 +126,7 @@ static const VMStateDescription vmstate_eeprom = {
|
||||
.version_id = EEPROM_VERSION,
|
||||
.minimum_version_id = OLD_EEPROM_VERSION,
|
||||
.minimum_version_id_old = OLD_EEPROM_VERSION,
|
||||
.fields = (VMStateField []) {
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT8(tick, eeprom_t),
|
||||
VMSTATE_UINT8(address, eeprom_t),
|
||||
VMSTATE_UINT8(command, eeprom_t),
|
||||
@ -157,13 +157,13 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
|
||||
logout("CS=%u SK=%u DI=%u DO=%u, tick = %u\n",
|
||||
eecs, eesk, eedi, eedo, tick);
|
||||
|
||||
if (! eeprom->eecs && eecs) {
|
||||
if (!eeprom->eecs && eecs) {
|
||||
/* Start chip select cycle. */
|
||||
logout("Cycle start, waiting for 1st start bit (0)\n");
|
||||
tick = 0;
|
||||
command = 0x0;
|
||||
address = 0x0;
|
||||
} else if (eeprom->eecs && ! eecs) {
|
||||
} else if (eeprom->eecs && !eecs) {
|
||||
/* End chip select cycle. This triggers write / erase. */
|
||||
if (eeprom->writable) {
|
||||
uint8_t subcommand = address >> (eeprom->addrbits - 2);
|
||||
@ -189,7 +189,7 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
|
||||
}
|
||||
/* Output DO is tristate, read results in 1. */
|
||||
eedo = 1;
|
||||
} else if (eecs && ! eeprom->eesk && eesk) {
|
||||
} else if (eecs && !eeprom->eesk && eesk) {
|
||||
/* Raising edge of clock shifts data in. */
|
||||
if (tick == 0) {
|
||||
/* Wait for 1st start bit. */
|
||||
@ -230,20 +230,20 @@ void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi)
|
||||
if (command == 0) {
|
||||
/* Command code in upper 2 bits of address. */
|
||||
switch (address >> (eeprom->addrbits - 2)) {
|
||||
case 0:
|
||||
logout("write disable command\n");
|
||||
eeprom->writable = 0;
|
||||
break;
|
||||
case 1:
|
||||
logout("write all command\n");
|
||||
break;
|
||||
case 2:
|
||||
logout("erase all command\n");
|
||||
break;
|
||||
case 3:
|
||||
logout("write enable command\n");
|
||||
eeprom->writable = 1;
|
||||
break;
|
||||
case 0:
|
||||
logout("write disable command\n");
|
||||
eeprom->writable = 0;
|
||||
break;
|
||||
case 1:
|
||||
logout("write all command\n");
|
||||
break;
|
||||
case 2:
|
||||
logout("erase all command\n");
|
||||
break;
|
||||
case 3:
|
||||
logout("write enable command\n");
|
||||
eeprom->writable = 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* Read, write or erase word. */
|
||||
@ -276,7 +276,7 @@ uint16_t eeprom93xx_read(eeprom_t *eeprom)
|
||||
{
|
||||
/* Return status of pin DO (0 or 1). */
|
||||
logout("CS=%u DO=%u\n", eeprom->eecs, eeprom->eedo);
|
||||
return (eeprom->eedo);
|
||||
return eeprom->eedo;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -296,18 +296,18 @@ eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
|
||||
uint8_t addrbits;
|
||||
|
||||
switch (nwords) {
|
||||
case 16:
|
||||
case 64:
|
||||
addrbits = 6;
|
||||
break;
|
||||
case 128:
|
||||
case 256:
|
||||
addrbits = 8;
|
||||
break;
|
||||
default:
|
||||
assert(!"Unsupported EEPROM size, fallback to 64 words!");
|
||||
nwords = 64;
|
||||
addrbits = 6;
|
||||
case 16:
|
||||
case 64:
|
||||
addrbits = 6;
|
||||
break;
|
||||
case 128:
|
||||
case 256:
|
||||
addrbits = 8;
|
||||
break;
|
||||
default:
|
||||
assert(!"Unsupported EEPROM size, fallback to 64 words!");
|
||||
nwords = 64;
|
||||
addrbits = 6;
|
||||
}
|
||||
|
||||
eeprom = (eeprom_t *)g_malloc0(sizeof(*eeprom) + nwords * 2);
|
||||
|
@ -34,7 +34,6 @@
|
||||
#define MAX_CPUS 1
|
||||
|
||||
#define BIOS_SIZE (1024 * 1024)
|
||||
#define BIOS_FILENAME "ppc_rom.bin"
|
||||
#define NVRAM_SIZE 0x2000
|
||||
#define PROM_FILENAME "openbios-ppc"
|
||||
#define PROM_ADDR 0xfff00000
|
||||
|
@ -684,7 +684,7 @@ static inline void cpu_ppc_hdecr_excp(PowerPCCPU *cpu)
|
||||
}
|
||||
|
||||
static void __cpu_ppc_store_decr(PowerPCCPU *cpu, uint64_t *nextp,
|
||||
struct QEMUTimer *timer,
|
||||
QEMUTimer *timer,
|
||||
void (*raise_excp)(PowerPCCPU *),
|
||||
uint32_t decr, uint32_t value,
|
||||
int is_excp)
|
||||
@ -856,9 +856,9 @@ typedef struct ppc40x_timer_t ppc40x_timer_t;
|
||||
struct ppc40x_timer_t {
|
||||
uint64_t pit_reload; /* PIT auto-reload value */
|
||||
uint64_t fit_next; /* Tick for next FIT interrupt */
|
||||
struct QEMUTimer *fit_timer;
|
||||
QEMUTimer *fit_timer;
|
||||
uint64_t wdt_next; /* Tick for next WDT interrupt */
|
||||
struct QEMUTimer *wdt_timer;
|
||||
QEMUTimer *wdt_timer;
|
||||
|
||||
/* 405 have the PIT, 440 have a DECR. */
|
||||
unsigned int decr_excp;
|
||||
|
@ -1234,7 +1234,7 @@ struct ppc4xx_gpt_t {
|
||||
MemoryRegion iomem;
|
||||
int64_t tb_offset;
|
||||
uint32_t tb_freq;
|
||||
struct QEMUTimer *timer;
|
||||
QEMUTimer *timer;
|
||||
qemu_irq irqs[5];
|
||||
uint32_t oe;
|
||||
uint32_t ol;
|
||||
|
@ -64,10 +64,10 @@ typedef struct booke_timer_t booke_timer_t;
|
||||
struct booke_timer_t {
|
||||
|
||||
uint64_t fit_next;
|
||||
struct QEMUTimer *fit_timer;
|
||||
QEMUTimer *fit_timer;
|
||||
|
||||
uint64_t wdt_next;
|
||||
struct QEMUTimer *wdt_timer;
|
||||
QEMUTimer *wdt_timer;
|
||||
|
||||
uint32_t flags;
|
||||
};
|
||||
|
@ -61,8 +61,8 @@ struct M48t59State {
|
||||
time_t stop_time;
|
||||
/* Alarm & watchdog */
|
||||
struct tm alarm;
|
||||
struct QEMUTimer *alrm_timer;
|
||||
struct QEMUTimer *wd_timer;
|
||||
QEMUTimer *alrm_timer;
|
||||
QEMUTimer *wd_timer;
|
||||
/* NVRAM storage */
|
||||
uint8_t *buffer;
|
||||
/* Model parameters */
|
||||
|
@ -28,6 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "hw/usb/hcd-ehci.h"
|
||||
#include "trace.h"
|
||||
|
||||
/* Capability Registers Base Address - section 2.2 */
|
||||
#define CAPLENGTH 0x0000 /* 1-byte, 0x0001 reserved */
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "qemu/timer.h"
|
||||
#include "hw/usb.h"
|
||||
#include "monitor/monitor.h"
|
||||
#include "trace.h"
|
||||
#include "sysemu/dma.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "hw/pci/pci.h"
|
||||
|
@ -65,13 +65,13 @@ struct SerialState {
|
||||
/* Interrupt trigger level for recv_fifo */
|
||||
uint8_t recv_fifo_itl;
|
||||
|
||||
struct QEMUTimer *fifo_timeout_timer;
|
||||
QEMUTimer *fifo_timeout_timer;
|
||||
int timeout_ipending; /* timeout interrupt pending state */
|
||||
|
||||
uint64_t char_transmit_time; /* time to transmit a char in ticks */
|
||||
int poll_msl;
|
||||
|
||||
struct QEMUTimer *modem_status_poll;
|
||||
QEMUTimer *modem_status_poll;
|
||||
MemoryRegion io;
|
||||
};
|
||||
|
||||
|
@ -24,10 +24,10 @@ struct ppc_tb_t {
|
||||
/* Decrementer management */
|
||||
uint64_t decr_next; /* Tick for next decr interrupt */
|
||||
uint32_t decr_freq; /* decrementer frequency */
|
||||
struct QEMUTimer *decr_timer;
|
||||
QEMUTimer *decr_timer;
|
||||
/* Hypervisor decrementer management */
|
||||
uint64_t hdecr_next; /* Tick for next hdecr interrupt */
|
||||
struct QEMUTimer *hdecr_timer;
|
||||
QEMUTimer *hdecr_timer;
|
||||
uint64_t purr_load;
|
||||
uint64_t purr_start;
|
||||
void *opaque;
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "qapi/qmp/qdict.h"
|
||||
#include "qemu/notify.h"
|
||||
#include "monitor/monitor.h"
|
||||
#include "trace.h"
|
||||
#include "qapi-types.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
|
@ -189,7 +189,6 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
|
||||
pki_applet->sign_buffer = sign_buffer;
|
||||
pki_applet->sign_buffer_len = size;
|
||||
*response = vcard_make_response(VCARD7816_STATUS_SUCCESS);
|
||||
ret = VCARD_DONE;
|
||||
break;
|
||||
case 0x00:
|
||||
/* we now have the whole buffer, do the operation, result will be
|
||||
|
@ -934,7 +934,6 @@ vcard_emul_init(const VCardEmulOptions *options)
|
||||
vreader = vreader_new(options->vreader[i].vname, vreader_emul,
|
||||
vreader_emul_delete);
|
||||
vreader_add_reader(vreader);
|
||||
cert_count = options->vreader[i].cert_count;
|
||||
|
||||
vcard_emul_alloc_arrays(&certs, &cert_len, &keys,
|
||||
options->vreader[i].cert_count);
|
||||
|
@ -42,8 +42,8 @@ static QError *qerror_new(void)
|
||||
*
|
||||
* Return strong reference.
|
||||
*/
|
||||
static QError *qerror_from_info(ErrorClass err_class, const char *fmt,
|
||||
va_list *va)
|
||||
static QError * GCC_FMT_ATTR(2, 0)
|
||||
qerror_from_info(ErrorClass err_class, const char *fmt, va_list *va)
|
||||
{
|
||||
QError *qerr;
|
||||
|
||||
|
@ -62,7 +62,7 @@ typedef struct AlphaCPU {
|
||||
CPUAlphaState env;
|
||||
|
||||
/* This alarm doesn't exist in real hardware; we wish it did. */
|
||||
struct QEMUTimer *alarm_timer;
|
||||
QEMUTimer *alarm_timer;
|
||||
} AlphaCPU;
|
||||
|
||||
static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env)
|
||||
|
@ -476,7 +476,7 @@ struct CPUMIPSState {
|
||||
|
||||
const mips_def_t *cpu_model;
|
||||
void *irq[8];
|
||||
struct QEMUTimer *timer; /* Internal timer */
|
||||
QEMUTimer *timer; /* Internal timer */
|
||||
};
|
||||
|
||||
#include "cpu-qom.h"
|
||||
|
@ -307,7 +307,7 @@ typedef struct CPUOpenRISCState {
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
CPUOpenRISCTLBContext * tlb;
|
||||
|
||||
struct QEMUTimer *timer;
|
||||
QEMUTimer *timer;
|
||||
uint32_t ttmr; /* Timer tick mode register */
|
||||
uint32_t ttcr; /* Timer tick count register */
|
||||
|
||||
|
@ -370,7 +370,7 @@ struct CPUTimer
|
||||
uint32_t disabled;
|
||||
uint64_t disabled_mask;
|
||||
int64_t clock_offset;
|
||||
struct QEMUTimer *qtimer;
|
||||
QEMUTimer *qtimer;
|
||||
};
|
||||
|
||||
typedef struct CPUTimer CPUTimer;
|
||||
|
@ -1010,6 +1010,8 @@ dma_map_wait(void *dbs) "dbs=%p"
|
||||
|
||||
# ui/console.c
|
||||
console_gfx_new(void) ""
|
||||
console_putchar_csi(int esc_param0, int esc_param1, int ch, int nb_esc_params) "escape sequence CSI%d;%d%c, %d parameters"
|
||||
console_putchar_unhandled(int ch) "unhandled escape character '%c'"
|
||||
console_txt_new(int w, int h) "%dx%d"
|
||||
console_select(int nr) "%d"
|
||||
console_refresh(int interval) "interval %d ms"
|
||||
@ -1020,6 +1022,11 @@ displaychangelistener_register(void *dcl, const char *name) "%p [ %s ]"
|
||||
displaychangelistener_unregister(void *dcl, const char *name) "%p [ %s ]"
|
||||
ppm_save(const char *filename, void *display_surface) "%s surface=%p"
|
||||
|
||||
# ui/gtk.c
|
||||
gd_switch(int width, int height) "width=%d, height=%d"
|
||||
gd_update(int x, int y, int w, int h) "x=%d, y=%d, w=%d, h=%d"
|
||||
gd_key_event(int gdk_keycode, int qemu_keycode, const char *action) "translated GDK keycode %d to QEMU keycode %d (%s)"
|
||||
|
||||
# hw/display/vmware_vga.c
|
||||
vmware_value_read(uint32_t index, uint32_t value) "index %d, value 0x%x"
|
||||
vmware_value_write(uint32_t index, uint32_t value) "index %d, value 0x%x"
|
||||
|
14
ui/console.c
14
ui/console.c
@ -27,8 +27,8 @@
|
||||
#include "qemu/timer.h"
|
||||
#include "qmp-commands.h"
|
||||
#include "sysemu/char.h"
|
||||
#include "trace.h"
|
||||
|
||||
//#define DEBUG_CONSOLE
|
||||
#define DEFAULT_BACKSCROLL 512
|
||||
#define MAX_CONSOLES 12
|
||||
#define CONSOLE_CURSOR_PERIOD 500
|
||||
@ -161,7 +161,7 @@ struct QemuConsole {
|
||||
};
|
||||
|
||||
struct DisplayState {
|
||||
struct QEMUTimer *gui_timer;
|
||||
QEMUTimer *gui_timer;
|
||||
uint64_t last_update;
|
||||
uint64_t update_interval;
|
||||
bool refreshing;
|
||||
@ -866,10 +866,8 @@ static void console_putchar(QemuConsole *s, int ch)
|
||||
s->nb_esc_params++;
|
||||
if (ch == ';')
|
||||
break;
|
||||
#ifdef DEBUG_CONSOLE
|
||||
fprintf(stderr, "escape sequence CSI%d;%d%c, %d parameters\n",
|
||||
s->esc_params[0], s->esc_params[1], ch, s->nb_esc_params);
|
||||
#endif
|
||||
trace_console_putchar_csi(s->esc_params[0], s->esc_params[1],
|
||||
ch, s->nb_esc_params);
|
||||
s->state = TTY_STATE_NORM;
|
||||
switch(ch) {
|
||||
case 'A':
|
||||
@ -983,9 +981,7 @@ static void console_putchar(QemuConsole *s, int ch)
|
||||
s->y = s->y_saved;
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_CONSOLE
|
||||
fprintf(stderr, "unhandled escape character '%c'\n", ch);
|
||||
#endif
|
||||
trace_console_putchar_unhandled(ch);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
19
ui/gtk.c
19
ui/gtk.c
@ -53,6 +53,7 @@
|
||||
#include <vte/vte.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "trace.h"
|
||||
#include "ui/console.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "qmp-commands.h"
|
||||
@ -60,14 +61,6 @@
|
||||
#include "keymaps.h"
|
||||
#include "sysemu/char.h"
|
||||
|
||||
//#define DEBUG_GTK
|
||||
|
||||
#ifdef DEBUG_GTK
|
||||
#define DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DPRINTF(fmt, ...) do { } while (0)
|
||||
#endif
|
||||
|
||||
#define MAX_VCS 10
|
||||
|
||||
|
||||
@ -302,7 +295,7 @@ static void gd_update(DisplayChangeListener *dcl,
|
||||
int fbw, fbh;
|
||||
int ww, wh;
|
||||
|
||||
DPRINTF("update(x=%d, y=%d, w=%d, h=%d)\n", x, y, w, h);
|
||||
trace_gd_update(x, y, w, h);
|
||||
|
||||
if (s->convert) {
|
||||
pixman_image_composite(PIXMAN_OP_SRC, s->ds->image, NULL, s->convert,
|
||||
@ -396,8 +389,7 @@ static void gd_switch(DisplayChangeListener *dcl,
|
||||
GtkDisplayState *s = container_of(dcl, GtkDisplayState, dcl);
|
||||
bool resized = true;
|
||||
|
||||
DPRINTF("resize(width=%d, height=%d)\n",
|
||||
surface_width(surface), surface_height(surface));
|
||||
trace_gd_switch(surface_width(surface), surface_height(surface));
|
||||
|
||||
if (s->surface) {
|
||||
cairo_surface_destroy(s->surface);
|
||||
@ -732,9 +724,8 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
|
||||
qemu_keycode = 0;
|
||||
}
|
||||
|
||||
DPRINTF("translated GDK keycode %d to QEMU keycode %d (%s)\n",
|
||||
gdk_keycode, qemu_keycode,
|
||||
(key->type == GDK_KEY_PRESS) ? "down" : "up");
|
||||
trace_gd_key_event(gdk_keycode, qemu_keycode,
|
||||
(key->type == GDK_KEY_PRESS) ? "down" : "up");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(modifier_keycode); i++) {
|
||||
if (qemu_keycode == modifier_keycode[i]) {
|
||||
|
@ -414,7 +414,7 @@ void kbd_put_keycode(int keycode)
|
||||
if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
|
||||
return;
|
||||
}
|
||||
if (entry) {
|
||||
if (entry && entry->put_kbd) {
|
||||
entry->put_kbd(entry->opaque, keycode);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user