Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/amd/amdvi_priv.h
/*- | /*- | ||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD | * SPDX-License-Identifier: BSD-2-Clause-FreeBSD | ||||
* | * | ||||
* Copyright (c) 2016 Anish Gupta (anish@freebsd.org) | * Copyright (c) 2016 Anish Gupta (anish@freebsd.org) | ||||
* All rights reserved. | * Copyright (c) 2021 The FreeBSD Foundation | ||||
* | * | ||||
* Portions of this software were developed by Ka Ho Ng | |||||
* under sponsorship from the FreeBSD Foundation. | |||||
* | |||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice unmodified, this list of conditions, and the following | * notice unmodified, this list of conditions, and the following | ||||
* disclaimer. | * disclaimer. | ||||
* 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | ||||
* notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the | ||||
▲ Show 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | struct amdvi_softc { | ||||
uint32_t ivhd_flag; /* ACPI IVHD flag. */ | uint32_t ivhd_flag; /* ACPI IVHD flag. */ | ||||
uint32_t ivhd_feature; /* ACPI v1 Reserved or v2 attribute. */ | uint32_t ivhd_feature; /* ACPI v1 Reserved or v2 attribute. */ | ||||
uint64_t ext_feature; /* IVHD EFR */ | uint64_t ext_feature; /* IVHD EFR */ | ||||
/* PCI related. */ | /* PCI related. */ | ||||
uint16_t cap_off; /* PCI Capability offset. */ | uint16_t cap_off; /* PCI Capability offset. */ | ||||
uint8_t pci_cap; /* PCI capability. */ | uint8_t pci_cap; /* PCI capability. */ | ||||
uint16_t pci_seg; /* IOMMU PCI domain/segment. */ | uint16_t pci_seg; /* IOMMU PCI domain/segment. */ | ||||
uint16_t pci_rid; /* PCI BDF of IOMMU */ | uint16_t pci_rid; /* PCI BDF of IOMMU */ | ||||
/* Device range under this IOMMU. */ | |||||
uint16_t start_dev_rid; /* First device under this IOMMU. */ | |||||
uint16_t end_dev_rid; /* Last device under this IOMMU. */ | |||||
/* BIOS provided device configuration for end points. */ | /* ACPI device configuration for end points. */ | ||||
struct ivhd_dev_cfg dev_cfg[10]; | struct ivhd_dev_cfg *dev_cfg; | ||||
int dev_cfg_cnt; | int dev_cfg_cnt; | ||||
int dev_cfg_cap; | |||||
/* Software statistics. */ | /* Software statistics. */ | ||||
uint64_t event_intr_cnt; /* Total event INTR count. */ | uint64_t event_intr_cnt; /* Total event INTR count. */ | ||||
uint64_t total_cmd; /* Total number of commands. */ | uint64_t total_cmd; /* Total number of commands. */ | ||||
}; | }; | ||||
int amdvi_setup_hw(struct amdvi_softc *softc); | int amdvi_setup_hw(struct amdvi_softc *softc); | ||||
int amdvi_teardown_hw(struct amdvi_softc *softc); | int amdvi_teardown_hw(struct amdvi_softc *softc); | ||||
#endif /* _AMDVI_PRIV_H_ */ | #endif /* _AMDVI_PRIV_H_ */ |