Skip to content
Snippets Groups Projects
Commit e5444b60 authored by Roland McGrath's avatar Roland McGrath Committed by CQ bot account: commit-bot@chromium.org
Browse files

[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: I824d395501b35f59ffb23ac37fffb628f163d46e
parent f3763fad
Loading
Showing
with 60 additions and 48 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment