blob: 6bbbf60164f18ddba2949196b32220cac24364f2 [file] [log] [blame]
// 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>
#include <fuchsia/mem/llcpp/fidl.h>
namespace llcpp {
namespace fuchsia {
namespace kernel {
struct PerCpuStats;
struct CpuStats;
class MexecBroker;
class DebugBroker;
class Counter;
struct MemoryStats;
class Stats;
extern "C" const fidl_type_t v1_fuchsia_kernel_PerCpuStatsTable;
struct PerCpuStats final : private ::fidl::VectorView<fidl_envelope_t> {
using EnvelopesView = ::fidl::VectorView<fidl_envelope_t>;
public:
// Returns whether no field is set.
bool IsEmpty() const { return EnvelopesView::empty(); }
const uint32_t& cpu_number() const {
ZX_ASSERT(has_cpu_number());
return *reinterpret_cast<const uint32_t*>(EnvelopesView::at(1 - 1).data);
}
uint32_t& cpu_number() {
ZX_ASSERT(has_cpu_number());
return *reinterpret_cast<uint32_t*>(EnvelopesView::at(1 - 1).data);
}
bool has_cpu_number() const {
return EnvelopesView::count() >= 1 && EnvelopesView::at(1 - 1).data != nullptr;
}
const uint32_t& flags() const {
ZX_ASSERT(has_flags());
return *reinterpret_cast<const uint32_t*>(EnvelopesView::at(2 - 1).data);
}
uint32_t& flags() {
ZX_ASSERT(has_flags());
return *reinterpret_cast<uint32_t*>(EnvelopesView::at(2 - 1).data);
}
bool has_flags() const {
return EnvelopesView::count() >= 2 && EnvelopesView::at(2 - 1).data != nullptr;
}
const int64_t& idle_time() const {
ZX_ASSERT(has_idle_time());
return *reinterpret_cast<const int64_t*>(EnvelopesView::at(3 - 1).data);
}
int64_t& idle_time() {
ZX_ASSERT(has_idle_time());
return *reinterpret_cast<int64_t*>(EnvelopesView::at(3 - 1).data);
}
bool has_idle_time() const {
return EnvelopesView::count() >= 3 && EnvelopesView::at(3 - 1).data != nullptr;
}
const uint64_t& reschedules() const {
ZX_ASSERT(has_reschedules());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(4 - 1).data);
}
uint64_t& reschedules() {
ZX_ASSERT(has_reschedules());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(4 - 1).data);
}
bool has_reschedules() const {
return EnvelopesView::count() >= 4 && EnvelopesView::at(4 - 1).data != nullptr;
}
const uint64_t& context_switches() const {
ZX_ASSERT(has_context_switches());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(5 - 1).data);
}
uint64_t& context_switches() {
ZX_ASSERT(has_context_switches());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(5 - 1).data);
}
bool has_context_switches() const {
return EnvelopesView::count() >= 5 && EnvelopesView::at(5 - 1).data != nullptr;
}
const uint64_t& irq_preempts() const {
ZX_ASSERT(has_irq_preempts());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(6 - 1).data);
}
uint64_t& irq_preempts() {
ZX_ASSERT(has_irq_preempts());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(6 - 1).data);
}
bool has_irq_preempts() const {
return EnvelopesView::count() >= 6 && EnvelopesView::at(6 - 1).data != nullptr;
}
const uint64_t& yields() const {
ZX_ASSERT(has_yields());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(7 - 1).data);
}
uint64_t& yields() {
ZX_ASSERT(has_yields());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(7 - 1).data);
}
bool has_yields() const {
return EnvelopesView::count() >= 7 && EnvelopesView::at(7 - 1).data != nullptr;
}
const uint64_t& ints() const {
ZX_ASSERT(has_ints());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(8 - 1).data);
}
uint64_t& ints() {
ZX_ASSERT(has_ints());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(8 - 1).data);
}
bool has_ints() const {
return EnvelopesView::count() >= 8 && EnvelopesView::at(8 - 1).data != nullptr;
}
const uint64_t& timer_ints() const {
ZX_ASSERT(has_timer_ints());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(9 - 1).data);
}
uint64_t& timer_ints() {
ZX_ASSERT(has_timer_ints());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(9 - 1).data);
}
bool has_timer_ints() const {
return EnvelopesView::count() >= 9 && EnvelopesView::at(9 - 1).data != nullptr;
}
const uint64_t& timers() const {
ZX_ASSERT(has_timers());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(10 - 1).data);
}
uint64_t& timers() {
ZX_ASSERT(has_timers());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(10 - 1).data);
}
bool has_timers() const {
return EnvelopesView::count() >= 10 && EnvelopesView::at(10 - 1).data != nullptr;
}
const uint64_t& page_faults() const {
ZX_ASSERT(has_page_faults());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(11 - 1).data);
}
uint64_t& page_faults() {
ZX_ASSERT(has_page_faults());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(11 - 1).data);
}
bool has_page_faults() const {
return EnvelopesView::count() >= 11 && EnvelopesView::at(11 - 1).data != nullptr;
}
const uint64_t& exceptions() const {
ZX_ASSERT(has_exceptions());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(12 - 1).data);
}
uint64_t& exceptions() {
ZX_ASSERT(has_exceptions());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(12 - 1).data);
}
bool has_exceptions() const {
return EnvelopesView::count() >= 12 && EnvelopesView::at(12 - 1).data != nullptr;
}
const uint64_t& syscalls() const {
ZX_ASSERT(has_syscalls());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(13 - 1).data);
}
uint64_t& syscalls() {
ZX_ASSERT(has_syscalls());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(13 - 1).data);
}
bool has_syscalls() const {
return EnvelopesView::count() >= 13 && EnvelopesView::at(13 - 1).data != nullptr;
}
const uint64_t& reschedule_ipis() const {
ZX_ASSERT(has_reschedule_ipis());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(14 - 1).data);
}
uint64_t& reschedule_ipis() {
ZX_ASSERT(has_reschedule_ipis());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(14 - 1).data);
}
bool has_reschedule_ipis() const {
return EnvelopesView::count() >= 14 && EnvelopesView::at(14 - 1).data != nullptr;
}
const uint64_t& generic_ipis() const {
ZX_ASSERT(has_generic_ipis());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(15 - 1).data);
}
uint64_t& generic_ipis() {
ZX_ASSERT(has_generic_ipis());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(15 - 1).data);
}
bool has_generic_ipis() const {
return EnvelopesView::count() >= 15 && EnvelopesView::at(15 - 1).data != nullptr;
}
PerCpuStats() = default;
~PerCpuStats() = default;
PerCpuStats(PerCpuStats&& other) noexcept = default;
PerCpuStats& operator=(PerCpuStats&& other) noexcept = default;
class Builder;
friend class Builder;
static Builder Build();
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_PerCpuStatsTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 16;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 360;
static constexpr bool HasPointer = true;
private:
PerCpuStats(uint64_t max_ordinal, fidl_envelope_t* data) : EnvelopesView(data, max_ordinal) {}
};
class PerCpuStats::Builder {
public:
PerCpuStats view() { return PerCpuStats(max_ordinal_, envelopes_.data_); }
~Builder() = default;
Builder(Builder&& other) noexcept = default;
Builder& operator=(Builder&& other) noexcept = default;
Builder&& set_cpu_number(uint32_t* elem);
Builder&& set_flags(uint32_t* elem);
Builder&& set_idle_time(int64_t* elem);
Builder&& set_reschedules(uint64_t* elem);
Builder&& set_context_switches(uint64_t* elem);
Builder&& set_irq_preempts(uint64_t* elem);
Builder&& set_yields(uint64_t* elem);
Builder&& set_ints(uint64_t* elem);
Builder&& set_timer_ints(uint64_t* elem);
Builder&& set_timers(uint64_t* elem);
Builder&& set_page_faults(uint64_t* elem);
Builder&& set_exceptions(uint64_t* elem);
Builder&& set_syscalls(uint64_t* elem);
Builder&& set_reschedule_ipis(uint64_t* elem);
Builder&& set_generic_ipis(uint64_t* elem);
private:
Builder() = default;
friend Builder PerCpuStats::Build();
uint64_t max_ordinal_ = 0;
::fidl::Array<fidl_envelope_t, 15> envelopes_ = {};
};
extern "C" const fidl_type_t v1_fuchsia_kernel_MemoryStatsTable;
struct MemoryStats final : private ::fidl::VectorView<fidl_envelope_t> {
using EnvelopesView = ::fidl::VectorView<fidl_envelope_t>;
public:
// Returns whether no field is set.
bool IsEmpty() const { return EnvelopesView::empty(); }
const uint64_t& total_bytes() const {
ZX_ASSERT(has_total_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(1 - 1).data);
}
uint64_t& total_bytes() {
ZX_ASSERT(has_total_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(1 - 1).data);
}
bool has_total_bytes() const {
return EnvelopesView::count() >= 1 && EnvelopesView::at(1 - 1).data != nullptr;
}
const uint64_t& free_bytes() const {
ZX_ASSERT(has_free_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(2 - 1).data);
}
uint64_t& free_bytes() {
ZX_ASSERT(has_free_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(2 - 1).data);
}
bool has_free_bytes() const {
return EnvelopesView::count() >= 2 && EnvelopesView::at(2 - 1).data != nullptr;
}
const uint64_t& wired_bytes() const {
ZX_ASSERT(has_wired_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(3 - 1).data);
}
uint64_t& wired_bytes() {
ZX_ASSERT(has_wired_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(3 - 1).data);
}
bool has_wired_bytes() const {
return EnvelopesView::count() >= 3 && EnvelopesView::at(3 - 1).data != nullptr;
}
const uint64_t& total_heap_bytes() const {
ZX_ASSERT(has_total_heap_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(4 - 1).data);
}
uint64_t& total_heap_bytes() {
ZX_ASSERT(has_total_heap_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(4 - 1).data);
}
bool has_total_heap_bytes() const {
return EnvelopesView::count() >= 4 && EnvelopesView::at(4 - 1).data != nullptr;
}
const uint64_t& free_heap_bytes() const {
ZX_ASSERT(has_free_heap_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(5 - 1).data);
}
uint64_t& free_heap_bytes() {
ZX_ASSERT(has_free_heap_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(5 - 1).data);
}
bool has_free_heap_bytes() const {
return EnvelopesView::count() >= 5 && EnvelopesView::at(5 - 1).data != nullptr;
}
const uint64_t& vmo_bytes() const {
ZX_ASSERT(has_vmo_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(6 - 1).data);
}
uint64_t& vmo_bytes() {
ZX_ASSERT(has_vmo_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(6 - 1).data);
}
bool has_vmo_bytes() const {
return EnvelopesView::count() >= 6 && EnvelopesView::at(6 - 1).data != nullptr;
}
const uint64_t& mmu_overhead_bytes() const {
ZX_ASSERT(has_mmu_overhead_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(7 - 1).data);
}
uint64_t& mmu_overhead_bytes() {
ZX_ASSERT(has_mmu_overhead_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(7 - 1).data);
}
bool has_mmu_overhead_bytes() const {
return EnvelopesView::count() >= 7 && EnvelopesView::at(7 - 1).data != nullptr;
}
const uint64_t& ipc_bytes() const {
ZX_ASSERT(has_ipc_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(8 - 1).data);
}
uint64_t& ipc_bytes() {
ZX_ASSERT(has_ipc_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(8 - 1).data);
}
bool has_ipc_bytes() const {
return EnvelopesView::count() >= 8 && EnvelopesView::at(8 - 1).data != nullptr;
}
const uint64_t& other_bytes() const {
ZX_ASSERT(has_other_bytes());
return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(9 - 1).data);
}
uint64_t& other_bytes() {
ZX_ASSERT(has_other_bytes());
return *reinterpret_cast<uint64_t*>(EnvelopesView::at(9 - 1).data);
}
bool has_other_bytes() const {
return EnvelopesView::count() >= 9 && EnvelopesView::at(9 - 1).data != nullptr;
}
MemoryStats() = default;
~MemoryStats() = default;
MemoryStats(MemoryStats&& other) noexcept = default;
MemoryStats& operator=(MemoryStats&& other) noexcept = default;
class Builder;
friend class Builder;
static Builder Build();
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_MemoryStatsTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 16;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 216;
static constexpr bool HasPointer = true;
private:
MemoryStats(uint64_t max_ordinal, fidl_envelope_t* data) : EnvelopesView(data, max_ordinal) {}
};
class MemoryStats::Builder {
public:
MemoryStats view() { return MemoryStats(max_ordinal_, envelopes_.data_); }
~Builder() = default;
Builder(Builder&& other) noexcept = default;
Builder& operator=(Builder&& other) noexcept = default;
Builder&& set_total_bytes(uint64_t* elem);
Builder&& set_free_bytes(uint64_t* elem);
Builder&& set_wired_bytes(uint64_t* elem);
Builder&& set_total_heap_bytes(uint64_t* elem);
Builder&& set_free_heap_bytes(uint64_t* elem);
Builder&& set_vmo_bytes(uint64_t* elem);
Builder&& set_mmu_overhead_bytes(uint64_t* elem);
Builder&& set_ipc_bytes(uint64_t* elem);
Builder&& set_other_bytes(uint64_t* elem);
private:
Builder() = default;
friend Builder MemoryStats::Build();
uint64_t max_ordinal_ = 0;
::fidl::Array<fidl_envelope_t, 9> envelopes_ = {};
};
extern "C" const fidl_type_t v1_fuchsia_kernel_CpuStatsTable;
struct CpuStats {
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_CpuStatsTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 192512;
static constexpr bool HasPointer = true;
uint64_t actual_num_cpus = {};
::fidl::VectorView<::llcpp::fuchsia::kernel::PerCpuStats> per_cpu_stats = {};
};
extern "C" const fidl_type_t v1_fuchsia_kernel_MexecBrokerPerformMexecRequestTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_MexecBrokerPerformMexecResponseTable;
// Acts on behalf of the caller to interact with privileged mexec system call.
class MexecBroker final {
MexecBroker() = delete;
public:
static constexpr char Name[] = "fuchsia.kernel.MexecBroker";
struct PerformMexecRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::zx::vmo kernel;
::zx::vmo bootdata;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_MexecBrokerPerformMexecRequestTable;
static constexpr uint32_t MaxNumHandles = 2;
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;
};
// Collection of return types of FIDL calls in this interface.
class ResultOf final {
ResultOf() = delete;
private:
class PerformMexec_Impl final : private ::fidl::internal::StatusAndError {
using Super = ::fidl::internal::StatusAndError;
public:
PerformMexec_Impl(::zx::unowned_channel _client_end, ::zx::vmo kernel, ::zx::vmo bootdata);
~PerformMexec_Impl() = default;
PerformMexec_Impl(PerformMexec_Impl&& other) = default;
PerformMexec_Impl& operator=(PerformMexec_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
};
public:
using PerformMexec = PerformMexec_Impl;
};
// 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:
class PerformMexec_Impl final : private ::fidl::internal::StatusAndError {
using Super = ::fidl::internal::StatusAndError;
public:
PerformMexec_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::vmo kernel, ::zx::vmo bootdata);
~PerformMexec_Impl() = default;
PerformMexec_Impl(PerformMexec_Impl&& other) = default;
PerformMexec_Impl& operator=(PerformMexec_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
};
public:
using PerformMexec = PerformMexec_Impl;
};
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_; }
// Perform an mexec with the given kernel and bootdata.
// See ZX-2069 for the thoughts on deprecating mexec.
// Allocates 24 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::PerformMexec PerformMexec(::zx::vmo kernel, ::zx::vmo bootdata);
// Perform an mexec with the given kernel and bootdata.
// See ZX-2069 for the thoughts on deprecating mexec.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::PerformMexec PerformMexec(::fidl::BytePart _request_buffer, ::zx::vmo kernel, ::zx::vmo bootdata);
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:
// Perform an mexec with the given kernel and bootdata.
// See ZX-2069 for the thoughts on deprecating mexec.
// Allocates 24 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::PerformMexec PerformMexec(::zx::unowned_channel _client_end, ::zx::vmo kernel, ::zx::vmo bootdata);
// Perform an mexec with the given kernel and bootdata.
// See ZX-2069 for the thoughts on deprecating mexec.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::PerformMexec PerformMexec(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::vmo kernel, ::zx::vmo bootdata);
};
// 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:
// Perform an mexec with the given kernel and bootdata.
// See ZX-2069 for the thoughts on deprecating mexec.
static ::fidl::internal::StatusAndError PerformMexec(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<PerformMexecRequest> params);
};
// Pure-virtual interface to be implemented by a server.
class Interface {
public:
Interface() = default;
virtual ~Interface() = default;
using _Outer = MexecBroker;
using _Base = ::fidl::CompleterBase;
using PerformMexecCompleter = ::fidl::Completer<>;
virtual void PerformMexec(::zx::vmo kernel, ::zx::vmo bootdata, PerformMexecCompleter::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 PerformMexecRequest(const ::fidl::DecodedMessage<MexecBroker::PerformMexecRequest>& _msg);
};
};
extern "C" const fidl_type_t v1_fuchsia_kernel_DebugBrokerSendDebugCommandRequestTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_DebugBrokerSendDebugCommandResponseTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_DebugBrokerSetTracingEnabledRequestTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_DebugBrokerSetTracingEnabledResponseTable;
// Acts on behalf of the caller to interact with privileged debug system calls.
class DebugBroker final {
DebugBroker() = delete;
public:
static constexpr char Name[] = "fuchsia.kernel.DebugBroker";
struct SendDebugCommandResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
int32_t status;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_DebugBrokerSendDebugCommandResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
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 SendDebugCommandRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::fidl::StringView command;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_DebugBrokerSendDebugCommandRequestTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 32;
static constexpr uint32_t MaxOutOfLine = 1024;
static constexpr uint32_t AltPrimarySize = 32;
static constexpr uint32_t AltMaxOutOfLine = 1024;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
using ResponseType = SendDebugCommandResponse;
};
struct SetTracingEnabledResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
int32_t status;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_DebugBrokerSetTracingEnabledResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
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 SetTracingEnabledRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
bool enabled;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_DebugBrokerSetTracingEnabledRequestTable;
static constexpr uint32_t MaxNumHandles = 0;
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 = SetTracingEnabledResponse;
};
// Collection of return types of FIDL calls in this interface.
class ResultOf final {
ResultOf() = delete;
private:
template <typename ResponseType>
class SendDebugCommand_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
SendDebugCommand_Impl(::zx::unowned_channel _client_end, ::fidl::StringView command);
~SendDebugCommand_Impl() = default;
SendDebugCommand_Impl(SendDebugCommand_Impl&& other) = default;
SendDebugCommand_Impl& operator=(SendDebugCommand_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class SetTracingEnabled_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
SetTracingEnabled_Impl(::zx::unowned_channel _client_end, bool enabled);
~SetTracingEnabled_Impl() = default;
SetTracingEnabled_Impl(SetTracingEnabled_Impl&& other) = default;
SetTracingEnabled_Impl& operator=(SetTracingEnabled_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 SendDebugCommand = SendDebugCommand_Impl<SendDebugCommandResponse>;
using SetTracingEnabled = SetTracingEnabled_Impl<SetTracingEnabledResponse>;
};
// 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 SendDebugCommand_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
SendDebugCommand_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::fidl::StringView command, ::fidl::BytePart _response_buffer);
~SendDebugCommand_Impl() = default;
SendDebugCommand_Impl(SendDebugCommand_Impl&& other) = default;
SendDebugCommand_Impl& operator=(SendDebugCommand_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class SetTracingEnabled_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
SetTracingEnabled_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, bool enabled, ::fidl::BytePart _response_buffer);
~SetTracingEnabled_Impl() = default;
SetTracingEnabled_Impl(SetTracingEnabled_Impl&& other) = default;
SetTracingEnabled_Impl& operator=(SetTracingEnabled_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 SendDebugCommand = SendDebugCommand_Impl<SendDebugCommandResponse>;
using SetTracingEnabled = SetTracingEnabled_Impl<SetTracingEnabledResponse>;
};
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_; }
// Pass debug command through to the kernel shell.
// Look at zx_debug_send_command syscall handling to find valid values.
// Allocates 24 bytes of response buffer on the stack. Request is heap-allocated.
ResultOf::SendDebugCommand SendDebugCommand(::fidl::StringView command);
// Pass debug command through to the kernel shell.
// Look at zx_debug_send_command syscall handling to find valid values.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::SendDebugCommand SendDebugCommand(::fidl::BytePart _request_buffer, ::fidl::StringView command, ::fidl::BytePart _response_buffer);
// Sets whether kernel tracing (ktrace) is enabled or disabled.
// Allocates 48 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::SetTracingEnabled SetTracingEnabled(bool enabled);
// Sets whether kernel tracing (ktrace) is enabled or disabled.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::SetTracingEnabled SetTracingEnabled(::fidl::BytePart _request_buffer, bool enabled, ::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:
// Pass debug command through to the kernel shell.
// Look at zx_debug_send_command syscall handling to find valid values.
// Allocates 24 bytes of response buffer on the stack. Request is heap-allocated.
static ResultOf::SendDebugCommand SendDebugCommand(::zx::unowned_channel _client_end, ::fidl::StringView command);
// Pass debug command through to the kernel shell.
// Look at zx_debug_send_command syscall handling to find valid values.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::SendDebugCommand SendDebugCommand(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::fidl::StringView command, ::fidl::BytePart _response_buffer);
// Sets whether kernel tracing (ktrace) is enabled or disabled.
// Allocates 48 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::SetTracingEnabled SetTracingEnabled(::zx::unowned_channel _client_end, bool enabled);
// Sets whether kernel tracing (ktrace) is enabled or disabled.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::SetTracingEnabled SetTracingEnabled(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, bool enabled, ::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:
// Pass debug command through to the kernel shell.
// Look at zx_debug_send_command syscall handling to find valid values.
static ::fidl::DecodeResult<SendDebugCommandResponse> SendDebugCommand(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<SendDebugCommandRequest> params, ::fidl::BytePart response_buffer);
// Sets whether kernel tracing (ktrace) is enabled or disabled.
static ::fidl::DecodeResult<SetTracingEnabledResponse> SetTracingEnabled(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<SetTracingEnabledRequest> params, ::fidl::BytePart response_buffer);
};
// Pure-virtual interface to be implemented by a server.
class Interface {
public:
Interface() = default;
virtual ~Interface() = default;
using _Outer = DebugBroker;
using _Base = ::fidl::CompleterBase;
class SendDebugCommandCompleterBase : public _Base {
public:
void Reply(int32_t status);
void Reply(::fidl::BytePart _buffer, int32_t status);
void Reply(::fidl::DecodedMessage<SendDebugCommandResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using SendDebugCommandCompleter = ::fidl::Completer<SendDebugCommandCompleterBase>;
virtual void SendDebugCommand(::fidl::StringView command, SendDebugCommandCompleter::Sync _completer) = 0;
class SetTracingEnabledCompleterBase : public _Base {
public:
void Reply(int32_t status);
void Reply(::fidl::BytePart _buffer, int32_t status);
void Reply(::fidl::DecodedMessage<SetTracingEnabledResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using SetTracingEnabledCompleter = ::fidl::Completer<SetTracingEnabledCompleterBase>;
virtual void SetTracingEnabled(bool enabled, SetTracingEnabledCompleter::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 SendDebugCommandRequest(const ::fidl::DecodedMessage<DebugBroker::SendDebugCommandRequest>& _msg);
static void SendDebugCommandResponse(const ::fidl::DecodedMessage<DebugBroker::SendDebugCommandResponse>& _msg);
static void SetTracingEnabledRequest(const ::fidl::DecodedMessage<DebugBroker::SetTracingEnabledRequest>& _msg);
static void SetTracingEnabledResponse(const ::fidl::DecodedMessage<DebugBroker::SetTracingEnabledResponse>& _msg);
};
};
extern "C" const fidl_type_t v1_fuchsia_kernel_CounterGetInspectVmoRequestTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_CounterGetInspectVmoResponseTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_CounterUpdateInspectVmoRequestTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_CounterUpdateInspectVmoResponseTable;
// Protocol for retrieving kcounter information.
class Counter final {
Counter() = delete;
public:
static constexpr char Name[] = "fuchsia.kernel.Counter";
struct GetInspectVmoResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
int32_t status;
::llcpp::fuchsia::mem::Buffer buffer;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_CounterGetInspectVmoResponseTable;
static constexpr uint32_t MaxNumHandles = 1;
static constexpr uint32_t PrimarySize = 40;
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;
};
using GetInspectVmoRequest = ::fidl::AnyZeroArgMessage;
struct UpdateInspectVmoResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
int32_t status;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_CounterUpdateInspectVmoResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
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;
};
using UpdateInspectVmoRequest = ::fidl::AnyZeroArgMessage;
// Collection of return types of FIDL calls in this interface.
class ResultOf final {
ResultOf() = delete;
private:
template <typename ResponseType>
class GetInspectVmo_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
GetInspectVmo_Impl(::zx::unowned_channel _client_end);
~GetInspectVmo_Impl() = default;
GetInspectVmo_Impl(GetInspectVmo_Impl&& other) = default;
GetInspectVmo_Impl& operator=(GetInspectVmo_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class UpdateInspectVmo_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
UpdateInspectVmo_Impl(::zx::unowned_channel _client_end);
~UpdateInspectVmo_Impl() = default;
UpdateInspectVmo_Impl(UpdateInspectVmo_Impl&& other) = default;
UpdateInspectVmo_Impl& operator=(UpdateInspectVmo_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 GetInspectVmo = GetInspectVmo_Impl<GetInspectVmoResponse>;
using UpdateInspectVmo = UpdateInspectVmo_Impl<UpdateInspectVmoResponse>;
};
// 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 GetInspectVmo_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
GetInspectVmo_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
~GetInspectVmo_Impl() = default;
GetInspectVmo_Impl(GetInspectVmo_Impl&& other) = default;
GetInspectVmo_Impl& operator=(GetInspectVmo_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class UpdateInspectVmo_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
UpdateInspectVmo_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
~UpdateInspectVmo_Impl() = default;
UpdateInspectVmo_Impl(UpdateInspectVmo_Impl&& other) = default;
UpdateInspectVmo_Impl& operator=(UpdateInspectVmo_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 GetInspectVmo = GetInspectVmo_Impl<GetInspectVmoResponse>;
using UpdateInspectVmo = UpdateInspectVmo_Impl<UpdateInspectVmoResponse>;
};
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_; }
// Retrives a VMO containining summarized kcounter data. The vmo returned
// in |buffer| is in "inspect-vmo" format, documented elsewhere.
// Allocates 56 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::GetInspectVmo GetInspectVmo();
// Retrives a VMO containining summarized kcounter data. The vmo returned
// in |buffer| is in "inspect-vmo" format, documented elsewhere.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::GetInspectVmo GetInspectVmo(::fidl::BytePart _response_buffer);
// Request that the previously-returned VMO buffer's data be updated. The
// data may not be updated if it was already recently updated (updates are
// limited to an unspecified rate, but approximately every few seconds).
// Allocates 40 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::UpdateInspectVmo UpdateInspectVmo();
// Request that the previously-returned VMO buffer's data be updated. The
// data may not be updated if it was already recently updated (updates are
// limited to an unspecified rate, but approximately every few seconds).
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::UpdateInspectVmo UpdateInspectVmo(::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:
// Retrives a VMO containining summarized kcounter data. The vmo returned
// in |buffer| is in "inspect-vmo" format, documented elsewhere.
// Allocates 56 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::GetInspectVmo GetInspectVmo(::zx::unowned_channel _client_end);
// Retrives a VMO containining summarized kcounter data. The vmo returned
// in |buffer| is in "inspect-vmo" format, documented elsewhere.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::GetInspectVmo GetInspectVmo(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
// Request that the previously-returned VMO buffer's data be updated. The
// data may not be updated if it was already recently updated (updates are
// limited to an unspecified rate, but approximately every few seconds).
// Allocates 40 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::UpdateInspectVmo UpdateInspectVmo(::zx::unowned_channel _client_end);
// Request that the previously-returned VMO buffer's data be updated. The
// data may not be updated if it was already recently updated (updates are
// limited to an unspecified rate, but approximately every few seconds).
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::UpdateInspectVmo UpdateInspectVmo(::zx::unowned_channel _client_end, ::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:
// Retrives a VMO containining summarized kcounter data. The vmo returned
// in |buffer| is in "inspect-vmo" format, documented elsewhere.
static ::fidl::DecodeResult<GetInspectVmoResponse> GetInspectVmo(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer);
// Request that the previously-returned VMO buffer's data be updated. The
// data may not be updated if it was already recently updated (updates are
// limited to an unspecified rate, but approximately every few seconds).
static ::fidl::DecodeResult<UpdateInspectVmoResponse> UpdateInspectVmo(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer);
};
// Pure-virtual interface to be implemented by a server.
class Interface {
public:
Interface() = default;
virtual ~Interface() = default;
using _Outer = Counter;
using _Base = ::fidl::CompleterBase;
class GetInspectVmoCompleterBase : public _Base {
public:
void Reply(int32_t status, ::llcpp::fuchsia::mem::Buffer buffer);
void Reply(::fidl::BytePart _buffer, int32_t status, ::llcpp::fuchsia::mem::Buffer buffer);
void Reply(::fidl::DecodedMessage<GetInspectVmoResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using GetInspectVmoCompleter = ::fidl::Completer<GetInspectVmoCompleterBase>;
virtual void GetInspectVmo(GetInspectVmoCompleter::Sync _completer) = 0;
class UpdateInspectVmoCompleterBase : public _Base {
public:
void Reply(int32_t status);
void Reply(::fidl::BytePart _buffer, int32_t status);
void Reply(::fidl::DecodedMessage<UpdateInspectVmoResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using UpdateInspectVmoCompleter = ::fidl::Completer<UpdateInspectVmoCompleterBase>;
virtual void UpdateInspectVmo(UpdateInspectVmoCompleter::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 GetInspectVmoRequest(const ::fidl::DecodedMessage<Counter::GetInspectVmoRequest>& _msg);
static void GetInspectVmoResponse(const ::fidl::DecodedMessage<Counter::GetInspectVmoResponse>& _msg);
static void UpdateInspectVmoRequest(const ::fidl::DecodedMessage<Counter::UpdateInspectVmoRequest>& _msg);
static void UpdateInspectVmoResponse(const ::fidl::DecodedMessage<Counter::UpdateInspectVmoResponse>& _msg);
};
};
extern "C" const fidl_type_t v1_fuchsia_kernel_StatsGetMemoryStatsRequestTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_StatsGetMemoryStatsResponseTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_StatsGetCpuStatsRequestTable;
extern "C" const fidl_type_t v1_fuchsia_kernel_StatsGetCpuStatsResponseTable;
// Protocol for providing kernel stats. This is roughly a wrapper around zx_object_get_info for
// the ZX_INFO_KMEM_STATS and ZX_INFO_CPU_STATS topics, which today require the very powerful
// 'Root Resource' capability to obtain. Instead of vending out that capability, programs that
// just want stats should use this service instead. If for some reason the protocol fails to
// retrieve stats, which will be an un-recoverable error, it will close the channel.
class Stats final {
Stats() = delete;
public:
static constexpr char Name[] = "fuchsia.kernel.Stats";
struct GetMemoryStatsResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::llcpp::fuchsia::kernel::MemoryStats stats;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_StatsGetMemoryStatsResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 32;
static constexpr uint32_t MaxOutOfLine = 216;
static constexpr bool HasFlexibleEnvelope = true;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
using GetMemoryStatsRequest = ::fidl::AnyZeroArgMessage;
struct GetCpuStatsResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::llcpp::fuchsia::kernel::CpuStats stats;
static constexpr const fidl_type_t* Type = &v1_fuchsia_kernel_StatsGetCpuStatsResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 40;
static constexpr uint32_t MaxOutOfLine = 192512;
static constexpr bool HasFlexibleEnvelope = true;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
using GetCpuStatsRequest = ::fidl::AnyZeroArgMessage;
// Collection of return types of FIDL calls in this interface.
class ResultOf final {
ResultOf() = delete;
private:
template <typename ResponseType>
class GetMemoryStats_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
GetMemoryStats_Impl(::zx::unowned_channel _client_end);
~GetMemoryStats_Impl() = default;
GetMemoryStats_Impl(GetMemoryStats_Impl&& other) = default;
GetMemoryStats_Impl& operator=(GetMemoryStats_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class GetCpuStats_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
GetCpuStats_Impl(::zx::unowned_channel _client_end);
~GetCpuStats_Impl() = default;
GetCpuStats_Impl(GetCpuStats_Impl&& other) = default;
GetCpuStats_Impl& operator=(GetCpuStats_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 GetMemoryStats = GetMemoryStats_Impl<GetMemoryStatsResponse>;
using GetCpuStats = GetCpuStats_Impl<GetCpuStatsResponse>;
};
// 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 GetMemoryStats_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
GetMemoryStats_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
~GetMemoryStats_Impl() = default;
GetMemoryStats_Impl(GetMemoryStats_Impl&& other) = default;
GetMemoryStats_Impl& operator=(GetMemoryStats_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class GetCpuStats_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
GetCpuStats_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
~GetCpuStats_Impl() = default;
GetCpuStats_Impl(GetCpuStats_Impl&& other) = default;
GetCpuStats_Impl& operator=(GetCpuStats_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 GetMemoryStats = GetMemoryStats_Impl<GetMemoryStatsResponse>;
using GetCpuStats = GetCpuStats_Impl<GetCpuStatsResponse>;
};
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_; }
// Allocates 16 bytes of request buffer on the stack. Response is heap-allocated.
ResultOf::GetMemoryStats GetMemoryStats();
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::GetMemoryStats GetMemoryStats(::fidl::BytePart _response_buffer);
// Allocates 16 bytes of request buffer on the stack. Response is heap-allocated.
ResultOf::GetCpuStats GetCpuStats();
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::GetCpuStats GetCpuStats(::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:
// Allocates 16 bytes of request buffer on the stack. Response is heap-allocated.
static ResultOf::GetMemoryStats GetMemoryStats(::zx::unowned_channel _client_end);
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::GetMemoryStats GetMemoryStats(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
// Allocates 16 bytes of request buffer on the stack. Response is heap-allocated.
static ResultOf::GetCpuStats GetCpuStats(::zx::unowned_channel _client_end);
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::GetCpuStats GetCpuStats(::zx::unowned_channel _client_end, ::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:
static ::fidl::DecodeResult<GetMemoryStatsResponse> GetMemoryStats(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer);
static ::fidl::DecodeResult<GetCpuStatsResponse> GetCpuStats(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer);
};
// Pure-virtual interface to be implemented by a server.
class Interface {
public:
Interface() = default;
virtual ~Interface() = default;
using _Outer = Stats;
using _Base = ::fidl::CompleterBase;
class GetMemoryStatsCompleterBase : public _Base {
public:
void Reply(::llcpp::fuchsia::kernel::MemoryStats stats);
void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::kernel::MemoryStats stats);
void Reply(::fidl::DecodedMessage<GetMemoryStatsResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using GetMemoryStatsCompleter = ::fidl::Completer<GetMemoryStatsCompleterBase>;
virtual void GetMemoryStats(GetMemoryStatsCompleter::Sync _completer) = 0;
class GetCpuStatsCompleterBase : public _Base {
public:
void Reply(::llcpp::fuchsia::kernel::CpuStats stats);
void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::kernel::CpuStats stats);
void Reply(::fidl::DecodedMessage<GetCpuStatsResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using GetCpuStatsCompleter = ::fidl::Completer<GetCpuStatsCompleterBase>;
virtual void GetCpuStats(GetCpuStatsCompleter::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 GetMemoryStatsRequest(const ::fidl::DecodedMessage<Stats::GetMemoryStatsRequest>& _msg);
static void GetMemoryStatsResponse(const ::fidl::DecodedMessage<Stats::GetMemoryStatsResponse>& _msg);
static void GetCpuStatsRequest(const ::fidl::DecodedMessage<Stats::GetCpuStatsRequest>& _msg);
static void GetCpuStatsResponse(const ::fidl::DecodedMessage<Stats::GetCpuStatsResponse>& _msg);
};
};
// Maximum number of bytes in a command string
constexpr uint32_t DEBUG_COMMAND_MAX = 1024u;
} // namespace kernel
} // namespace fuchsia
} // namespace llcpp
namespace fidl {
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::PerCpuStats> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::kernel::PerCpuStats>);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::CpuStats> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::kernel::CpuStats>);
static_assert(offsetof(::llcpp::fuchsia::kernel::CpuStats, actual_num_cpus) == 0);
static_assert(offsetof(::llcpp::fuchsia::kernel::CpuStats, per_cpu_stats) == 8);
static_assert(sizeof(::llcpp::fuchsia::kernel::CpuStats) == ::llcpp::fuchsia::kernel::CpuStats::PrimarySize);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::MexecBroker::PerformMexecRequest> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::MexecBroker::PerformMexecRequest> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::MexecBroker::PerformMexecRequest)
== ::llcpp::fuchsia::kernel::MexecBroker::PerformMexecRequest::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::MexecBroker::PerformMexecRequest, kernel) == 16);
static_assert(offsetof(::llcpp::fuchsia::kernel::MexecBroker::PerformMexecRequest, bootdata) == 20);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandRequest> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandRequest> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandRequest)
== ::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandRequest::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandRequest, command) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandResponse)
== ::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::DebugBroker::SendDebugCommandResponse, status) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledRequest> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledRequest> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledRequest)
== ::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledRequest::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledRequest, enabled) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledResponse)
== ::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::DebugBroker::SetTracingEnabledResponse, status) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::Counter::GetInspectVmoResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::Counter::GetInspectVmoResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::Counter::GetInspectVmoResponse)
== ::llcpp::fuchsia::kernel::Counter::GetInspectVmoResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::Counter::GetInspectVmoResponse, status) == 16);
static_assert(offsetof(::llcpp::fuchsia::kernel::Counter::GetInspectVmoResponse, buffer) == 24);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::Counter::UpdateInspectVmoResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::Counter::UpdateInspectVmoResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::Counter::UpdateInspectVmoResponse)
== ::llcpp::fuchsia::kernel::Counter::UpdateInspectVmoResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::Counter::UpdateInspectVmoResponse, status) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::MemoryStats> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::kernel::MemoryStats>);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::Stats::GetMemoryStatsResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::Stats::GetMemoryStatsResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::Stats::GetMemoryStatsResponse)
== ::llcpp::fuchsia::kernel::Stats::GetMemoryStatsResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::Stats::GetMemoryStatsResponse, stats) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::kernel::Stats::GetCpuStatsResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::kernel::Stats::GetCpuStatsResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::kernel::Stats::GetCpuStatsResponse)
== ::llcpp::fuchsia::kernel::Stats::GetCpuStatsResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::kernel::Stats::GetCpuStatsResponse, stats) == 16);
} // namespace fidl