mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
devm_cxl_add_dport_by_dev() outside of cxl_test is done through PCI hierarchy. However with cxl_test, it needs to be done through the platform device hierarchy. Add the mock function for devm_cxl_add_dport_by_dev(). When cxl_core calls a cxl_core exported function and that function is mocked by cxl_test, the call chain causes a circular dependency issue. Dan provided a workaround to avoid this issue. Apply the method to changes from the late dport allocation changes in order to enable cxl-test. In cxl_core they are defined with "__" added in front of the function. A macro is used to define the original function names for when non-test version of the kernel is built. A bit of macros and typedefs are used to allow mocking of those functions in cxl_test. Co-developed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Li Ming <ming.li@zohomail.com> Tested-by: Alison Schofield <alison.schofield@intel.com> Tested-by: Robert Richter <rrichter@amd.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
75 lines
2.2 KiB
Makefile
75 lines
2.2 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
ldflags-y += --wrap=acpi_table_parse_cedt
|
|
ldflags-y += --wrap=is_acpi_device_node
|
|
ldflags-y += --wrap=acpi_evaluate_integer
|
|
ldflags-y += --wrap=acpi_pci_find_root
|
|
ldflags-y += --wrap=nvdimm_bus_register
|
|
ldflags-y += --wrap=devm_cxl_port_enumerate_dports
|
|
ldflags-y += --wrap=cxl_await_media_ready
|
|
ldflags-y += --wrap=devm_cxl_add_rch_dport
|
|
ldflags-y += --wrap=cxl_rcd_component_reg_phys
|
|
ldflags-y += --wrap=cxl_endpoint_parse_cdat
|
|
ldflags-y += --wrap=cxl_dport_init_ras_reporting
|
|
ldflags-y += --wrap=devm_cxl_switch_port_decoders_setup
|
|
ldflags-y += --wrap=devm_cxl_endpoint_decoders_setup
|
|
|
|
DRIVERS := ../../../drivers
|
|
CXL_SRC := $(DRIVERS)/cxl
|
|
CXL_CORE_SRC := $(DRIVERS)/cxl/core
|
|
ccflags-y := -I$(srctree)/drivers/cxl/
|
|
ccflags-y += -D__mock=__weak
|
|
ccflags-y += -DCXL_TEST_ENABLE=1
|
|
ccflags-y += -DTRACE_INCLUDE_PATH=$(CXL_CORE_SRC) -I$(srctree)/drivers/cxl/core/
|
|
|
|
obj-m += cxl_acpi.o
|
|
|
|
cxl_acpi-y := $(CXL_SRC)/acpi.o
|
|
cxl_acpi-y += mock_acpi.o
|
|
cxl_acpi-y += config_check.o
|
|
cxl_acpi-y += cxl_acpi_test.o
|
|
|
|
obj-m += cxl_pmem.o
|
|
|
|
cxl_pmem-y := $(CXL_SRC)/pmem.o
|
|
cxl_pmem-y += $(CXL_SRC)/security.o
|
|
cxl_pmem-y += config_check.o
|
|
cxl_pmem-y += cxl_pmem_test.o
|
|
|
|
obj-m += cxl_port.o
|
|
|
|
cxl_port-y := $(CXL_SRC)/port.o
|
|
cxl_port-y += config_check.o
|
|
cxl_port-y += cxl_port_test.o
|
|
|
|
|
|
obj-m += cxl_mem.o
|
|
|
|
cxl_mem-y := $(CXL_SRC)/mem.o
|
|
cxl_mem-y += config_check.o
|
|
cxl_mem-y += cxl_mem_test.o
|
|
|
|
obj-m += cxl_core.o
|
|
|
|
cxl_core-y := $(CXL_CORE_SRC)/port.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/pmem.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/regs.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/memdev.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/mbox.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/pci.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/hdm.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/pmu.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/cdat.o
|
|
cxl_core-y += $(CXL_CORE_SRC)/ras.o
|
|
cxl_core-$(CONFIG_TRACING) += $(CXL_CORE_SRC)/trace.o
|
|
cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region.o
|
|
cxl_core-$(CONFIG_CXL_MCE) += $(CXL_CORE_SRC)/mce.o
|
|
cxl_core-$(CONFIG_CXL_FEATURES) += $(CXL_CORE_SRC)/features.o
|
|
cxl_core-$(CONFIG_CXL_EDAC_MEM_FEATURES) += $(CXL_CORE_SRC)/edac.o
|
|
cxl_core-y += config_check.o
|
|
cxl_core-y += cxl_core_test.o
|
|
cxl_core-y += cxl_core_exports.o
|
|
|
|
KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS))
|
|
|
|
obj-m += test/
|