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_mmio_mapping { | |||||
vm_paddr_t gpa; /* guest physical address */ | |||||
void *gva; /* guest virtual address */ | |||||
vm_paddr_t hpa; /* host physical address */ | |||||
void *hva; /* guest virtual address */ | |||||
markj: Is something meant to dereference these pointers? If not, why are they pointer types? It looks… | |||||
Done Inline ActionsI'm using this pointer to map and copy the OpRegion. See D40041. corvink: I'm using this pointer to map and copy the OpRegion. See D40041. | |||||
vm_paddr_t len; | |||||
}; | |||||
struct passthru_softc; | struct passthru_softc; | ||||
typedef int (*cfgread_handler)(struct passthru_softc *sc, | typedef int (*cfgread_handler)(struct passthru_softc *sc, | ||||
struct pci_devinst *pi, int coff, int bytes, uint32_t *rv); | struct pci_devinst *pi, int coff, int bytes, uint32_t *rv); | ||||
typedef int (*cfgwrite_handler)(struct passthru_softc *sc, | typedef int (*cfgwrite_handler)(struct passthru_softc *sc, | ||||
struct pci_devinst *pi, int coff, int bytes, uint32_t val); | struct pci_devinst *pi, int coff, int bytes, uint32_t val); | ||||
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); | ||||
int passthru_cfgread_emulate(struct passthru_softc *sc, struct pci_devinst *pi, | int passthru_cfgread_emulate(struct passthru_softc *sc, struct pci_devinst *pi, | ||||
int coff, int bytes, uint32_t *rv); | int coff, int bytes, uint32_t *rv); | ||||
int passthru_cfgwrite_emulate(struct passthru_softc *sc, struct pci_devinst *pi, | int passthru_cfgwrite_emulate(struct passthru_softc *sc, struct pci_devinst *pi, | ||||
int coff, int bytes, uint32_t val); | int coff, int bytes, uint32_t val); | ||||
struct passthru_mmio_mapping *passthru_get_mmio(struct passthru_softc *sc, | |||||
int num); | |||||
struct pcisel *passthru_get_sel(struct passthru_softc *sc); | struct pcisel *passthru_get_sel(struct passthru_softc *sc); | ||||
int set_pcir_handler(struct passthru_softc *sc, int reg, int len, | int set_pcir_handler(struct passthru_softc *sc, int reg, int len, | ||||
cfgread_handler rhandler, cfgwrite_handler whandler); | cfgread_handler rhandler, cfgwrite_handler whandler); |
Is something meant to dereference these pointers? If not, why are they pointer types? It looks like they should be integer types.