mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
bhyve: Remove the unused vcpu argument from all of the I/O port handlers.
Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37653
This commit is contained in:
parent
78c2cd83ec
commit
08b05de1e2
@ -307,7 +307,7 @@ atkbdc_dequeue_data(struct atkbdc_softc *sc, uint8_t *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
atkbdc_data_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
atkbdc_data_handler(struct vmctx *ctx __unused, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg)
|
int port __unused, int bytes, uint32_t *eax, void *arg)
|
||||||
{
|
{
|
||||||
struct atkbdc_softc *sc;
|
struct atkbdc_softc *sc;
|
||||||
@ -393,7 +393,7 @@ atkbdc_data_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
atkbdc_sts_ctl_handler(struct vmctx *ctx, int vcpu __unused, int in,
|
atkbdc_sts_ctl_handler(struct vmctx *ctx, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg)
|
int port __unused, int bytes, uint32_t *eax, void *arg)
|
||||||
{
|
{
|
||||||
struct atkbdc_softc *sc;
|
struct atkbdc_softc *sc;
|
||||||
|
@ -516,7 +516,7 @@ fwctl_outl(uint32_t val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
fwctl_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
fwctl_handler(struct vmctx *ctx __unused, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ static struct {
|
|||||||
} inout_handlers[MAX_IOPORTS];
|
} inout_handlers[MAX_IOPORTS];
|
||||||
|
|
||||||
static int
|
static int
|
||||||
default_inout(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
default_inout(struct vmctx *ctx __unused, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
if (in) {
|
if (in) {
|
||||||
@ -186,7 +186,7 @@ emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit)
|
|||||||
if (!in)
|
if (!in)
|
||||||
vm_copyin(iov, &val, bytes);
|
vm_copyin(iov, &val, bytes);
|
||||||
|
|
||||||
retval = handler(ctx, vcpu, in, port, bytes, &val, arg);
|
retval = handler(ctx, in, port, bytes, &val, arg);
|
||||||
if (retval != 0)
|
if (retval != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit)
|
|||||||
} else {
|
} else {
|
||||||
eax = vmexit->u.inout.eax;
|
eax = vmexit->u.inout.eax;
|
||||||
val = eax & vie_size2mask(bytes);
|
val = eax & vie_size2mask(bytes);
|
||||||
retval = handler(ctx, vcpu, in, port, bytes, &val, arg);
|
retval = handler(ctx, in, port, bytes, &val, arg);
|
||||||
if (retval == 0 && in) {
|
if (retval == 0 && in) {
|
||||||
eax &= ~vie_size2mask(bytes);
|
eax &= ~vie_size2mask(bytes);
|
||||||
eax |= val & vie_size2mask(bytes);
|
eax |= val & vie_size2mask(bytes);
|
||||||
|
@ -39,7 +39,7 @@ struct vm_exit;
|
|||||||
/*
|
/*
|
||||||
* inout emulation handlers return 0 on success and -1 on failure.
|
* inout emulation handlers return 0 on success and -1 on failure.
|
||||||
*/
|
*/
|
||||||
typedef int (*inout_func_t)(struct vmctx *ctx, int vcpu, int in, int port,
|
typedef int (*inout_func_t)(struct vmctx *ctx, int in, int port,
|
||||||
int bytes, uint32_t *eax, void *arg);
|
int bytes, uint32_t *eax, void *arg);
|
||||||
|
|
||||||
struct inout_port {
|
struct inout_port {
|
||||||
|
@ -447,7 +447,7 @@ pci_msix_pba_bar(struct pci_devinst *pi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pci_emul_io_handler(struct vmctx *ctx, int vcpu __unused, int in, int port,
|
pci_emul_io_handler(struct vmctx *ctx, int in, int port,
|
||||||
int bytes, uint32_t *eax, void *arg)
|
int bytes, uint32_t *eax, void *arg)
|
||||||
{
|
{
|
||||||
struct pci_devinst *pdi = arg;
|
struct pci_devinst *pdi = arg;
|
||||||
@ -2217,7 +2217,7 @@ pci_cfgrw(struct vmctx *ctx, int in, int bus, int slot, int func,
|
|||||||
static int cfgenable, cfgbus, cfgslot, cfgfunc, cfgoff;
|
static int cfgenable, cfgbus, cfgslot, cfgfunc, cfgoff;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pci_emul_cfgaddr(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
pci_emul_cfgaddr(struct vmctx *ctx __unused, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
uint32_t x;
|
uint32_t x;
|
||||||
@ -2247,7 +2247,7 @@ pci_emul_cfgaddr(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
|||||||
INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr);
|
INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pci_emul_cfgdata(struct vmctx *ctx, int vcpu __unused, int in, int port,
|
pci_emul_cfgdata(struct vmctx *ctx, int in, int port,
|
||||||
int bytes, uint32_t *eax, void *arg __unused)
|
int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
int coff;
|
int coff;
|
||||||
|
@ -180,7 +180,7 @@ lpc_uart_intr_deassert(void *arg __unused)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
lpc_uart_io_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
lpc_uart_io_handler(struct vmctx *ctx __unused, int in,
|
||||||
int port, int bytes, uint32_t *eax, void *arg)
|
int port, int bytes, uint32_t *eax, void *arg)
|
||||||
{
|
{
|
||||||
int offset;
|
int offset;
|
||||||
|
@ -72,14 +72,14 @@ static bool pctestdev_inited;
|
|||||||
static uint8_t pctestdev_iomem_buf[IOMEM_LEN];
|
static uint8_t pctestdev_iomem_buf[IOMEM_LEN];
|
||||||
static uint32_t pctestdev_ioport_data;
|
static uint32_t pctestdev_ioport_data;
|
||||||
|
|
||||||
static int pctestdev_debugexit_io(struct vmctx *ctx, int vcpu, int in,
|
static int pctestdev_debugexit_io(struct vmctx *ctx, int in,
|
||||||
int port, int bytes, uint32_t *eax, void *arg);
|
int port, int bytes, uint32_t *eax, void *arg);
|
||||||
static int pctestdev_iomem_io(struct vmctx *ctx, int vcpu, int dir,
|
static int pctestdev_iomem_io(struct vmctx *ctx, int vcpu, int dir,
|
||||||
uint64_t addr, int size, uint64_t *val, void *arg1,
|
uint64_t addr, int size, uint64_t *val, void *arg1,
|
||||||
long arg2);
|
long arg2);
|
||||||
static int pctestdev_ioport_io(struct vmctx *ctx, int vcpu, int in,
|
static int pctestdev_ioport_io(struct vmctx *ctx, int in,
|
||||||
int port, int bytes, uint32_t *eax, void *arg);
|
int port, int bytes, uint32_t *eax, void *arg);
|
||||||
static int pctestdev_irq_io(struct vmctx *ctx, int vcpu, int in,
|
static int pctestdev_irq_io(struct vmctx *ctx, int in,
|
||||||
int port, int bytes, uint32_t *eax, void *arg);
|
int port, int bytes, uint32_t *eax, void *arg);
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
@ -178,7 +178,7 @@ pctestdev_init(struct vmctx *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pctestdev_debugexit_io(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
pctestdev_debugexit_io(struct vmctx *ctx __unused, int in,
|
||||||
int port __unused, int bytes __unused, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes __unused, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
if (in)
|
if (in)
|
||||||
@ -211,7 +211,7 @@ pctestdev_iomem_io(struct vmctx *ctx __unused, int vcpu __unused, int dir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pctestdev_ioport_io(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
pctestdev_ioport_io(struct vmctx *ctx __unused, int in,
|
||||||
int port, int bytes, uint32_t *eax, void *arg __unused)
|
int port, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
uint32_t mask;
|
uint32_t mask;
|
||||||
@ -234,7 +234,7 @@ pctestdev_ioport_io(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pctestdev_irq_io(struct vmctx *ctx, int vcpu __unused, int in, int port,
|
pctestdev_irq_io(struct vmctx *ctx, int in, int port,
|
||||||
int bytes, uint32_t *eax, void *arg __unused)
|
int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
int irq;
|
int irq;
|
||||||
|
@ -60,7 +60,7 @@ static const unsigned gpe0_valid = (1u << GPE_VMGENC);
|
|||||||
* reset.
|
* reset.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
reset_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
reset_handler(struct vmctx *ctx __unused, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
@ -158,7 +158,7 @@ sci_update(struct vmctx *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pm1_status_handler(struct vmctx *ctx, int vcpu __unused, int in,
|
pm1_status_handler(struct vmctx *ctx, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ pm1_status_handler(struct vmctx *ctx, int vcpu __unused, int in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pm1_enable_handler(struct vmctx *ctx, int vcpu __unused, int in,
|
pm1_enable_handler(struct vmctx *ctx, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ static uint16_t pm1_control;
|
|||||||
#define PM1_ALWAYS_ZERO 0xc003
|
#define PM1_ALWAYS_ZERO 0xc003
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pm1_control_handler(struct vmctx *ctx, int vcpu __unused, int in,
|
pm1_control_handler(struct vmctx *ctx, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
@ -285,7 +285,7 @@ acpi_raise_gpe(struct vmctx *ctx, unsigned bit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gpe0_sts(struct vmctx *ctx, int vcpu __unused, int in, int port __unused,
|
gpe0_sts(struct vmctx *ctx, int in, int port __unused,
|
||||||
int bytes, uint32_t *eax, void *arg __unused)
|
int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -309,7 +309,7 @@ gpe0_sts(struct vmctx *ctx, int vcpu __unused, int in, int port __unused,
|
|||||||
INOUT_PORT(gpe0_sts, IO_GPE0_STS, IOPORT_F_INOUT, gpe0_sts);
|
INOUT_PORT(gpe0_sts, IO_GPE0_STS, IOPORT_F_INOUT, gpe0_sts);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gpe0_en(struct vmctx *ctx, int vcpu __unused, int in, int port __unused,
|
gpe0_en(struct vmctx *ctx, int in, int port __unused,
|
||||||
int bytes, uint32_t *eax, void *arg __unused)
|
int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
if (bytes != 1)
|
if (bytes != 1)
|
||||||
@ -333,7 +333,7 @@ INOUT_PORT(gpe0_en, IO_GPE0_EN, IOPORT_F_INOUT, gpe0_en);
|
|||||||
* This write-only register is used to enable and disable ACPI.
|
* This write-only register is used to enable and disable ACPI.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
smi_cmd_handler(struct vmctx *ctx, int vcpu __unused, int in, int port __unused,
|
smi_cmd_handler(struct vmctx *ctx, int in, int port __unused,
|
||||||
int bytes, uint32_t *eax, void *arg __unused)
|
int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "pci_lpc.h"
|
#include "pci_lpc.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
post_data_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
|
post_data_handler(struct vmctx *ctx __unused, int in,
|
||||||
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
int port __unused, int bytes, uint32_t *eax, void *arg __unused)
|
||||||
{
|
{
|
||||||
assert(in == 1);
|
assert(in == 1);
|
||||||
|
@ -1215,7 +1215,7 @@ vga_port_out_handler(struct vmctx *ctx __unused, int in __unused, int port,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vga_port_handler(struct vmctx *ctx, int vcpu __unused, int in, int port,
|
vga_port_handler(struct vmctx *ctx, int in, int port,
|
||||||
int bytes, uint32_t *eax, void *arg)
|
int bytes, uint32_t *eax, void *arg)
|
||||||
{
|
{
|
||||||
uint8_t val;
|
uint8_t val;
|
||||||
|
Loading…
Reference in New Issue
Block a user