Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_passthru.h
/*- | /*- | ||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD | * SPDX-License-Identifier: BSD-2-Clause-FreeBSD | ||||
* | * | ||||
* Copyright (c) 2020 Beckhoff Automation GmbH & Co. KG | * Copyright (c) 2020 Beckhoff Automation GmbH & Co. KG | ||||
* Author: Corvin Köhne <c.koehne@beckhoff.com> | * Author: Corvin Köhne <c.koehne@beckhoff.com> | ||||
*/ | */ | ||||
#pragma once | #pragma once | ||||
#include <vmmapi.h> | #include <vmmapi.h> | ||||
#include "pci_emul.h" | #include "pci_emul.h" | ||||
struct passthru_softc { | |||||
struct pci_devinst *psc_pi; | |||||
/* ROM is handled like a BAR */ | |||||
struct pcibar psc_bar[PCI_BARMAX_WITH_ROM + 1]; | |||||
struct { | |||||
int capoff; | |||||
int msgctrl; | |||||
int emulated; | |||||
} psc_msi; | |||||
struct { | |||||
int capoff; | |||||
} psc_msix; | |||||
struct pcisel psc_sel; | |||||
}; | |||||
uint32_t read_config(const struct pcisel *sel, long reg, int width); | uint32_t read_config(const struct pcisel *sel, long reg, int width); | ||||
void write_config(const struct pcisel *sel, long reg, int width, uint32_t data); | void write_config(const struct pcisel *sel, long reg, int width, uint32_t data); |