[drivers] Avoid system/dev/lib/mmio deps in libraries and tests
Test code needs to use the mock mmio library header while driver code needs to use the real mmio library header. Hence, a library like ddktl or hwreg that is used in both contexts cannot rely on this header directly. Instead, make the APIs agnostic to mmio implementation by using forward declarations and requiring users of the mmio-related APIs to #include what they use. The renaming of the mock library to aaa-mock-mmio-reg was a previous attempt to work around this issue, which is actually wholly inadequate in the current build system. So the library is renamed back to mock-mmio-reg. In the hwreg library, this was achieved by using a template common to the kernel and non-kernel cases, rather than an explicit forward declaration. To make that work, the argument order for RegisterIo::Write was swapped to match MmioBuffer::Write so that they are interchangeable in template instantiation. Both implementations of the <lib/mmio/mmio.h> were using templates where they should have been using simple forward declarations. Fix that so that separate forward declarations become tenable. Some cases of non-driver code still using the real mmio library remain and need to be untangled. Bug: ZX-4062 #comment hwreg, ddktl libraries made mmio-header-agnostic Change-Id: Ie20c246049b37569346790439b6b315fef69234a
Showing
- garnet/drivers/gpu/msd-img-rgx/mtk/BUILD.gn 1 addition, 0 deletionsgarnet/drivers/gpu/msd-img-rgx/mtk/BUILD.gn
- garnet/drivers/gpu/msd-img-rgx/mtk/mt8167s-gpu.h 3 additions, 4 deletionsgarnet/drivers/gpu/msd-img-rgx/mtk/mt8167s-gpu.h
- zircon/system/dev/block/aml-sd-emmc/BUILD.gn 1 addition, 0 deletionszircon/system/dev/block/aml-sd-emmc/BUILD.gn
- zircon/system/dev/block/mtk-sdmmc/BUILD.gn 1 addition, 1 deletionzircon/system/dev/block/mtk-sdmmc/BUILD.gn
- zircon/system/dev/board/mt8167s_ref/mt8167-audio.cpp 3 additions, 3 deletionszircon/system/dev/board/mt8167s_ref/mt8167-audio.cpp
- zircon/system/dev/board/mt8167s_ref/mt8167-display.cpp 4 additions, 2 deletionszircon/system/dev/board/mt8167s_ref/mt8167-display.cpp
- zircon/system/dev/board/mt8167s_ref/mt8167-msdc0.cpp 1 addition, 0 deletionszircon/system/dev/board/mt8167s_ref/mt8167-msdc0.cpp
- zircon/system/dev/bus/pci/BUILD.gn 5 additions, 0 deletionszircon/system/dev/bus/pci/BUILD.gn
- zircon/system/dev/bus/pci/test/fake_ecam.h 1 addition, 1 deletionzircon/system/dev/bus/pci/test/fake_ecam.h
- zircon/system/dev/bus/virtio/BUILD.gn 1 addition, 1 deletionzircon/system/dev/bus/virtio/BUILD.gn
- zircon/system/dev/camera/aml-mipicsi/BUILD.gn 1 addition, 0 deletionszircon/system/dev/camera/aml-mipicsi/BUILD.gn
- zircon/system/dev/camera/arm-isp/pingpong_regs.h 1 addition, 0 deletionszircon/system/dev/camera/arm-isp/pingpong_regs.h
- zircon/system/dev/clk/amlogic-clk/BUILD.gn 2 additions, 4 deletionszircon/system/dev/clk/amlogic-clk/BUILD.gn
- zircon/system/dev/clk/hisi-lib/BUILD.gn 5 additions, 0 deletionszircon/system/dev/clk/hisi-lib/BUILD.gn
- zircon/system/dev/clk/hisi-lib/hisi-clk.cpp 1 addition, 0 deletionszircon/system/dev/clk/hisi-lib/hisi-clk.cpp
- zircon/system/dev/clk/hisi-lib/include/dev/clk/hisi-lib/hisi-clk.h 2 additions, 3 deletions...stem/dev/clk/hisi-lib/include/dev/clk/hisi-lib/hisi-clk.h
- zircon/system/dev/clk/msm8x53-clk/BUILD.gn 2 additions, 3 deletionszircon/system/dev/clk/msm8x53-clk/BUILD.gn
- zircon/system/dev/display/mt8167s-display/BUILD.gn 23 additions, 25 deletionszircon/system/dev/display/mt8167s-display/BUILD.gn
- zircon/system/dev/display/mt8167s-display/mt8167s-display-test.cpp 0 additions, 1 deletion...stem/dev/display/mt8167s-display/mt8167s-display-test.cpp
- zircon/system/dev/fw/qcom-pil/BUILD.gn 1 addition, 1 deletionzircon/system/dev/fw/qcom-pil/BUILD.gn
Loading
Please register or sign in to comment