CXL/cxl_component: Add cxl_get_hb_cstate()
authorJonathan Cameron <jonathan.cameron@huawei.com>
Fri, 29 Apr 2022 14:40:56 +0000 (15:40 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 13 May 2022 11:57:26 +0000 (07:57 -0400)
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>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220429144110.25167-32-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci-bridge/pci_expander_bridge.c
include/hw/cxl/cxl_component.h

index 22feda1ff009975bc268b0e76f490aebd5c968c1..69244decdbaac3196d590648a628c2f0d6ec4b11 100644 (file)
@@ -72,6 +72,13 @@ static GList *pxb_dev_list;
 
 #define TYPE_PXB_HOST "pxb-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);
index 4f69688c47867b96b39809b82335c727628416d0..70b5018156939d8029be448e4136300ebac06560 100644 (file)
@@ -218,4 +218,6 @@ static inline hwaddr cxl_decode_ig(int ig)
     return 1 << (ig + 8);
 }
 
+CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb);
+
 #endif