| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <lib/fidl/internal.h> |
| #include <lib/fidl/txn_header.h> |
| #include <lib/fidl/llcpp/array.h> |
| #include <lib/fidl/llcpp/coding.h> |
| #include <lib/fidl/llcpp/connect_service.h> |
| #include <lib/fidl/llcpp/service_handler_interface.h> |
| #include <lib/fidl/llcpp/string_view.h> |
| #include <lib/fidl/llcpp/sync_call.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <lib/fidl/llcpp/transaction.h> |
| #include <lib/fidl/llcpp/vector_view.h> |
| #include <lib/fit/function.h> |
| #include <lib/zx/channel.h> |
| #include <lib/zx/vmo.h> |
| #include <zircon/fidl.h> |
| |
| namespace llcpp { |
| |
| namespace fuchsia { |
| namespace hardware { |
| namespace securemem { |
| |
| class Device; |
| |
| extern "C" const fidl_type_t v1_fuchsia_hardware_securemem_DeviceGetSecureMemoryPhysicalAddressRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_securemem_DeviceGetSecureMemoryPhysicalAddressResponseTable; |
| |
| // This protocol currently is a temporary measure to allow for services to get the physical address |
| // of a previously pinned VMO until trusted services can be handed BTI handles. |
| class Device final { |
| Device() = delete; |
| public: |
| |
| struct GetSecureMemoryPhysicalAddressResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| int32_t s; |
| uint64_t paddr; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_hardware_securemem_DeviceGetSecureMemoryPhysicalAddressResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = false; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| }; |
| struct GetSecureMemoryPhysicalAddressRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::zx::vmo secure_mem; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_hardware_securemem_DeviceGetSecureMemoryPhysicalAddressRequestTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 24; |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr uint32_t AltPrimarySize = 24; |
| static constexpr uint32_t AltMaxOutOfLine = 0; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = false; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| using ResponseType = GetSecureMemoryPhysicalAddressResponse; |
| }; |
| |
| |
| // Collection of return types of FIDL calls in this interface. |
| class ResultOf final { |
| ResultOf() = delete; |
| private: |
| template <typename ResponseType> |
| class GetSecureMemoryPhysicalAddress_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| public: |
| GetSecureMemoryPhysicalAddress_Impl(::zx::unowned_channel _client_end, ::zx::vmo secure_mem); |
| ~GetSecureMemoryPhysicalAddress_Impl() = default; |
| GetSecureMemoryPhysicalAddress_Impl(GetSecureMemoryPhysicalAddress_Impl&& other) = default; |
| GetSecureMemoryPhysicalAddress_Impl& operator=(GetSecureMemoryPhysicalAddress_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using GetSecureMemoryPhysicalAddress = GetSecureMemoryPhysicalAddress_Impl<GetSecureMemoryPhysicalAddressResponse>; |
| }; |
| |
| // Collection of return types of FIDL calls in this interface, |
| // when the caller-allocate flavor or in-place call is used. |
| class UnownedResultOf final { |
| UnownedResultOf() = delete; |
| private: |
| template <typename ResponseType> |
| class GetSecureMemoryPhysicalAddress_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| public: |
| GetSecureMemoryPhysicalAddress_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::vmo secure_mem, ::fidl::BytePart _response_buffer); |
| ~GetSecureMemoryPhysicalAddress_Impl() = default; |
| GetSecureMemoryPhysicalAddress_Impl(GetSecureMemoryPhysicalAddress_Impl&& other) = default; |
| GetSecureMemoryPhysicalAddress_Impl& operator=(GetSecureMemoryPhysicalAddress_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using GetSecureMemoryPhysicalAddress = GetSecureMemoryPhysicalAddress_Impl<GetSecureMemoryPhysicalAddressResponse>; |
| }; |
| |
| class SyncClient final { |
| public: |
| explicit SyncClient(::zx::channel channel) : channel_(std::move(channel)) {} |
| ~SyncClient() = default; |
| SyncClient(SyncClient&&) = default; |
| SyncClient& operator=(SyncClient&&) = default; |
| |
| const ::zx::channel& channel() const { return channel_; } |
| |
| ::zx::channel* mutable_channel() { return &channel_; } |
| |
| // Gets the physical address of a previously pinned VMO. |
| // |
| // Note: |
| // * The VMO must be contiguous. |
| // * |secure_mem| is expected to have a stable physical address that is pinned by some other |
| // entity. The protocol implementation should not be expected to keep the VMO pinned. |
| // * The server implementation must not use an IOMMU-backed BTI handle, as the physical |
| // address of the VMO being pinned must be stable. |
| // Allocates 56 bytes of message buffer on the stack. No heap allocation necessary. |
| ResultOf::GetSecureMemoryPhysicalAddress GetSecureMemoryPhysicalAddress(::zx::vmo secure_mem); |
| |
| // Gets the physical address of a previously pinned VMO. |
| // |
| // Note: |
| // * The VMO must be contiguous. |
| // * |secure_mem| is expected to have a stable physical address that is pinned by some other |
| // entity. The protocol implementation should not be expected to keep the VMO pinned. |
| // * The server implementation must not use an IOMMU-backed BTI handle, as the physical |
| // address of the VMO being pinned must be stable. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| UnownedResultOf::GetSecureMemoryPhysicalAddress GetSecureMemoryPhysicalAddress(::fidl::BytePart _request_buffer, ::zx::vmo secure_mem, ::fidl::BytePart _response_buffer); |
| |
| private: |
| ::zx::channel channel_; |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned channel, avoiding setting up a client. |
| class Call final { |
| Call() = delete; |
| public: |
| |
| // Gets the physical address of a previously pinned VMO. |
| // |
| // Note: |
| // * The VMO must be contiguous. |
| // * |secure_mem| is expected to have a stable physical address that is pinned by some other |
| // entity. The protocol implementation should not be expected to keep the VMO pinned. |
| // * The server implementation must not use an IOMMU-backed BTI handle, as the physical |
| // address of the VMO being pinned must be stable. |
| // Allocates 56 bytes of message buffer on the stack. No heap allocation necessary. |
| static ResultOf::GetSecureMemoryPhysicalAddress GetSecureMemoryPhysicalAddress(::zx::unowned_channel _client_end, ::zx::vmo secure_mem); |
| |
| // Gets the physical address of a previously pinned VMO. |
| // |
| // Note: |
| // * The VMO must be contiguous. |
| // * |secure_mem| is expected to have a stable physical address that is pinned by some other |
| // entity. The protocol implementation should not be expected to keep the VMO pinned. |
| // * The server implementation must not use an IOMMU-backed BTI handle, as the physical |
| // address of the VMO being pinned must be stable. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| static UnownedResultOf::GetSecureMemoryPhysicalAddress GetSecureMemoryPhysicalAddress(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::vmo secure_mem, ::fidl::BytePart _response_buffer); |
| |
| }; |
| |
| // Messages are encoded and decoded in-place when these methods are used. |
| // Additionally, requests must be already laid-out according to the FIDL wire-format. |
| class InPlace final { |
| InPlace() = delete; |
| public: |
| |
| // Gets the physical address of a previously pinned VMO. |
| // |
| // Note: |
| // * The VMO must be contiguous. |
| // * |secure_mem| is expected to have a stable physical address that is pinned by some other |
| // entity. The protocol implementation should not be expected to keep the VMO pinned. |
| // * The server implementation must not use an IOMMU-backed BTI handle, as the physical |
| // address of the VMO being pinned must be stable. |
| static ::fidl::DecodeResult<GetSecureMemoryPhysicalAddressResponse> GetSecureMemoryPhysicalAddress(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<GetSecureMemoryPhysicalAddressRequest> params, ::fidl::BytePart response_buffer); |
| |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| class Interface { |
| public: |
| Interface() = default; |
| virtual ~Interface() = default; |
| using _Outer = Device; |
| using _Base = ::fidl::CompleterBase; |
| |
| class GetSecureMemoryPhysicalAddressCompleterBase : public _Base { |
| public: |
| void Reply(int32_t s, uint64_t paddr); |
| void Reply(::fidl::BytePart _buffer, int32_t s, uint64_t paddr); |
| void Reply(::fidl::DecodedMessage<GetSecureMemoryPhysicalAddressResponse> params); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using GetSecureMemoryPhysicalAddressCompleter = ::fidl::Completer<GetSecureMemoryPhysicalAddressCompleterBase>; |
| |
| virtual void GetSecureMemoryPhysicalAddress(::zx::vmo secure_mem, GetSecureMemoryPhysicalAddressCompleter::Sync _completer) = 0; |
| |
| }; |
| |
| // Attempts to dispatch the incoming message to a handler function in the server implementation. |
| // If there is no matching handler, it returns false, leaving the message and transaction intact. |
| // In all other cases, it consumes the message and returns true. |
| // It is possible to chain multiple TryDispatch functions in this manner. |
| static bool TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn); |
| |
| // Dispatches the incoming message to one of the handlers functions in the interface. |
| // If there is no matching handler, it closes all the handles in |msg| and closes the channel with |
| // a |ZX_ERR_NOT_SUPPORTED| epitaph, before returning false. The message should then be discarded. |
| static bool Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn); |
| |
| // Same as |Dispatch|, but takes a |void*| instead of |Interface*|. Only used with |fidl::Bind| |
| // to reduce template expansion. |
| // Do not call this method manually. Use |Dispatch| instead. |
| static bool TypeErasedDispatch(void* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) { |
| return Dispatch(static_cast<Interface*>(impl), msg, txn); |
| } |
| |
| |
| // Helper functions to fill in the transaction header in a |DecodedMessage<TransactionalMessage>|. |
| class SetTransactionHeaderFor final { |
| SetTransactionHeaderFor() = delete; |
| public: |
| static void GetSecureMemoryPhysicalAddressRequest(const ::fidl::DecodedMessage<Device::GetSecureMemoryPhysicalAddressRequest>& _msg); |
| static void GetSecureMemoryPhysicalAddressResponse(const ::fidl::DecodedMessage<Device::GetSecureMemoryPhysicalAddressResponse>& _msg); |
| }; |
| }; |
| |
| } // namespace securemem |
| } // namespace hardware |
| } // namespace fuchsia |
| } // namespace llcpp |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressRequest> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressRequest) |
| == ::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressRequest, secure_mem) == 16); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressResponse> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressResponse) |
| == ::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressResponse, s) == 16); |
| static_assert(offsetof(::llcpp::fuchsia::hardware::securemem::Device::GetSecureMemoryPhysicalAddressResponse, paddr) == 24); |
| |
| } // namespace fidl |