[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 33/42] CXL/cxl_component: Add cxl_get_hb_cstate()
From: |
Jonathan Cameron |
Subject: |
[PATCH v4 33/42] CXL/cxl_component: Add cxl_get_hb_cstate() |
Date: |
Mon, 24 Jan 2022 17:16:56 +0000 |
From: Jonathan Cameron <jonathan.cameron@huawei.com>
Accessor to get hold of the cxl state for a CXL host bridge
without exposing the internals of the implementation.
Signed-off-by: Jonathan Cameron <jonathan.cameron@huawei.com>
---
hw/pci-bridge/pci_expander_bridge.c | 7 +++++++
include/hw/cxl/cxl_component.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/hw/pci-bridge/pci_expander_bridge.c
b/hw/pci-bridge/pci_expander_bridge.c
index 206e5412d3..e87651d13e 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -81,6 +81,13 @@ static GList *pxb_dev_list;
#define TYPE_PXB_CXL_HOST "pxb-cxl-host"
#define PXB_CXL_HOST(obj) OBJECT_CHECK(CXLHost, (obj), TYPE_PXB_CXL_HOST)
+CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb)
+{
+ CXLHost *host = PXB_CXL_HOST(hb);
+
+ return &host->cxl_cstate;
+}
+
static int pxb_bus_num(PCIBus *bus)
{
PXBDev *pxb = convert_to_pxb(bus->parent_dev);
diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h
index d30c3f4716..8ca141afd4 100644
--- a/include/hw/cxl/cxl_component.h
+++ b/include/hw/cxl/cxl_component.h
@@ -201,4 +201,6 @@ static inline hwaddr cxl_decode_ig(int ig)
return 1 << (ig + 8);
}
+CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb);
+
#endif
--
2.32.0
- [PATCH v4 23/42] tests/acpi: allow CEDT table addition, (continued)
- [PATCH v4 23/42] tests/acpi: allow CEDT table addition, Jonathan Cameron, 2022/01/24
- [PATCH v4 24/42] acpi/cxl: Create the CEDT (9.14.1), Jonathan Cameron, 2022/01/24
- [PATCH v4 25/42] hw/cxl/device: Add some trivial commands, Jonathan Cameron, 2022/01/24
- [PATCH v4 26/42] hw/cxl/device: Plumb real Label Storage Area (LSA) sizing, Jonathan Cameron, 2022/01/24
- [PATCH v4 27/42] hw/cxl/device: Implement get/set Label Storage Area (LSA), Jonathan Cameron, 2022/01/24
- [PATCH v4 28/42] hw/cxl/component: Add utils for interleave parameter encoding/decoding, Jonathan Cameron, 2022/01/24
- [PATCH v4 29/42] hw/cxl/host: Add support for CXL Fixed Memory Windows., Jonathan Cameron, 2022/01/24
- [PATCH v4 30/42] acpi/cxl: Introduce CFMWS structures in CEDT, Jonathan Cameron, 2022/01/24
- [PATCH v4 31/42] hw/pci-host/gpex-acpi: Add support for dsdt construction for pxb-cxl, Jonathan Cameron, 2022/01/24
- [PATCH v4 32/42] pci/pcie_port: Add pci_find_port_by_pn(), Jonathan Cameron, 2022/01/24
- [PATCH v4 33/42] CXL/cxl_component: Add cxl_get_hb_cstate(),
Jonathan Cameron <=
- [PATCH v4 34/42] mem/cxl_type3: Add read and write functions for associated hostmem., Jonathan Cameron, 2022/01/24
- [PATCH v4 35/42] cxl/cxl-host: Add memops for CFMWS region., Jonathan Cameron, 2022/01/24
- [PATCH v4 36/42] arm/virt: Allow virt/CEDT creation, Jonathan Cameron, 2022/01/24
- [PATCH v4 38/42] RFC: softmmu/memory: Add ops to memory_region_ram_init_from_file, Jonathan Cameron, 2022/01/24
- [PATCH v4 37/42] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl, Jonathan Cameron, 2022/01/24
- [PATCH v4 39/42] hw/cxl/component Add a dumb HDM decoder handler, Jonathan Cameron, 2022/01/24
- [PATCH v4 40/42] i386/pc: Enable CXL fixed memory windows, Jonathan Cameron, 2022/01/24
- [PATCH v4 41/42] qtest/acpi: Add reference CEDT tables., Jonathan Cameron, 2022/01/24
- [PATCH v4 42/42] qtest/cxl: Add very basic sanity tests, Jonathan Cameron, 2022/01/24
- Re: [PATCH v4 00/42] CXl 2.0 emulation Support, Jonathan Cameron, 2022/01/24