| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <fuchsia/hardware/block/llcpp/fidl.h> |
| #include <memory> |
| |
| namespace llcpp { |
| |
| namespace fuchsia { |
| namespace hardware { |
| namespace block { |
| |
| namespace { |
| |
| [[maybe_unused]] |
| constexpr uint64_t kFtl_Format_Ordinal = 0x34f0c1b900000000lu; |
| [[maybe_unused]] |
| constexpr uint64_t kFtl_Format_GenOrdinal = 0x79751d9c0b48a0d6lu; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_FtlFormatRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_FtlFormatResponseTable; |
| |
| } // namespace |
| template <> |
| Ftl::ResultOf::Format_Impl<Ftl::FormatResponse>::Format_Impl(::zx::unowned_channel _client_end) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<FormatRequest, ::fidl::MessageDirection::kSending>(); |
| ::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined; |
| auto& _write_bytes_array = _write_bytes_inlined; |
| uint8_t* _write_bytes = _write_bytes_array.view().data(); |
| memset(_write_bytes, 0, FormatRequest::PrimarySize); |
| ::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(FormatRequest)); |
| ::fidl::DecodedMessage<FormatRequest> _decoded_request(std::move(_request_bytes)); |
| Super::SetResult( |
| Ftl::InPlace::Format(std::move(_client_end), Super::response_buffer())); |
| } |
| |
| Ftl::ResultOf::Format Ftl::SyncClient::Format() { |
| return ResultOf::Format(::zx::unowned_channel(this->channel_)); |
| } |
| |
| Ftl::ResultOf::Format Ftl::Call::Format(::zx::unowned_channel _client_end) { |
| return ResultOf::Format(std::move(_client_end)); |
| } |
| |
| template <> |
| Ftl::UnownedResultOf::Format_Impl<Ftl::FormatResponse>::Format_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(FormatRequest)] = {}; |
| ::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes)); |
| memset(_request_buffer.data(), 0, FormatRequest::PrimarySize); |
| _request_buffer.set_actual(sizeof(FormatRequest)); |
| ::fidl::DecodedMessage<FormatRequest> _decoded_request(std::move(_request_buffer)); |
| Super::SetResult( |
| Ftl::InPlace::Format(std::move(_client_end), std::move(_response_buffer))); |
| } |
| |
| Ftl::UnownedResultOf::Format Ftl::SyncClient::Format(::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::Format(::zx::unowned_channel(this->channel_), std::move(_response_buffer)); |
| } |
| |
| Ftl::UnownedResultOf::Format Ftl::Call::Format(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::Format(std::move(_client_end), std::move(_response_buffer)); |
| } |
| |
| ::fidl::DecodeResult<Ftl::FormatResponse> Ftl::InPlace::Format(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) { |
| constexpr uint32_t _write_num_bytes = sizeof(FormatRequest); |
| ::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes; |
| ::fidl::BytePart _request_buffer = _write_bytes.view(); |
| _request_buffer.set_actual(_write_num_bytes); |
| ::fidl::DecodedMessage<FormatRequest> params(std::move(_request_buffer)); |
| Ftl::SetTransactionHeaderFor::FormatRequest(params); |
| auto _encode_request_result = ::fidl::Encode(std::move(params)); |
| if (_encode_request_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Ftl::FormatResponse>::FromFailure( |
| std::move(_encode_request_result)); |
| } |
| auto _call_result = ::fidl::Call<FormatRequest, FormatResponse>( |
| std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer)); |
| if (_call_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Ftl::FormatResponse>::FromFailure( |
| std::move(_call_result)); |
| } |
| return ::fidl::Decode(std::move(_call_result.message)); |
| } |
| |
| |
| bool Ftl::TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) { |
| if (msg->num_bytes < sizeof(fidl_message_header_t)) { |
| zx_handle_close_many(msg->handles, msg->num_handles); |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| fidl_message_header_t* hdr = reinterpret_cast<fidl_message_header_t*>(msg->bytes); |
| zx_status_t status = fidl_validate_txn_header(hdr); |
| if (status != ZX_OK) { |
| txn->Close(status); |
| return true; |
| } |
| switch (hdr->ordinal) { |
| case kFtl_Format_Ordinal: |
| case kFtl_Format_GenOrdinal: |
| { |
| auto result = ::fidl::DecodeAs<FormatRequest>(msg); |
| if (result.status != ZX_OK) { |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| impl->Format( |
| Interface::FormatCompleter::Sync(txn)); |
| return true; |
| } |
| default: { |
| return false; |
| } |
| } |
| } |
| |
| bool Ftl::Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) { |
| bool found = TryDispatch(impl, msg, txn); |
| if (!found) { |
| zx_handle_close_many(msg->handles, msg->num_handles); |
| txn->Close(ZX_ERR_NOT_SUPPORTED); |
| } |
| return found; |
| } |
| |
| |
| void Ftl::Interface::FormatCompleterBase::Reply(int32_t status) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<FormatResponse, ::fidl::MessageDirection::kSending>(); |
| FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize] = {}; |
| auto& _response = *reinterpret_cast<FormatResponse*>(_write_bytes); |
| Ftl::SetTransactionHeaderFor::FormatResponse( |
| ::fidl::DecodedMessage<FormatResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| FormatResponse::PrimarySize, |
| FormatResponse::PrimarySize))); |
| _response.status = std::move(status); |
| ::fidl::BytePart _response_bytes(_write_bytes, _kWriteAllocSize, sizeof(FormatResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<FormatResponse>(std::move(_response_bytes))); |
| } |
| |
| void Ftl::Interface::FormatCompleterBase::Reply(::fidl::BytePart _buffer, int32_t status) { |
| if (_buffer.capacity() < FormatResponse::PrimarySize) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| auto& _response = *reinterpret_cast<FormatResponse*>(_buffer.data()); |
| Ftl::SetTransactionHeaderFor::FormatResponse( |
| ::fidl::DecodedMessage<FormatResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| FormatResponse::PrimarySize, |
| FormatResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _buffer.set_actual(sizeof(FormatResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<FormatResponse>(std::move(_buffer))); |
| } |
| |
| void Ftl::Interface::FormatCompleterBase::Reply(::fidl::DecodedMessage<FormatResponse> params) { |
| Ftl::SetTransactionHeaderFor::FormatResponse(params); |
| CompleterBase::SendReply(std::move(params)); |
| } |
| |
| |
| |
| void Ftl::SetTransactionHeaderFor::FormatRequest(const ::fidl::DecodedMessage<Ftl::FormatRequest>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kFtl_Format_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| void Ftl::SetTransactionHeaderFor::FormatResponse(const ::fidl::DecodedMessage<Ftl::FormatResponse>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kFtl_Format_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| |
| namespace { |
| |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_GetInfo_Ordinal = 0x7279049800000000lu; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_GetInfo_GenOrdinal = 0x79df1a5cdb6cc6a3lu; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockGetInfoRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockGetInfoResponseTable; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_GetStats_Ordinal = 0x73b9275400000000lu; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_GetStats_GenOrdinal = 0x53d9542a778385aelu; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockGetStatsRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockGetStatsResponseTable; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_GetFifo_Ordinal = 0x63616dbe00000000lu; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_GetFifo_GenOrdinal = 0x507ea563fb50747elu; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockGetFifoRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockGetFifoResponseTable; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_AttachVmo_Ordinal = 0x72df2e6600000000lu; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_AttachVmo_GenOrdinal = 0x7e726e5993add9b7lu; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockAttachVmoRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockAttachVmoResponseTable; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_CloseFifo_Ordinal = 0x6b4a461300000000lu; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_CloseFifo_GenOrdinal = 0x4dc09acdfa2a2a65lu; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockCloseFifoRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockCloseFifoResponseTable; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_RebindDevice_Ordinal = 0x2c1ffdb000000000lu; |
| [[maybe_unused]] |
| constexpr uint64_t kBlock_RebindDevice_GenOrdinal = 0x5d728cbd5312c9aelu; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockRebindDeviceRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_hardware_block_BlockRebindDeviceResponseTable; |
| |
| } // namespace |
| template <> |
| Block::ResultOf::GetInfo_Impl<Block::GetInfoResponse>::GetInfo_Impl(::zx::unowned_channel _client_end) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetInfoRequest, ::fidl::MessageDirection::kSending>(); |
| ::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined; |
| auto& _write_bytes_array = _write_bytes_inlined; |
| uint8_t* _write_bytes = _write_bytes_array.view().data(); |
| memset(_write_bytes, 0, GetInfoRequest::PrimarySize); |
| ::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetInfoRequest)); |
| ::fidl::DecodedMessage<GetInfoRequest> _decoded_request(std::move(_request_bytes)); |
| Super::SetResult( |
| Block::InPlace::GetInfo(std::move(_client_end), Super::response_buffer())); |
| } |
| |
| Block::ResultOf::GetInfo Block::SyncClient::GetInfo() { |
| return ResultOf::GetInfo(::zx::unowned_channel(this->channel_)); |
| } |
| |
| Block::ResultOf::GetInfo Block::Call::GetInfo(::zx::unowned_channel _client_end) { |
| return ResultOf::GetInfo(std::move(_client_end)); |
| } |
| |
| template <> |
| Block::UnownedResultOf::GetInfo_Impl<Block::GetInfoResponse>::GetInfo_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(GetInfoRequest)] = {}; |
| ::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes)); |
| memset(_request_buffer.data(), 0, GetInfoRequest::PrimarySize); |
| _request_buffer.set_actual(sizeof(GetInfoRequest)); |
| ::fidl::DecodedMessage<GetInfoRequest> _decoded_request(std::move(_request_buffer)); |
| Super::SetResult( |
| Block::InPlace::GetInfo(std::move(_client_end), std::move(_response_buffer))); |
| } |
| |
| Block::UnownedResultOf::GetInfo Block::SyncClient::GetInfo(::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::GetInfo(::zx::unowned_channel(this->channel_), std::move(_response_buffer)); |
| } |
| |
| Block::UnownedResultOf::GetInfo Block::Call::GetInfo(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::GetInfo(std::move(_client_end), std::move(_response_buffer)); |
| } |
| |
| ::fidl::DecodeResult<Block::GetInfoResponse> Block::InPlace::GetInfo(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) { |
| constexpr uint32_t _write_num_bytes = sizeof(GetInfoRequest); |
| ::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes; |
| ::fidl::BytePart _request_buffer = _write_bytes.view(); |
| _request_buffer.set_actual(_write_num_bytes); |
| ::fidl::DecodedMessage<GetInfoRequest> params(std::move(_request_buffer)); |
| Block::SetTransactionHeaderFor::GetInfoRequest(params); |
| auto _encode_request_result = ::fidl::Encode(std::move(params)); |
| if (_encode_request_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::GetInfoResponse>::FromFailure( |
| std::move(_encode_request_result)); |
| } |
| auto _call_result = ::fidl::Call<GetInfoRequest, GetInfoResponse>( |
| std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer)); |
| if (_call_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::GetInfoResponse>::FromFailure( |
| std::move(_call_result)); |
| } |
| return ::fidl::Decode(std::move(_call_result.message)); |
| } |
| |
| template <> |
| Block::ResultOf::GetStats_Impl<Block::GetStatsResponse>::GetStats_Impl(::zx::unowned_channel _client_end, bool clear) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetStatsRequest, ::fidl::MessageDirection::kSending>(); |
| ::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined; |
| auto& _write_bytes_array = _write_bytes_inlined; |
| uint8_t* _write_bytes = _write_bytes_array.view().data(); |
| memset(_write_bytes, 0, GetStatsRequest::PrimarySize); |
| auto& _request = *reinterpret_cast<GetStatsRequest*>(_write_bytes); |
| _request.clear = std::move(clear); |
| ::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetStatsRequest)); |
| ::fidl::DecodedMessage<GetStatsRequest> _decoded_request(std::move(_request_bytes)); |
| Super::SetResult( |
| Block::InPlace::GetStats(std::move(_client_end), std::move(_decoded_request), Super::response_buffer())); |
| } |
| |
| Block::ResultOf::GetStats Block::SyncClient::GetStats(bool clear) { |
| return ResultOf::GetStats(::zx::unowned_channel(this->channel_), std::move(clear)); |
| } |
| |
| Block::ResultOf::GetStats Block::Call::GetStats(::zx::unowned_channel _client_end, bool clear) { |
| return ResultOf::GetStats(std::move(_client_end), std::move(clear)); |
| } |
| |
| template <> |
| Block::UnownedResultOf::GetStats_Impl<Block::GetStatsResponse>::GetStats_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, bool clear, ::fidl::BytePart _response_buffer) { |
| if (_request_buffer.capacity() < GetStatsRequest::PrimarySize) { |
| Super::SetFailure(::fidl::DecodeResult<GetStatsResponse>(ZX_ERR_BUFFER_TOO_SMALL, ::fidl::internal::kErrorRequestBufferTooSmall)); |
| return; |
| } |
| memset(_request_buffer.data(), 0, GetStatsRequest::PrimarySize); |
| auto& _request = *reinterpret_cast<GetStatsRequest*>(_request_buffer.data()); |
| _request.clear = std::move(clear); |
| _request_buffer.set_actual(sizeof(GetStatsRequest)); |
| ::fidl::DecodedMessage<GetStatsRequest> _decoded_request(std::move(_request_buffer)); |
| Super::SetResult( |
| Block::InPlace::GetStats(std::move(_client_end), std::move(_decoded_request), std::move(_response_buffer))); |
| } |
| |
| Block::UnownedResultOf::GetStats Block::SyncClient::GetStats(::fidl::BytePart _request_buffer, bool clear, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::GetStats(::zx::unowned_channel(this->channel_), std::move(_request_buffer), std::move(clear), std::move(_response_buffer)); |
| } |
| |
| Block::UnownedResultOf::GetStats Block::Call::GetStats(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, bool clear, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::GetStats(std::move(_client_end), std::move(_request_buffer), std::move(clear), std::move(_response_buffer)); |
| } |
| |
| ::fidl::DecodeResult<Block::GetStatsResponse> Block::InPlace::GetStats(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<GetStatsRequest> params, ::fidl::BytePart response_buffer) { |
| Block::SetTransactionHeaderFor::GetStatsRequest(params); |
| auto _encode_request_result = ::fidl::Encode(std::move(params)); |
| if (_encode_request_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::GetStatsResponse>::FromFailure( |
| std::move(_encode_request_result)); |
| } |
| auto _call_result = ::fidl::Call<GetStatsRequest, GetStatsResponse>( |
| std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer)); |
| if (_call_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::GetStatsResponse>::FromFailure( |
| std::move(_call_result)); |
| } |
| return ::fidl::Decode(std::move(_call_result.message)); |
| } |
| |
| template <> |
| Block::ResultOf::GetFifo_Impl<Block::GetFifoResponse>::GetFifo_Impl(::zx::unowned_channel _client_end) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetFifoRequest, ::fidl::MessageDirection::kSending>(); |
| ::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined; |
| auto& _write_bytes_array = _write_bytes_inlined; |
| uint8_t* _write_bytes = _write_bytes_array.view().data(); |
| memset(_write_bytes, 0, GetFifoRequest::PrimarySize); |
| ::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetFifoRequest)); |
| ::fidl::DecodedMessage<GetFifoRequest> _decoded_request(std::move(_request_bytes)); |
| Super::SetResult( |
| Block::InPlace::GetFifo(std::move(_client_end), Super::response_buffer())); |
| } |
| |
| Block::ResultOf::GetFifo Block::SyncClient::GetFifo() { |
| return ResultOf::GetFifo(::zx::unowned_channel(this->channel_)); |
| } |
| |
| Block::ResultOf::GetFifo Block::Call::GetFifo(::zx::unowned_channel _client_end) { |
| return ResultOf::GetFifo(std::move(_client_end)); |
| } |
| |
| template <> |
| Block::UnownedResultOf::GetFifo_Impl<Block::GetFifoResponse>::GetFifo_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(GetFifoRequest)] = {}; |
| ::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes)); |
| memset(_request_buffer.data(), 0, GetFifoRequest::PrimarySize); |
| _request_buffer.set_actual(sizeof(GetFifoRequest)); |
| ::fidl::DecodedMessage<GetFifoRequest> _decoded_request(std::move(_request_buffer)); |
| Super::SetResult( |
| Block::InPlace::GetFifo(std::move(_client_end), std::move(_response_buffer))); |
| } |
| |
| Block::UnownedResultOf::GetFifo Block::SyncClient::GetFifo(::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::GetFifo(::zx::unowned_channel(this->channel_), std::move(_response_buffer)); |
| } |
| |
| Block::UnownedResultOf::GetFifo Block::Call::GetFifo(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::GetFifo(std::move(_client_end), std::move(_response_buffer)); |
| } |
| |
| ::fidl::DecodeResult<Block::GetFifoResponse> Block::InPlace::GetFifo(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) { |
| constexpr uint32_t _write_num_bytes = sizeof(GetFifoRequest); |
| ::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes; |
| ::fidl::BytePart _request_buffer = _write_bytes.view(); |
| _request_buffer.set_actual(_write_num_bytes); |
| ::fidl::DecodedMessage<GetFifoRequest> params(std::move(_request_buffer)); |
| Block::SetTransactionHeaderFor::GetFifoRequest(params); |
| auto _encode_request_result = ::fidl::Encode(std::move(params)); |
| if (_encode_request_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::GetFifoResponse>::FromFailure( |
| std::move(_encode_request_result)); |
| } |
| auto _call_result = ::fidl::Call<GetFifoRequest, GetFifoResponse>( |
| std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer)); |
| if (_call_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::GetFifoResponse>::FromFailure( |
| std::move(_call_result)); |
| } |
| return ::fidl::Decode(std::move(_call_result.message)); |
| } |
| |
| template <> |
| Block::ResultOf::AttachVmo_Impl<Block::AttachVmoResponse>::AttachVmo_Impl(::zx::unowned_channel _client_end, ::zx::vmo vmo) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<AttachVmoRequest, ::fidl::MessageDirection::kSending>(); |
| ::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined; |
| auto& _write_bytes_array = _write_bytes_inlined; |
| uint8_t* _write_bytes = _write_bytes_array.view().data(); |
| memset(_write_bytes, 0, AttachVmoRequest::PrimarySize); |
| auto& _request = *reinterpret_cast<AttachVmoRequest*>(_write_bytes); |
| _request.vmo = std::move(vmo); |
| ::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(AttachVmoRequest)); |
| ::fidl::DecodedMessage<AttachVmoRequest> _decoded_request(std::move(_request_bytes)); |
| Super::SetResult( |
| Block::InPlace::AttachVmo(std::move(_client_end), std::move(_decoded_request), Super::response_buffer())); |
| } |
| |
| Block::ResultOf::AttachVmo Block::SyncClient::AttachVmo(::zx::vmo vmo) { |
| return ResultOf::AttachVmo(::zx::unowned_channel(this->channel_), std::move(vmo)); |
| } |
| |
| Block::ResultOf::AttachVmo Block::Call::AttachVmo(::zx::unowned_channel _client_end, ::zx::vmo vmo) { |
| return ResultOf::AttachVmo(std::move(_client_end), std::move(vmo)); |
| } |
| |
| template <> |
| Block::UnownedResultOf::AttachVmo_Impl<Block::AttachVmoResponse>::AttachVmo_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::vmo vmo, ::fidl::BytePart _response_buffer) { |
| if (_request_buffer.capacity() < AttachVmoRequest::PrimarySize) { |
| Super::SetFailure(::fidl::DecodeResult<AttachVmoResponse>(ZX_ERR_BUFFER_TOO_SMALL, ::fidl::internal::kErrorRequestBufferTooSmall)); |
| return; |
| } |
| memset(_request_buffer.data(), 0, AttachVmoRequest::PrimarySize); |
| auto& _request = *reinterpret_cast<AttachVmoRequest*>(_request_buffer.data()); |
| _request.vmo = std::move(vmo); |
| _request_buffer.set_actual(sizeof(AttachVmoRequest)); |
| ::fidl::DecodedMessage<AttachVmoRequest> _decoded_request(std::move(_request_buffer)); |
| Super::SetResult( |
| Block::InPlace::AttachVmo(std::move(_client_end), std::move(_decoded_request), std::move(_response_buffer))); |
| } |
| |
| Block::UnownedResultOf::AttachVmo Block::SyncClient::AttachVmo(::fidl::BytePart _request_buffer, ::zx::vmo vmo, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::AttachVmo(::zx::unowned_channel(this->channel_), std::move(_request_buffer), std::move(vmo), std::move(_response_buffer)); |
| } |
| |
| Block::UnownedResultOf::AttachVmo Block::Call::AttachVmo(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::vmo vmo, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::AttachVmo(std::move(_client_end), std::move(_request_buffer), std::move(vmo), std::move(_response_buffer)); |
| } |
| |
| ::fidl::DecodeResult<Block::AttachVmoResponse> Block::InPlace::AttachVmo(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<AttachVmoRequest> params, ::fidl::BytePart response_buffer) { |
| Block::SetTransactionHeaderFor::AttachVmoRequest(params); |
| auto _encode_request_result = ::fidl::Encode(std::move(params)); |
| if (_encode_request_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::AttachVmoResponse>::FromFailure( |
| std::move(_encode_request_result)); |
| } |
| auto _call_result = ::fidl::Call<AttachVmoRequest, AttachVmoResponse>( |
| std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer)); |
| if (_call_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::AttachVmoResponse>::FromFailure( |
| std::move(_call_result)); |
| } |
| return ::fidl::Decode(std::move(_call_result.message)); |
| } |
| |
| template <> |
| Block::ResultOf::CloseFifo_Impl<Block::CloseFifoResponse>::CloseFifo_Impl(::zx::unowned_channel _client_end) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<CloseFifoRequest, ::fidl::MessageDirection::kSending>(); |
| ::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined; |
| auto& _write_bytes_array = _write_bytes_inlined; |
| uint8_t* _write_bytes = _write_bytes_array.view().data(); |
| memset(_write_bytes, 0, CloseFifoRequest::PrimarySize); |
| ::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(CloseFifoRequest)); |
| ::fidl::DecodedMessage<CloseFifoRequest> _decoded_request(std::move(_request_bytes)); |
| Super::SetResult( |
| Block::InPlace::CloseFifo(std::move(_client_end), Super::response_buffer())); |
| } |
| |
| Block::ResultOf::CloseFifo Block::SyncClient::CloseFifo() { |
| return ResultOf::CloseFifo(::zx::unowned_channel(this->channel_)); |
| } |
| |
| Block::ResultOf::CloseFifo Block::Call::CloseFifo(::zx::unowned_channel _client_end) { |
| return ResultOf::CloseFifo(std::move(_client_end)); |
| } |
| |
| template <> |
| Block::UnownedResultOf::CloseFifo_Impl<Block::CloseFifoResponse>::CloseFifo_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(CloseFifoRequest)] = {}; |
| ::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes)); |
| memset(_request_buffer.data(), 0, CloseFifoRequest::PrimarySize); |
| _request_buffer.set_actual(sizeof(CloseFifoRequest)); |
| ::fidl::DecodedMessage<CloseFifoRequest> _decoded_request(std::move(_request_buffer)); |
| Super::SetResult( |
| Block::InPlace::CloseFifo(std::move(_client_end), std::move(_response_buffer))); |
| } |
| |
| Block::UnownedResultOf::CloseFifo Block::SyncClient::CloseFifo(::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::CloseFifo(::zx::unowned_channel(this->channel_), std::move(_response_buffer)); |
| } |
| |
| Block::UnownedResultOf::CloseFifo Block::Call::CloseFifo(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::CloseFifo(std::move(_client_end), std::move(_response_buffer)); |
| } |
| |
| ::fidl::DecodeResult<Block::CloseFifoResponse> Block::InPlace::CloseFifo(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) { |
| constexpr uint32_t _write_num_bytes = sizeof(CloseFifoRequest); |
| ::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes; |
| ::fidl::BytePart _request_buffer = _write_bytes.view(); |
| _request_buffer.set_actual(_write_num_bytes); |
| ::fidl::DecodedMessage<CloseFifoRequest> params(std::move(_request_buffer)); |
| Block::SetTransactionHeaderFor::CloseFifoRequest(params); |
| auto _encode_request_result = ::fidl::Encode(std::move(params)); |
| if (_encode_request_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::CloseFifoResponse>::FromFailure( |
| std::move(_encode_request_result)); |
| } |
| auto _call_result = ::fidl::Call<CloseFifoRequest, CloseFifoResponse>( |
| std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer)); |
| if (_call_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::CloseFifoResponse>::FromFailure( |
| std::move(_call_result)); |
| } |
| return ::fidl::Decode(std::move(_call_result.message)); |
| } |
| |
| template <> |
| Block::ResultOf::RebindDevice_Impl<Block::RebindDeviceResponse>::RebindDevice_Impl(::zx::unowned_channel _client_end) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<RebindDeviceRequest, ::fidl::MessageDirection::kSending>(); |
| ::fidl::internal::AlignedBuffer<_kWriteAllocSize> _write_bytes_inlined; |
| auto& _write_bytes_array = _write_bytes_inlined; |
| uint8_t* _write_bytes = _write_bytes_array.view().data(); |
| memset(_write_bytes, 0, RebindDeviceRequest::PrimarySize); |
| ::fidl::BytePart _request_bytes(_write_bytes, _kWriteAllocSize, sizeof(RebindDeviceRequest)); |
| ::fidl::DecodedMessage<RebindDeviceRequest> _decoded_request(std::move(_request_bytes)); |
| Super::SetResult( |
| Block::InPlace::RebindDevice(std::move(_client_end), Super::response_buffer())); |
| } |
| |
| Block::ResultOf::RebindDevice Block::SyncClient::RebindDevice() { |
| return ResultOf::RebindDevice(::zx::unowned_channel(this->channel_)); |
| } |
| |
| Block::ResultOf::RebindDevice Block::Call::RebindDevice(::zx::unowned_channel _client_end) { |
| return ResultOf::RebindDevice(std::move(_client_end)); |
| } |
| |
| template <> |
| Block::UnownedResultOf::RebindDevice_Impl<Block::RebindDeviceResponse>::RebindDevice_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| FIDL_ALIGNDECL uint8_t _write_bytes[sizeof(RebindDeviceRequest)] = {}; |
| ::fidl::BytePart _request_buffer(_write_bytes, sizeof(_write_bytes)); |
| memset(_request_buffer.data(), 0, RebindDeviceRequest::PrimarySize); |
| _request_buffer.set_actual(sizeof(RebindDeviceRequest)); |
| ::fidl::DecodedMessage<RebindDeviceRequest> _decoded_request(std::move(_request_buffer)); |
| Super::SetResult( |
| Block::InPlace::RebindDevice(std::move(_client_end), std::move(_response_buffer))); |
| } |
| |
| Block::UnownedResultOf::RebindDevice Block::SyncClient::RebindDevice(::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::RebindDevice(::zx::unowned_channel(this->channel_), std::move(_response_buffer)); |
| } |
| |
| Block::UnownedResultOf::RebindDevice Block::Call::RebindDevice(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer) { |
| return UnownedResultOf::RebindDevice(std::move(_client_end), std::move(_response_buffer)); |
| } |
| |
| ::fidl::DecodeResult<Block::RebindDeviceResponse> Block::InPlace::RebindDevice(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer) { |
| constexpr uint32_t _write_num_bytes = sizeof(RebindDeviceRequest); |
| ::fidl::internal::AlignedBuffer<_write_num_bytes> _write_bytes; |
| ::fidl::BytePart _request_buffer = _write_bytes.view(); |
| _request_buffer.set_actual(_write_num_bytes); |
| ::fidl::DecodedMessage<RebindDeviceRequest> params(std::move(_request_buffer)); |
| Block::SetTransactionHeaderFor::RebindDeviceRequest(params); |
| auto _encode_request_result = ::fidl::Encode(std::move(params)); |
| if (_encode_request_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::RebindDeviceResponse>::FromFailure( |
| std::move(_encode_request_result)); |
| } |
| auto _call_result = ::fidl::Call<RebindDeviceRequest, RebindDeviceResponse>( |
| std::move(_client_end), std::move(_encode_request_result.message), std::move(response_buffer)); |
| if (_call_result.status != ZX_OK) { |
| return ::fidl::DecodeResult<Block::RebindDeviceResponse>::FromFailure( |
| std::move(_call_result)); |
| } |
| return ::fidl::Decode(std::move(_call_result.message)); |
| } |
| |
| |
| bool Block::TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) { |
| if (msg->num_bytes < sizeof(fidl_message_header_t)) { |
| zx_handle_close_many(msg->handles, msg->num_handles); |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| fidl_message_header_t* hdr = reinterpret_cast<fidl_message_header_t*>(msg->bytes); |
| zx_status_t status = fidl_validate_txn_header(hdr); |
| if (status != ZX_OK) { |
| txn->Close(status); |
| return true; |
| } |
| switch (hdr->ordinal) { |
| case kBlock_GetInfo_Ordinal: |
| case kBlock_GetInfo_GenOrdinal: |
| { |
| auto result = ::fidl::DecodeAs<GetInfoRequest>(msg); |
| if (result.status != ZX_OK) { |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| impl->GetInfo( |
| Interface::GetInfoCompleter::Sync(txn)); |
| return true; |
| } |
| case kBlock_GetStats_Ordinal: |
| case kBlock_GetStats_GenOrdinal: |
| { |
| auto result = ::fidl::DecodeAs<GetStatsRequest>(msg); |
| if (result.status != ZX_OK) { |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| auto message = result.message.message(); |
| impl->GetStats(std::move(message->clear), |
| Interface::GetStatsCompleter::Sync(txn)); |
| return true; |
| } |
| case kBlock_GetFifo_Ordinal: |
| case kBlock_GetFifo_GenOrdinal: |
| { |
| auto result = ::fidl::DecodeAs<GetFifoRequest>(msg); |
| if (result.status != ZX_OK) { |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| impl->GetFifo( |
| Interface::GetFifoCompleter::Sync(txn)); |
| return true; |
| } |
| case kBlock_AttachVmo_Ordinal: |
| case kBlock_AttachVmo_GenOrdinal: |
| { |
| auto result = ::fidl::DecodeAs<AttachVmoRequest>(msg); |
| if (result.status != ZX_OK) { |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| auto message = result.message.message(); |
| impl->AttachVmo(std::move(message->vmo), |
| Interface::AttachVmoCompleter::Sync(txn)); |
| return true; |
| } |
| case kBlock_CloseFifo_Ordinal: |
| case kBlock_CloseFifo_GenOrdinal: |
| { |
| auto result = ::fidl::DecodeAs<CloseFifoRequest>(msg); |
| if (result.status != ZX_OK) { |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| impl->CloseFifo( |
| Interface::CloseFifoCompleter::Sync(txn)); |
| return true; |
| } |
| case kBlock_RebindDevice_Ordinal: |
| case kBlock_RebindDevice_GenOrdinal: |
| { |
| auto result = ::fidl::DecodeAs<RebindDeviceRequest>(msg); |
| if (result.status != ZX_OK) { |
| txn->Close(ZX_ERR_INVALID_ARGS); |
| return true; |
| } |
| impl->RebindDevice( |
| Interface::RebindDeviceCompleter::Sync(txn)); |
| return true; |
| } |
| default: { |
| return false; |
| } |
| } |
| } |
| |
| bool Block::Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) { |
| bool found = TryDispatch(impl, msg, txn); |
| if (!found) { |
| zx_handle_close_many(msg->handles, msg->num_handles); |
| txn->Close(ZX_ERR_NOT_SUPPORTED); |
| } |
| return found; |
| } |
| |
| |
| void Block::Interface::GetInfoCompleterBase::Reply(int32_t status, ::llcpp::fuchsia::hardware::block::BlockInfo* info) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetInfoResponse, ::fidl::MessageDirection::kSending>(); |
| FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize]; |
| GetInfoResponse _response = {}; |
| Block::SetTransactionHeaderFor::GetInfoResponse( |
| ::fidl::DecodedMessage<GetInfoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| GetInfoResponse::PrimarySize, |
| GetInfoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.info = std::move(info); |
| auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes, |
| _kWriteAllocSize)); |
| if (_linearize_result.status != ZX_OK) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| CompleterBase::SendReply(std::move(_linearize_result.message)); |
| } |
| |
| void Block::Interface::GetInfoCompleterBase::Reply(::fidl::BytePart _buffer, int32_t status, ::llcpp::fuchsia::hardware::block::BlockInfo* info) { |
| if (_buffer.capacity() < GetInfoResponse::PrimarySize) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| GetInfoResponse _response = {}; |
| Block::SetTransactionHeaderFor::GetInfoResponse( |
| ::fidl::DecodedMessage<GetInfoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| GetInfoResponse::PrimarySize, |
| GetInfoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.info = std::move(info); |
| auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer)); |
| if (_linearize_result.status != ZX_OK) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| CompleterBase::SendReply(std::move(_linearize_result.message)); |
| } |
| |
| void Block::Interface::GetInfoCompleterBase::Reply(::fidl::DecodedMessage<GetInfoResponse> params) { |
| Block::SetTransactionHeaderFor::GetInfoResponse(params); |
| CompleterBase::SendReply(std::move(params)); |
| } |
| |
| |
| void Block::Interface::GetStatsCompleterBase::Reply(int32_t status, ::llcpp::fuchsia::hardware::block::BlockStats* stats) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetStatsResponse, ::fidl::MessageDirection::kSending>(); |
| std::unique_ptr<uint8_t[]> _write_bytes_unique_ptr(new uint8_t[_kWriteAllocSize]); |
| uint8_t* _write_bytes = _write_bytes_unique_ptr.get(); |
| GetStatsResponse _response = {}; |
| Block::SetTransactionHeaderFor::GetStatsResponse( |
| ::fidl::DecodedMessage<GetStatsResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| GetStatsResponse::PrimarySize, |
| GetStatsResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.stats = std::move(stats); |
| auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes, |
| _kWriteAllocSize)); |
| if (_linearize_result.status != ZX_OK) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| CompleterBase::SendReply(std::move(_linearize_result.message)); |
| } |
| |
| void Block::Interface::GetStatsCompleterBase::Reply(::fidl::BytePart _buffer, int32_t status, ::llcpp::fuchsia::hardware::block::BlockStats* stats) { |
| if (_buffer.capacity() < GetStatsResponse::PrimarySize) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| GetStatsResponse _response = {}; |
| Block::SetTransactionHeaderFor::GetStatsResponse( |
| ::fidl::DecodedMessage<GetStatsResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| GetStatsResponse::PrimarySize, |
| GetStatsResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.stats = std::move(stats); |
| auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer)); |
| if (_linearize_result.status != ZX_OK) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| CompleterBase::SendReply(std::move(_linearize_result.message)); |
| } |
| |
| void Block::Interface::GetStatsCompleterBase::Reply(::fidl::DecodedMessage<GetStatsResponse> params) { |
| Block::SetTransactionHeaderFor::GetStatsResponse(params); |
| CompleterBase::SendReply(std::move(params)); |
| } |
| |
| |
| void Block::Interface::GetFifoCompleterBase::Reply(int32_t status, ::zx::fifo fifo) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<GetFifoResponse, ::fidl::MessageDirection::kSending>(); |
| FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize] = {}; |
| auto& _response = *reinterpret_cast<GetFifoResponse*>(_write_bytes); |
| Block::SetTransactionHeaderFor::GetFifoResponse( |
| ::fidl::DecodedMessage<GetFifoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| GetFifoResponse::PrimarySize, |
| GetFifoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.fifo = std::move(fifo); |
| ::fidl::BytePart _response_bytes(_write_bytes, _kWriteAllocSize, sizeof(GetFifoResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<GetFifoResponse>(std::move(_response_bytes))); |
| } |
| |
| void Block::Interface::GetFifoCompleterBase::Reply(::fidl::BytePart _buffer, int32_t status, ::zx::fifo fifo) { |
| if (_buffer.capacity() < GetFifoResponse::PrimarySize) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| auto& _response = *reinterpret_cast<GetFifoResponse*>(_buffer.data()); |
| Block::SetTransactionHeaderFor::GetFifoResponse( |
| ::fidl::DecodedMessage<GetFifoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| GetFifoResponse::PrimarySize, |
| GetFifoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.fifo = std::move(fifo); |
| _buffer.set_actual(sizeof(GetFifoResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<GetFifoResponse>(std::move(_buffer))); |
| } |
| |
| void Block::Interface::GetFifoCompleterBase::Reply(::fidl::DecodedMessage<GetFifoResponse> params) { |
| Block::SetTransactionHeaderFor::GetFifoResponse(params); |
| CompleterBase::SendReply(std::move(params)); |
| } |
| |
| |
| void Block::Interface::AttachVmoCompleterBase::Reply(int32_t status, ::llcpp::fuchsia::hardware::block::VmoID* vmoid) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<AttachVmoResponse, ::fidl::MessageDirection::kSending>(); |
| FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize]; |
| AttachVmoResponse _response = {}; |
| Block::SetTransactionHeaderFor::AttachVmoResponse( |
| ::fidl::DecodedMessage<AttachVmoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| AttachVmoResponse::PrimarySize, |
| AttachVmoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.vmoid = std::move(vmoid); |
| auto _linearize_result = ::fidl::Linearize(&_response, ::fidl::BytePart(_write_bytes, |
| _kWriteAllocSize)); |
| if (_linearize_result.status != ZX_OK) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| CompleterBase::SendReply(std::move(_linearize_result.message)); |
| } |
| |
| void Block::Interface::AttachVmoCompleterBase::Reply(::fidl::BytePart _buffer, int32_t status, ::llcpp::fuchsia::hardware::block::VmoID* vmoid) { |
| if (_buffer.capacity() < AttachVmoResponse::PrimarySize) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| AttachVmoResponse _response = {}; |
| Block::SetTransactionHeaderFor::AttachVmoResponse( |
| ::fidl::DecodedMessage<AttachVmoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| AttachVmoResponse::PrimarySize, |
| AttachVmoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _response.vmoid = std::move(vmoid); |
| auto _linearize_result = ::fidl::Linearize(&_response, std::move(_buffer)); |
| if (_linearize_result.status != ZX_OK) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| CompleterBase::SendReply(std::move(_linearize_result.message)); |
| } |
| |
| void Block::Interface::AttachVmoCompleterBase::Reply(::fidl::DecodedMessage<AttachVmoResponse> params) { |
| Block::SetTransactionHeaderFor::AttachVmoResponse(params); |
| CompleterBase::SendReply(std::move(params)); |
| } |
| |
| |
| void Block::Interface::CloseFifoCompleterBase::Reply(int32_t status) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<CloseFifoResponse, ::fidl::MessageDirection::kSending>(); |
| FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize] = {}; |
| auto& _response = *reinterpret_cast<CloseFifoResponse*>(_write_bytes); |
| Block::SetTransactionHeaderFor::CloseFifoResponse( |
| ::fidl::DecodedMessage<CloseFifoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| CloseFifoResponse::PrimarySize, |
| CloseFifoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| ::fidl::BytePart _response_bytes(_write_bytes, _kWriteAllocSize, sizeof(CloseFifoResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<CloseFifoResponse>(std::move(_response_bytes))); |
| } |
| |
| void Block::Interface::CloseFifoCompleterBase::Reply(::fidl::BytePart _buffer, int32_t status) { |
| if (_buffer.capacity() < CloseFifoResponse::PrimarySize) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| auto& _response = *reinterpret_cast<CloseFifoResponse*>(_buffer.data()); |
| Block::SetTransactionHeaderFor::CloseFifoResponse( |
| ::fidl::DecodedMessage<CloseFifoResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| CloseFifoResponse::PrimarySize, |
| CloseFifoResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _buffer.set_actual(sizeof(CloseFifoResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<CloseFifoResponse>(std::move(_buffer))); |
| } |
| |
| void Block::Interface::CloseFifoCompleterBase::Reply(::fidl::DecodedMessage<CloseFifoResponse> params) { |
| Block::SetTransactionHeaderFor::CloseFifoResponse(params); |
| CompleterBase::SendReply(std::move(params)); |
| } |
| |
| |
| void Block::Interface::RebindDeviceCompleterBase::Reply(int32_t status) { |
| constexpr uint32_t _kWriteAllocSize = ::fidl::internal::ClampedMessageSize<RebindDeviceResponse, ::fidl::MessageDirection::kSending>(); |
| FIDL_ALIGNDECL uint8_t _write_bytes[_kWriteAllocSize] = {}; |
| auto& _response = *reinterpret_cast<RebindDeviceResponse*>(_write_bytes); |
| Block::SetTransactionHeaderFor::RebindDeviceResponse( |
| ::fidl::DecodedMessage<RebindDeviceResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| RebindDeviceResponse::PrimarySize, |
| RebindDeviceResponse::PrimarySize))); |
| _response.status = std::move(status); |
| ::fidl::BytePart _response_bytes(_write_bytes, _kWriteAllocSize, sizeof(RebindDeviceResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<RebindDeviceResponse>(std::move(_response_bytes))); |
| } |
| |
| void Block::Interface::RebindDeviceCompleterBase::Reply(::fidl::BytePart _buffer, int32_t status) { |
| if (_buffer.capacity() < RebindDeviceResponse::PrimarySize) { |
| CompleterBase::Close(ZX_ERR_INTERNAL); |
| return; |
| } |
| auto& _response = *reinterpret_cast<RebindDeviceResponse*>(_buffer.data()); |
| Block::SetTransactionHeaderFor::RebindDeviceResponse( |
| ::fidl::DecodedMessage<RebindDeviceResponse>( |
| ::fidl::BytePart(reinterpret_cast<uint8_t*>(&_response), |
| RebindDeviceResponse::PrimarySize, |
| RebindDeviceResponse::PrimarySize))); |
| _response.status = std::move(status); |
| _buffer.set_actual(sizeof(RebindDeviceResponse)); |
| CompleterBase::SendReply(::fidl::DecodedMessage<RebindDeviceResponse>(std::move(_buffer))); |
| } |
| |
| void Block::Interface::RebindDeviceCompleterBase::Reply(::fidl::DecodedMessage<RebindDeviceResponse> params) { |
| Block::SetTransactionHeaderFor::RebindDeviceResponse(params); |
| CompleterBase::SendReply(std::move(params)); |
| } |
| |
| |
| |
| void Block::SetTransactionHeaderFor::GetInfoRequest(const ::fidl::DecodedMessage<Block::GetInfoRequest>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_GetInfo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| void Block::SetTransactionHeaderFor::GetInfoResponse(const ::fidl::DecodedMessage<Block::GetInfoResponse>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_GetInfo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| |
| void Block::SetTransactionHeaderFor::GetStatsRequest(const ::fidl::DecodedMessage<Block::GetStatsRequest>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_GetStats_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| void Block::SetTransactionHeaderFor::GetStatsResponse(const ::fidl::DecodedMessage<Block::GetStatsResponse>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_GetStats_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| |
| void Block::SetTransactionHeaderFor::GetFifoRequest(const ::fidl::DecodedMessage<Block::GetFifoRequest>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_GetFifo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| void Block::SetTransactionHeaderFor::GetFifoResponse(const ::fidl::DecodedMessage<Block::GetFifoResponse>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_GetFifo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| |
| void Block::SetTransactionHeaderFor::AttachVmoRequest(const ::fidl::DecodedMessage<Block::AttachVmoRequest>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_AttachVmo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| void Block::SetTransactionHeaderFor::AttachVmoResponse(const ::fidl::DecodedMessage<Block::AttachVmoResponse>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_AttachVmo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| |
| void Block::SetTransactionHeaderFor::CloseFifoRequest(const ::fidl::DecodedMessage<Block::CloseFifoRequest>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_CloseFifo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| void Block::SetTransactionHeaderFor::CloseFifoResponse(const ::fidl::DecodedMessage<Block::CloseFifoResponse>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_CloseFifo_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| |
| void Block::SetTransactionHeaderFor::RebindDeviceRequest(const ::fidl::DecodedMessage<Block::RebindDeviceRequest>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_RebindDevice_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| void Block::SetTransactionHeaderFor::RebindDeviceResponse(const ::fidl::DecodedMessage<Block::RebindDeviceResponse>& _msg) { |
| fidl_init_txn_header(&_msg.message()->_hdr, 0, kBlock_RebindDevice_GenOrdinal); |
| _msg.message()->_hdr.flags[0] |= FIDL_TXN_HEADER_UNION_FROM_XUNION_FLAG; |
| } |
| |
| } // namespace block |
| } // namespace hardware |
| } // namespace fuchsia |
| } // namespace llcpp |