mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
chardev: Use QEMUChrEvent enum in IOEventHandler typedef
The Chardev events are listed in the QEMUChrEvent enum.
By using the enum in the IOEventHandler typedef we:
- make the IOEventHandler type more explicit (this handler
process out-of-band information, while the IOReadHandler
is in-band),
- help static code analyzers.
This patch was produced with the following spatch script:
@match@
expression backend, opaque, context, set_open;
identifier fd_can_read, fd_read, fd_event, be_change;
@@
qemu_chr_fe_set_handlers(backend, fd_can_read, fd_read, fd_event,
be_change, opaque, context, set_open);
@depends on match@
identifier opaque, event;
identifier match.fd_event;
@@
static
-void fd_event(void *opaque, int event)
+void fd_event(void *opaque, QEMUChrEvent event)
{
...
}
Then the typedef was modified manually in
include/chardev/char-fe.h.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20191218172009.8868-15-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
2fa9044a4f
commit
083b266f69
@@ -152,7 +152,7 @@ cryptodev_vhost_claim_chardev(CryptoDevBackendVhostUser *s,
|
||||
return chr;
|
||||
}
|
||||
|
||||
static void cryptodev_vhost_user_event(void *opaque, int event)
|
||||
static void cryptodev_vhost_user_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
CryptoDevBackendVhostUser *s = opaque;
|
||||
CryptoDevBackend *b = CRYPTODEV_BACKEND(s);
|
||||
|
||||
+1
-1
@@ -247,7 +247,7 @@ void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event)
|
||||
}
|
||||
}
|
||||
|
||||
static void mux_chr_event(void *opaque, int event)
|
||||
static void mux_chr_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
mux_chr_send_all_event(CHARDEV(opaque), event);
|
||||
}
|
||||
|
||||
@@ -3171,7 +3171,7 @@ static void gdb_chr_receive(void *opaque, const uint8_t *buf, int size)
|
||||
}
|
||||
}
|
||||
|
||||
static void gdb_chr_event(void *opaque, int event)
|
||||
static void gdb_chr_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
int i;
|
||||
GDBState *s = (GDBState *) opaque;
|
||||
|
||||
+1
-1
@@ -1955,7 +1955,7 @@ static void pxa2xx_fir_rx(void *opaque, const uint8_t *buf, int size)
|
||||
pxa2xx_fir_update(s);
|
||||
}
|
||||
|
||||
static void pxa2xx_fir_event(void *opaque, int event)
|
||||
static void pxa2xx_fir_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1093,7 +1093,7 @@ static void strongarm_uart_receive(void *opaque, const uint8_t *buf, int size)
|
||||
strongarm_uart_update_int_status(s);
|
||||
}
|
||||
|
||||
static void strongarm_uart_event(void *opaque, int event)
|
||||
static void strongarm_uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
StrongARMUARTState *s = opaque;
|
||||
if (event == CHR_EVENT_BREAK) {
|
||||
|
||||
@@ -361,7 +361,7 @@ static gboolean vhost_user_blk_watch(GIOChannel *chan, GIOCondition cond,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void vhost_user_blk_event(void *opaque, int event)
|
||||
static void vhost_user_blk_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
DeviceState *dev = opaque;
|
||||
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
||||
|
||||
@@ -348,7 +348,7 @@ static void uart_receive(void *opaque, const uint8_t *buf, int size)
|
||||
}
|
||||
}
|
||||
|
||||
static void uart_event(void *opaque, int event)
|
||||
static void uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
CadenceUARTState *s = opaque;
|
||||
uint8_t buf = '\0';
|
||||
|
||||
@@ -131,7 +131,7 @@ static void uart_rx(void *opaque, const uint8_t *buf, int size)
|
||||
s->reg_rx = *buf;
|
||||
}
|
||||
|
||||
static void uart_event(void *opaque, int event)
|
||||
static void uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -634,7 +634,7 @@ static void serial_receive1(void *opaque, const uint8_t *buf, int size)
|
||||
serial_receive_byte(s, buf[0]);
|
||||
}
|
||||
|
||||
static void serial_event(void *opaque, int event)
|
||||
static void serial_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
ESCCChannelState *s = opaque;
|
||||
if (event == CHR_EVENT_BREAK)
|
||||
|
||||
@@ -202,7 +202,7 @@ static int serial_can_receive(void *opaque)
|
||||
return sizeof(s->rx_fifo) - s->rx_fifo_len;
|
||||
}
|
||||
|
||||
static void serial_event(void *opaque, int event)
|
||||
static void serial_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ static void exynos4210_uart_receive(void *opaque, const uint8_t *buf, int size)
|
||||
}
|
||||
|
||||
|
||||
static void exynos4210_uart_event(void *opaque, int event)
|
||||
static void exynos4210_uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
Exynos4210UartState *s = (Exynos4210UartState *)opaque;
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ static void grlib_apbuart_receive(void *opaque, const uint8_t *buf, int size)
|
||||
}
|
||||
}
|
||||
|
||||
static void grlib_apbuart_event(void *opaque, int event)
|
||||
static void grlib_apbuart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
trace_grlib_apbuart_event(event);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ static void imx_receive(void *opaque, const uint8_t *buf, int size)
|
||||
imx_put_data(opaque, *buf);
|
||||
}
|
||||
|
||||
static void imx_event(void *opaque, int event)
|
||||
static void imx_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
if (event == CHR_EVENT_BREAK) {
|
||||
imx_put_data(opaque, URXD_BRK | URXD_FRMERR | URXD_ERR);
|
||||
|
||||
@@ -503,7 +503,7 @@ static void hostdev_receive(void *opaque, const uint8_t *buf, int size)
|
||||
}
|
||||
}
|
||||
|
||||
static void hostdev_event(void *opaque, int event)
|
||||
static void hostdev_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
SCC2698Channel *ch = opaque;
|
||||
switch (event) {
|
||||
|
||||
@@ -104,7 +104,7 @@ static int juart_can_rx(void *opaque)
|
||||
return !(s->jrx & JRX_FULL);
|
||||
}
|
||||
|
||||
static void juart_event(void *opaque, int event)
|
||||
static void juart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ static int uart_can_rx(void *opaque)
|
||||
return !(s->regs[R_LSR] & LSR_DR);
|
||||
}
|
||||
|
||||
static void uart_event(void *opaque, int event)
|
||||
static void uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -256,7 +256,7 @@ static void mcf_uart_push_byte(mcf_uart_state *s, uint8_t data)
|
||||
mcf_uart_update(s);
|
||||
}
|
||||
|
||||
static void mcf_uart_event(void *opaque, int event)
|
||||
static void mcf_uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
mcf_uart_state *s = (mcf_uart_state *)opaque;
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ static int uart_can_rx(void *opaque)
|
||||
return !(s->regs[R_STAT] & STAT_RX_EVT);
|
||||
}
|
||||
|
||||
static void uart_event(void *opaque, int event)
|
||||
static void uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ static int uart_can_receive(void *opaque)
|
||||
return s->rx_started ? (UART_FIFO_LENGTH - s->rx_fifo_len) : 0;
|
||||
}
|
||||
|
||||
static void uart_event(void *opaque, int event)
|
||||
static void uart_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
NRF51UARTState *s = NRF51_UART(opaque);
|
||||
|
||||
|
||||
+1
-1
@@ -280,7 +280,7 @@ static void pl011_receive(void *opaque, const uint8_t *buf, int size)
|
||||
pl011_put_fifo(opaque, *buf);
|
||||
}
|
||||
|
||||
static void pl011_event(void *opaque, int event)
|
||||
static void pl011_event(void *opaque, QEMUChrEvent event)
|
||||
{
|
||||
if (event == CHR_EVENT_BREAK)
|
||||
pl011_put_fifo(opaque, 0x400);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user