Records

Functions

  • fidl::OutgoingMessage MoveToArena (fidl::OutgoingMessage & message, const fdf::Arena & arena)

    Defined at line 12 of file ../../sdk/lib/fidl_driver/natural_messaging.cc

  • fpromise::result<fidl::WireSharedClient<fuchsia_io::File>, zx_status_t> OpenWithResult (const fdf::Namespace & ns, async_dispatcher_t * dispatcher, const char * path, fuchsia_io::Flags flags)

    Opens the given `path` in `ns`, and returns a fpromise::result containing a

    fidl::WireSharedClient on success.

    Defined at line 13 of file ../../sdk/lib/driver/promise/cpp/promise.cc

  • template <typename Protocol>
    fpromise::result<fidl::WireSharedClient<Protocol>, zx_status_t> ConnectWithResult (const fdf::Namespace & ns, async_dispatcher_t * dispatcher, const char * protocol_name)

    Connects to the given `protocol_name` in `ns`, and returns a fpromise::result containing a

    fidl::WireSharedClient on success.

    Defined at line 20 of file ../../sdk/lib/driver/promise/cpp/promise.h

  • template <typename ServiceMember>
    zx::result<fdf::ClientEnd<typename ServiceMember::ProtocolType>> DriverTransportConnect (fidl::UnownedClientEnd<fuchsia_io::Directory> svc_dir, std::string_view instance)

    Defined at line 34 of file ../../sdk/lib/driver/incoming/cpp/namespace.h

  • template <typename ServiceMember>
    zx::result<> DriverTransportConnect (fidl::UnownedClientEnd<fuchsia_io::Directory> svc_dir, fdf::ServerEnd<typename ServiceMember::ProtocolType> server_end, std::string_view instance)

    Defined at line 66 of file ../../sdk/lib/driver/incoming/cpp/namespace.h

  • zx::result<fdf::MmioBuffer> PDevMakeMmioBufferWeak (PDev::MmioInfo & pdev_mmio, uint32_t cache_policy)

    This helper is marked weak because it is sometimes necessary to provide a

    test-only version that allows for MMIO fakes or mocks to reach the driver under test.

    For example say you have a fake Protocol device that needs to smuggle a fake MMIO:

    class FakePDev {

    .....

    zx::result

    <MmioInfo

    > PDevGetMmio(uint32_t index) {

    MmioInfo out_mmio = {};

    out_mmio.offset = reinterpret_cast

    <size

    _t>(this);

    return zx::ok(out_mmio);

    }

    .....

    };

    The actual implementation expects a real {size, offset, VMO} and therefore it will

    fail. But works if a replacement PDevMakeMmioBufferWeak in the test is provided:

    zx::result

    <fdf

    ::MmioBuffer> PDevMakeMmioBufferWeak(const MmioInfo

    &

    pdev_mmio) {

    auto* test_harness = reinterpret_cast

    <FakePDev

    *>(pdev_mmio.offset);

    return zx::ok(test_harness->fake_mmio());

    }

    Note that if you are using `//sdk/lib/driver/fake-platform-device/cpp`, it provides an

    implementation of this functionality for you. Drivers must set the `mmios` field in

    `FakePDev::Config`.

    Defined at line 242 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

Variables

const char *const kFailedToCreateDriverArena

Defined at line 10 of file ../../sdk/lib/fidl_driver/natural_messaging.cc