blob: b484bd2beaf4d321a94193dd22adeee4e593d0e5 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <zircon/errors.h>
#include <zircon/syscalls/exception.h>
#include <zircon/syscalls/iommu.h>
#include <zircon/syscalls/pci.h>
#include <zircon/syscalls/policy.h>
#include <zircon/syscalls/port.h>
#include <zircon/syscalls/profile.h>
#include <zircon/syscalls/smc.h>
#include <zircon/syscalls/system.h>
#include <cstdint>
#include <memory>
#include "tools/fidlcat/lib/statistics.h"
#include "tools/fidlcat/lib/syscall_decoder_dispatcher.h"
// ZX_PROP_REGISTER_GS and ZX_PROP_REGISTER_FS which are used by zx_object_set_property are defined
// in <zircon/system/public/zircon/syscalls/object.h> but only available for amd64.
// We need these values in all the environments.
#ifndef ZX_PROP_REGISTER_GS
#define ZX_PROP_REGISTER_GS ((uint32_t)2u)
#endif
#ifndef ZX_PROP_REGISTER_FS
#define ZX_PROP_REGISTER_FS ((uint32_t)4u)
#endif
namespace fidlcat {
class ZxChannelCallArgs {
public:
static const uint8_t* wr_bytes(const zx_channel_call_args_t* from) {
return (from == nullptr) ? nullptr : reinterpret_cast<const uint8_t*>(from->wr_bytes);
}
static const zx_handle_t* wr_handles(const zx_channel_call_args_t* from) {
return (from == nullptr) ? nullptr : from->wr_handles;
}
static const uint8_t* rd_bytes(const zx_channel_call_args_t* from) {
return (from == nullptr) ? nullptr : reinterpret_cast<const uint8_t*>(from->rd_bytes);
}
static const zx_handle_t* rd_handles(const zx_channel_call_args_t* from) {
return (from == nullptr) ? nullptr : from->rd_handles;
}
static uint32_t wr_num_bytes(const zx_channel_call_args_t* from) {
return (from == nullptr) ? 0 : from->wr_num_bytes;
}
static uint32_t wr_num_handles(const zx_channel_call_args_t* from) {
return (from == nullptr) ? 0 : from->wr_num_handles;
}
static uint32_t rd_num_bytes(const zx_channel_call_args_t* from) {
return (from == nullptr) ? 0 : from->rd_num_bytes;
}
static uint32_t rd_num_handles(const zx_channel_call_args_t* from) {
return (from == nullptr) ? 0 : from->rd_num_handles;
}
};
class ZxChannelCallEtcArgs {
public:
static const uint8_t* wr_bytes(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? nullptr : reinterpret_cast<const uint8_t*>(from->wr_bytes);
}
static const zx_handle_disposition_t* wr_handles(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? nullptr : from->wr_handles;
}
static const uint8_t* rd_bytes(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? nullptr : reinterpret_cast<const uint8_t*>(from->rd_bytes);
}
static const zx_handle_info_t* rd_handles(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? nullptr : from->rd_handles;
}
static uint32_t wr_num_bytes(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? 0 : from->wr_num_bytes;
}
static uint32_t wr_num_handles(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? 0 : from->wr_num_handles;
}
static uint32_t rd_num_bytes(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? 0 : from->rd_num_bytes;
}
static uint32_t rd_num_handles(const zx_channel_call_etc_args_t* from) {
return (from == nullptr) ? 0 : from->rd_num_handles;
}
};
class ZxX86_64ExcData : public Class<zx_x86_64_exc_data_t> {
public:
static const ZxX86_64ExcData* GetClass();
static uint64_t vector(const zx_x86_64_exc_data_t* from) { return from->vector; }
static uint64_t err_code(const zx_x86_64_exc_data_t* from) { return from->err_code; }
static uint64_t cr2(const zx_x86_64_exc_data_t* from) { return from->cr2; }
private:
ZxX86_64ExcData() : Class("zx_x86_64_exc_data_t") {
AddField(std::make_unique<ClassField<zx_x86_64_exc_data_t, uint64_t>>(
"vector", SyscallType::kUint64, vector));
AddField(std::make_unique<ClassField<zx_x86_64_exc_data_t, uint64_t>>(
"err_code", SyscallType::kUint64, err_code));
AddField(std::make_unique<ClassField<zx_x86_64_exc_data_t, uint64_t>>(
"cr2", SyscallType::kUint64, cr2));
}
ZxX86_64ExcData(const ZxX86_64ExcData&) = delete;
ZxX86_64ExcData& operator=(const ZxX86_64ExcData&) = delete;
static ZxX86_64ExcData* instance_;
};
ZxX86_64ExcData* ZxX86_64ExcData::instance_ = nullptr;
const ZxX86_64ExcData* ZxX86_64ExcData::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxX86_64ExcData;
}
return instance_;
}
class ZxArm64ExcData : public Class<zx_arm64_exc_data_t> {
public:
static const ZxArm64ExcData* GetClass();
static uint32_t esr(const zx_arm64_exc_data_t* from) { return from->esr; }
static uint64_t far(const zx_arm64_exc_data_t* from) { return from->far; }
private:
ZxArm64ExcData() : Class("zx_arm64_exc_data_t") {
AddField(std::make_unique<ClassField<zx_arm64_exc_data_t, uint32_t>>(
"esr", SyscallType::kUint32, esr));
AddField(std::make_unique<ClassField<zx_arm64_exc_data_t, uint64_t>>(
"far", SyscallType::kUint64, far));
}
ZxArm64ExcData(const ZxArm64ExcData&) = delete;
ZxArm64ExcData& operator=(const ZxArm64ExcData&) = delete;
static ZxArm64ExcData* instance_;
};
ZxArm64ExcData* ZxArm64ExcData::instance_ = nullptr;
const ZxArm64ExcData* ZxArm64ExcData::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxArm64ExcData;
}
return instance_;
}
class ZxExceptionContext : public Class<zx_exception_context_t> {
public:
static const ZxExceptionContext* GetClass();
static const zx_x86_64_exc_data_t* x86_64(const zx_exception_context_t* from) {
return &from->arch.u.x86_64;
}
static const zx_arm64_exc_data_t* arm_64(const zx_exception_context_t* from) {
return &from->arch.u.arm_64;
}
static uint32_t synth_code(const zx_exception_context_t* from) { return from->synth_code; }
static uint32_t synth_data(const zx_exception_context_t* from) { return from->synth_data; }
private:
ZxExceptionContext() : Class("zx_exception_context_t") {
AddField(std::make_unique<ClassClassField<zx_exception_context_t, zx_x86_64_exc_data_t>>(
"arch.x86_64", x86_64, ZxX86_64ExcData::GetClass()));
AddField(std::make_unique<ClassClassField<zx_exception_context_t, zx_arm64_exc_data_t>>(
"arch.arm_64", arm_64, ZxArm64ExcData::GetClass()));
AddField(std::make_unique<ClassField<zx_exception_context_t, uint32_t>>(
"synth_code", SyscallType::kUint32, synth_code));
AddField(std::make_unique<ClassField<zx_exception_context_t, uint32_t>>(
"synth_data", SyscallType::kUint32, synth_data));
}
ZxExceptionContext(const ZxExceptionContext&) = delete;
ZxExceptionContext& operator=(const ZxExceptionContext&) = delete;
static ZxExceptionContext* instance_;
};
ZxExceptionContext* ZxExceptionContext::instance_ = nullptr;
const ZxExceptionContext* ZxExceptionContext::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxExceptionContext;
}
return instance_;
}
class ZxExceptionHeader : public Class<zx_exception_header_t> {
public:
static const ZxExceptionHeader* GetClass();
static uint32_t size(const zx_exception_header_t* from) { return from->size; }
static zx_excp_type_t type(const zx_exception_header_t* from) { return from->type; }
private:
ZxExceptionHeader() : Class("zx_exception_header_t") {
AddField(std::make_unique<ClassField<zx_exception_header_t, uint32_t>>(
"size", SyscallType::kUint32, size));
AddField(std::make_unique<ClassField<zx_exception_header_t, zx_excp_type_t>>(
"type", SyscallType::kUint32, type));
}
ZxExceptionHeader(const ZxExceptionHeader&) = delete;
ZxExceptionHeader& operator=(const ZxExceptionHeader&) = delete;
static ZxExceptionHeader* instance_;
};
ZxExceptionHeader* ZxExceptionHeader::instance_ = nullptr;
const ZxExceptionHeader* ZxExceptionHeader::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxExceptionHeader;
}
return instance_;
}
class ZxExceptionReport : public Class<zx_exception_report_t> {
public:
static const ZxExceptionReport* GetClass();
static const zx_exception_header_t* header(const zx_exception_report_t* from) {
return &from->header;
}
static const zx_exception_context_t* context(const zx_exception_report_t* from) {
return &from->context;
}
private:
ZxExceptionReport() : Class("zx_exception_report_t") {
AddField(std::make_unique<ClassClassField<zx_exception_report_t, zx_exception_header_t>>(
"header", header, ZxExceptionHeader::GetClass()));
AddField(std::make_unique<ClassClassField<zx_exception_report_t, zx_exception_context_t>>(
"context", context, ZxExceptionContext::GetClass()));
}
ZxExceptionReport(const ZxExceptionReport&) = delete;
ZxExceptionReport& operator=(const ZxExceptionReport&) = delete;
static ZxExceptionReport* instance_;
};
ZxExceptionReport* ZxExceptionReport::instance_ = nullptr;
const ZxExceptionReport* ZxExceptionReport::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxExceptionReport;
}
return instance_;
}
class ZxInfoBti : public Class<zx_info_bti_t> {
public:
static const ZxInfoBti* GetClass();
static uint64_t minimum_contiguity(const zx_info_bti_t* from) { return from->minimum_contiguity; }
static uint64_t aspace_size(const zx_info_bti_t* from) { return from->aspace_size; }
static uint64_t pmo_count(const zx_info_bti_t* from) { return from->pmo_count; }
static uint64_t quarantine_count(const zx_info_bti_t* from) { return from->quarantine_count; }
private:
ZxInfoBti() : Class("zx_info_bti_t") {
AddField(std::make_unique<ClassField<zx_info_bti_t, uint64_t>>(
"minimum_contiguity", SyscallType::kUint64, minimum_contiguity));
AddField(std::make_unique<ClassField<zx_info_bti_t, uint64_t>>(
"aspace_size", SyscallType::kUint64, aspace_size));
AddField(std::make_unique<ClassField<zx_info_bti_t, uint64_t>>(
"pmo_count", SyscallType::kUint64, pmo_count));
AddField(std::make_unique<ClassField<zx_info_bti_t, uint64_t>>(
"quarantine_count", SyscallType::kUint64, quarantine_count));
}
ZxInfoBti(const ZxInfoBti&) = delete;
ZxInfoBti& operator=(const ZxInfoBti&) = delete;
static ZxInfoBti* instance_;
};
ZxInfoBti* ZxInfoBti::instance_ = nullptr;
const ZxInfoBti* ZxInfoBti::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoBti;
}
return instance_;
}
class ZxInfoCpuStats : public Class<zx_info_cpu_stats_t> {
public:
static const ZxInfoCpuStats* GetClass();
static uint32_t cpu_number(const zx_info_cpu_stats_t* from) { return from->cpu_number; }
static uint32_t flags(const zx_info_cpu_stats_t* from) { return from->flags; }
static zx_duration_t idle_time(const zx_info_cpu_stats_t* from) { return from->idle_time; }
static uint64_t reschedules(const zx_info_cpu_stats_t* from) { return from->reschedules; }
static uint64_t context_switches(const zx_info_cpu_stats_t* from) {
return from->context_switches;
}
static uint64_t irq_preempts(const zx_info_cpu_stats_t* from) { return from->irq_preempts; }
static uint64_t preempts(const zx_info_cpu_stats_t* from) { return from->preempts; }
static uint64_t yields(const zx_info_cpu_stats_t* from) { return from->yields; }
static uint64_t ints(const zx_info_cpu_stats_t* from) { return from->ints; }
static uint64_t timer_ints(const zx_info_cpu_stats_t* from) { return from->timer_ints; }
static uint64_t timers(const zx_info_cpu_stats_t* from) { return from->timers; }
static uint64_t syscalls(const zx_info_cpu_stats_t* from) { return from->syscalls; }
static uint64_t reschedule_ipis(const zx_info_cpu_stats_t* from) { return from->reschedule_ipis; }
static uint64_t generic_ipis(const zx_info_cpu_stats_t* from) { return from->generic_ipis; }
private:
ZxInfoCpuStats() : Class("zx_info_cpu_stats_t") {
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint32_t>>(
"cpu_number", SyscallType::kUint32, cpu_number));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint32_t>>(
"flags", SyscallType::kUint32, flags));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, zx_duration_t>>(
"idle_time", SyscallType::kDuration, idle_time));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"reschedules", SyscallType::kUint64, reschedules));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"context_switches", SyscallType::kUint64, context_switches));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"irq_preempts", SyscallType::kUint64, irq_preempts));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"preempts", SyscallType::kUint64, preempts));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"yields", SyscallType::kUint64, yields));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"ints", SyscallType::kUint64, ints));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"timer_ints", SyscallType::kUint64, timer_ints));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"timers", SyscallType::kUint64, timers));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"syscalls", SyscallType::kUint64, syscalls));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"reschedule_ipis", SyscallType::kUint64, reschedule_ipis));
AddField(std::make_unique<ClassField<zx_info_cpu_stats_t, uint64_t>>(
"generic_ipis", SyscallType::kUint64, generic_ipis));
}
ZxInfoCpuStats(const ZxInfoCpuStats&) = delete;
ZxInfoCpuStats& operator=(const ZxInfoCpuStats&) = delete;
static ZxInfoCpuStats* instance_;
};
ZxInfoCpuStats* ZxInfoCpuStats::instance_ = nullptr;
const ZxInfoCpuStats* ZxInfoCpuStats::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoCpuStats;
}
return instance_;
}
class ZxInfoHandleBasic : public Class<zx_info_handle_basic_t> {
public:
static const ZxInfoHandleBasic* GetClass();
static zx_koid_t koid(const zx_info_handle_basic_t* from) { return from->koid; }
static zx_rights_t rights(const zx_info_handle_basic_t* from) { return from->rights; }
static zx_obj_type_t type(const zx_info_handle_basic_t* from) { return from->type; }
static zx_koid_t related_koid(const zx_info_handle_basic_t* from) { return from->related_koid; }
static uint32_t reserved(const zx_info_handle_basic_t* from) { return from->reserved; }
private:
ZxInfoHandleBasic() : Class("zx_info_handle_basic_t") {
AddField(std::make_unique<ClassField<zx_info_handle_basic_t, zx_koid_t>>(
"koid", SyscallType::kKoid, koid));
AddField(std::make_unique<ClassField<zx_info_handle_basic_t, zx_rights_t>>(
"rights", SyscallType::kRights, rights));
AddField(std::make_unique<ClassField<zx_info_handle_basic_t, zx_obj_type_t>>(
"type", SyscallType::kObjType, type));
AddField(std::make_unique<ClassField<zx_info_handle_basic_t, zx_koid_t>>(
"related_koid", SyscallType::kKoid, related_koid));
}
ZxInfoHandleBasic(const ZxInfoHandleBasic&) = delete;
ZxInfoHandleBasic& operator=(const ZxInfoHandleBasic&) = delete;
static ZxInfoHandleBasic* instance_;
};
ZxInfoHandleBasic* ZxInfoHandleBasic::instance_ = nullptr;
const ZxInfoHandleBasic* ZxInfoHandleBasic::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoHandleBasic;
}
return instance_;
}
class ZxInfoHandleCount : public Class<zx_info_handle_count_t> {
public:
static const ZxInfoHandleCount* GetClass();
static uint32_t handle_count(const zx_info_handle_count_t* from) { return from->handle_count; }
private:
ZxInfoHandleCount() : Class("zx_info_handle_count_t") {
AddField(std::make_unique<ClassField<zx_info_handle_count_t, uint32_t>>(
"handle_count", SyscallType::kUint32, handle_count));
}
ZxInfoHandleCount(const ZxInfoHandleCount&) = delete;
ZxInfoHandleCount& operator=(const ZxInfoHandleCount&) = delete;
static ZxInfoHandleCount* instance_;
};
ZxInfoHandleCount* ZxInfoHandleCount::instance_ = nullptr;
const ZxInfoHandleCount* ZxInfoHandleCount::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoHandleCount;
}
return instance_;
}
class ZxInfoJob : public Class<zx_info_job_t> {
public:
static const ZxInfoJob* GetClass();
static int64_t return_code(const zx_info_job_t* from) { return from->return_code; }
static bool exited(const zx_info_job_t* from) { return from->exited; }
static bool kill_on_oom(const zx_info_job_t* from) { return from->kill_on_oom; }
static bool debugger_attached(const zx_info_job_t* from) { return from->debugger_attached; }
private:
ZxInfoJob() : Class("zx_info_job_t") {
AddField(std::make_unique<ClassField<zx_info_job_t, int64_t>>(
"return_code", SyscallType::kInt64, return_code));
AddField(
std::make_unique<ClassField<zx_info_job_t, bool>>("exited", SyscallType::kBool, exited));
AddField(std::make_unique<ClassField<zx_info_job_t, bool>>("kill_on_oom", SyscallType::kBool,
kill_on_oom));
AddField(std::make_unique<ClassField<zx_info_job_t, bool>>(
"debugger_attached", SyscallType::kBool, debugger_attached));
}
ZxInfoJob(const ZxInfoJob&) = delete;
ZxInfoJob& operator=(const ZxInfoJob&) = delete;
static ZxInfoJob* instance_;
};
ZxInfoJob* ZxInfoJob::instance_ = nullptr;
const ZxInfoJob* ZxInfoJob::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoJob;
}
return instance_;
}
class ZxInfoKmemStats : public Class<zx_info_kmem_stats_t> {
public:
static const ZxInfoKmemStats* GetClass();
static size_t total_bytes(const zx_info_kmem_stats_t* from) { return from->total_bytes; }
static size_t free_bytes(const zx_info_kmem_stats_t* from) { return from->free_bytes; }
static size_t wired_bytes(const zx_info_kmem_stats_t* from) { return from->wired_bytes; }
static size_t total_heap_bytes(const zx_info_kmem_stats_t* from) {
return from->total_heap_bytes;
}
static size_t free_heap_bytes(const zx_info_kmem_stats_t* from) { return from->free_heap_bytes; }
static size_t vmo_bytes(const zx_info_kmem_stats_t* from) { return from->vmo_bytes; }
static size_t mmu_overhead_bytes(const zx_info_kmem_stats_t* from) {
return from->mmu_overhead_bytes;
}
static size_t other_bytes(const zx_info_kmem_stats_t* from) { return from->other_bytes; }
private:
ZxInfoKmemStats() : Class("zx_info_kmem_stats_t") {
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"total_bytes", SyscallType::kSize, total_bytes));
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"free_bytes", SyscallType::kSize, free_bytes));
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"wired_bytes", SyscallType::kSize, wired_bytes));
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"total_heap_bytes", SyscallType::kSize, total_heap_bytes));
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"free_heap_bytes", SyscallType::kSize, free_heap_bytes));
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"vmo_bytes", SyscallType::kSize, vmo_bytes));
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"mmu_overhead_bytes", SyscallType::kSize, mmu_overhead_bytes));
AddField(std::make_unique<ClassField<zx_info_kmem_stats_t, size_t>>(
"other_bytes", SyscallType::kSize, other_bytes));
}
ZxInfoKmemStats(const ZxInfoKmemStats&) = delete;
ZxInfoKmemStats& operator=(const ZxInfoKmemStats&) = delete;
static ZxInfoKmemStats* instance_;
};
ZxInfoKmemStats* ZxInfoKmemStats::instance_ = nullptr;
const ZxInfoKmemStats* ZxInfoKmemStats::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoKmemStats;
}
return instance_;
}
class ZxInfoMapsMapping : public Class<zx_info_maps_mapping_t> {
public:
static const ZxInfoMapsMapping* GetClass();
static zx_vm_option_t mmu_flags(const zx_info_maps_mapping_t* from) { return from->mmu_flags; }
static zx_koid_t vmo_koid(const zx_info_maps_mapping_t* from) { return from->vmo_koid; }
static uint64_t vmo_offset(const zx_info_maps_mapping_t* from) { return from->vmo_offset; }
static size_t committed_pages(const zx_info_maps_mapping_t* from) {
return from->committed_pages;
}
private:
ZxInfoMapsMapping() : Class("zx_info_maps_mapping_t") {
AddField(std::make_unique<ClassField<zx_info_maps_mapping_t, zx_vm_option_t>>(
"mmu_flags", SyscallType::kVmOption, mmu_flags));
AddField(std::make_unique<ClassField<zx_info_maps_mapping_t, zx_koid_t>>(
"vmo_koid", SyscallType::kKoid, vmo_koid));
AddField(std::make_unique<ClassField<zx_info_maps_mapping_t, uint64_t>>(
"vmo_offset", SyscallType::kUint64, vmo_offset));
AddField(std::make_unique<ClassField<zx_info_maps_mapping_t, size_t>>(
"committed_pages", SyscallType::kSize, committed_pages));
}
ZxInfoMapsMapping(const ZxInfoMapsMapping&) = delete;
ZxInfoMapsMapping& operator=(const ZxInfoMapsMapping&) = delete;
static ZxInfoMapsMapping* instance_;
};
ZxInfoMapsMapping* ZxInfoMapsMapping::instance_ = nullptr;
const ZxInfoMapsMapping* ZxInfoMapsMapping::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoMapsMapping;
}
return instance_;
}
class ZxInfoMaps : public Class<zx_info_maps_t> {
public:
static const ZxInfoMaps* GetClass();
static std::pair<const char*, size_t> name(const zx_info_maps_t* from) {
return std::make_pair(reinterpret_cast<const char*>(from->name), sizeof(from->name));
}
static zx_vaddr_t base(const zx_info_maps_t* from) { return from->base; }
static size_t size(const zx_info_maps_t* from) { return from->size; }
static size_t depth(const zx_info_maps_t* from) { return from->depth; }
static zx_info_maps_type_t type(const zx_info_maps_t* from) { return from->type; }
static const zx_info_maps_mapping_t* mapping(const zx_info_maps_t* from) {
return reinterpret_cast<const zx_info_maps_mapping_t*>(&from->u.mapping);
}
private:
ZxInfoMaps() : Class("zx_info_maps_t") {
AddField(std::make_unique<DynamicArrayField<zx_info_maps_t, char, size_t>>(
"name", SyscallType::kChar, name));
AddField(std::make_unique<ClassField<zx_info_maps_t, zx_vaddr_t>>("base", SyscallType::kVaddr,
base));
AddField(
std::make_unique<ClassField<zx_info_maps_t, size_t>>("size", SyscallType::kSize, size));
AddField(
std::make_unique<ClassField<zx_info_maps_t, size_t>>("depth", SyscallType::kSize, depth));
auto type_field = AddField(std::make_unique<ClassField<zx_info_maps_t, zx_info_maps_type_t>>(
"type", SyscallType::kInfoMapsType, type));
AddField(std::make_unique<ClassClassField<zx_info_maps_t, zx_info_maps_mapping_t>>(
"mapping", mapping, ZxInfoMapsMapping::GetClass()))
->DisplayIfEqual(type_field, ZX_INFO_MAPS_TYPE_MAPPING);
}
ZxInfoMaps(const ZxInfoMaps&) = delete;
ZxInfoMaps& operator=(const ZxInfoMaps&) = delete;
static ZxInfoMaps* instance_;
};
ZxInfoMaps* ZxInfoMaps::instance_ = nullptr;
const ZxInfoMaps* ZxInfoMaps::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoMaps;
}
return instance_;
}
class ZxInfoProcess : public Class<zx_info_process_t> {
public:
static const ZxInfoProcess* GetClass();
static int64_t return_code(const zx_info_process_t* from) { return from->return_code; }
static zx_time_t start_time(const zx_info_process_t* from) { return from->start_time; }
static zx_info_process_flags_t flags(const zx_info_process_t* from) { return from->flags; }
private:
ZxInfoProcess() : Class("zx_info_process_t") {
AddField(std::make_unique<ClassField<zx_info_process_t, int64_t>>(
"return_code", SyscallType::kInt64, return_code));
AddField(std::make_unique<ClassField<zx_info_process_t, zx_time_t>>(
"start_time", SyscallType::kTime, start_time));
AddField(std::make_unique<ClassField<zx_info_process_t, zx_info_process_flags_t>>(
"flags", SyscallType::kUint32, flags));
}
ZxInfoProcess(const ZxInfoProcess&) = delete;
ZxInfoProcess& operator=(const ZxInfoProcess&) = delete;
static ZxInfoProcess* instance_;
};
ZxInfoProcess* ZxInfoProcess::instance_ = nullptr;
const ZxInfoProcess* ZxInfoProcess::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoProcess;
}
return instance_;
}
class ZxInfoProcessHandleStats : public Class<zx_info_process_handle_stats_t> {
public:
static const ZxInfoProcessHandleStats* GetClass();
static std::pair<const uint32_t*, int> handle_count(const zx_info_process_handle_stats_t* from) {
return std::make_pair(reinterpret_cast<const uint32_t*>(from->handle_count),
sizeof(from->handle_count) / sizeof(uint32_t));
}
private:
ZxInfoProcessHandleStats() : Class("zx_info_process_handle_stats_t") {
AddField(std::make_unique<DynamicArrayField<zx_info_process_handle_stats_t, uint32_t, int>>(
"handle_count", SyscallType::kUint32, handle_count));
}
ZxInfoProcessHandleStats(const ZxInfoProcessHandleStats&) = delete;
ZxInfoProcessHandleStats& operator=(const ZxInfoProcessHandleStats&) = delete;
static ZxInfoProcessHandleStats* instance_;
};
ZxInfoProcessHandleStats* ZxInfoProcessHandleStats::instance_ = nullptr;
const ZxInfoProcessHandleStats* ZxInfoProcessHandleStats::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoProcessHandleStats;
}
return instance_;
}
class ZxInfoResource : public Class<zx_info_resource_t> {
public:
static const ZxInfoResource* GetClass();
static zx_rsrc_kind_t kind(const zx_info_resource_t* from) { return from->kind; }
static uint32_t flags(const zx_info_resource_t* from) { return from->flags; }
static uint64_t base(const zx_info_resource_t* from) { return from->base; }
static size_t size(const zx_info_resource_t* from) { return from->size; }
static std::pair<const char*, size_t> name(const zx_info_resource_t* from) {
return std::make_pair(reinterpret_cast<const char*>(from->name), sizeof(from->name));
}
private:
ZxInfoResource() : Class("zx_info_resource_t") {
AddField(std::make_unique<ClassField<zx_info_resource_t, zx_rsrc_kind_t>>(
"kind", SyscallType::kRsrcKind, kind));
AddField(std::make_unique<ClassField<zx_info_resource_t, uint32_t>>(
"flags", SyscallType::kUint32, flags));
AddField(std::make_unique<ClassField<zx_info_resource_t, uint64_t>>(
"base", SyscallType::kUint64, base));
AddField(
std::make_unique<ClassField<zx_info_resource_t, size_t>>("size", SyscallType::kSize, size));
AddField(std::make_unique<DynamicArrayField<zx_info_resource_t, char, size_t>>(
"name", SyscallType::kChar, name));
}
ZxInfoResource(const ZxInfoResource&) = delete;
ZxInfoResource& operator=(const ZxInfoResource&) = delete;
static ZxInfoResource* instance_;
};
ZxInfoResource* ZxInfoResource::instance_ = nullptr;
const ZxInfoResource* ZxInfoResource::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoResource;
}
return instance_;
}
class ZxInfoSocket : public Class<zx_info_socket_t> {
public:
static const ZxInfoSocket* GetClass();
static uint32_t options(const zx_info_socket_t* from) { return from->options; }
static size_t rx_buf_max(const zx_info_socket_t* from) { return from->rx_buf_max; }
static size_t rx_buf_size(const zx_info_socket_t* from) { return from->rx_buf_size; }
static size_t rx_buf_available(const zx_info_socket_t* from) { return from->rx_buf_available; }
static size_t tx_buf_max(const zx_info_socket_t* from) { return from->tx_buf_max; }
static size_t tx_buf_size(const zx_info_socket_t* from) { return from->tx_buf_size; }
private:
ZxInfoSocket() : Class("zx_info_socket_t") {
AddField(std::make_unique<ClassField<zx_info_socket_t, uint32_t>>(
"options", SyscallType::kUint32, options));
AddField(std::make_unique<ClassField<zx_info_socket_t, size_t>>(
"rx_buf_max", SyscallType::kSize, rx_buf_max));
AddField(std::make_unique<ClassField<zx_info_socket_t, size_t>>(
"rx_buf_size", SyscallType::kSize, rx_buf_size));
AddField(std::make_unique<ClassField<zx_info_socket_t, size_t>>(
"rx_buf_available", SyscallType::kSize, rx_buf_available));
AddField(std::make_unique<ClassField<zx_info_socket_t, size_t>>(
"tx_buf_max", SyscallType::kSize, tx_buf_max));
AddField(std::make_unique<ClassField<zx_info_socket_t, size_t>>(
"tx_buf_size", SyscallType::kSize, tx_buf_size));
}
ZxInfoSocket(const ZxInfoSocket&) = delete;
ZxInfoSocket& operator=(const ZxInfoSocket&) = delete;
static ZxInfoSocket* instance_;
};
ZxInfoSocket* ZxInfoSocket::instance_ = nullptr;
const ZxInfoSocket* ZxInfoSocket::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoSocket;
}
return instance_;
}
class ZxInfoTaskStats : public Class<zx_info_task_stats_t> {
public:
static const ZxInfoTaskStats* GetClass();
static size_t mem_mapped_bytes(const zx_info_task_stats_t* from) {
return from->mem_mapped_bytes;
}
static size_t mem_private_bytes(const zx_info_task_stats_t* from) {
return from->mem_private_bytes;
}
static size_t mem_shared_bytes(const zx_info_task_stats_t* from) {
return from->mem_shared_bytes;
}
static size_t mem_scaled_shared_bytes(const zx_info_task_stats_t* from) {
return from->mem_scaled_shared_bytes;
}
private:
ZxInfoTaskStats() : Class("zx_info_task_stats_t") {
AddField(std::make_unique<ClassField<zx_info_task_stats_t, size_t>>(
"mem_mapped_bytes", SyscallType::kSize, mem_mapped_bytes));
AddField(std::make_unique<ClassField<zx_info_task_stats_t, size_t>>(
"mem_private_bytes", SyscallType::kSize, mem_private_bytes));
AddField(std::make_unique<ClassField<zx_info_task_stats_t, size_t>>(
"mem_shared_bytes", SyscallType::kSize, mem_shared_bytes));
AddField(std::make_unique<ClassField<zx_info_task_stats_t, size_t>>(
"mem_scaled_shared_bytes", SyscallType::kSize, mem_scaled_shared_bytes));
}
ZxInfoTaskStats(const ZxInfoTaskStats&) = delete;
ZxInfoTaskStats& operator=(const ZxInfoTaskStats&) = delete;
static ZxInfoTaskStats* instance_;
};
ZxInfoTaskStats* ZxInfoTaskStats::instance_ = nullptr;
const ZxInfoTaskStats* ZxInfoTaskStats::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoTaskStats;
}
return instance_;
}
class ZxCpuSet : public Class<zx_cpu_set_t> {
public:
static const ZxCpuSet* GetClass();
static std::pair<const uint64_t*, int> mask(const zx_cpu_set_t* from) {
return std::make_pair(reinterpret_cast<const uint64_t*>(from->mask),
sizeof(from->mask) / sizeof(uint64_t));
}
private:
ZxCpuSet() : Class("zx_cpu_set_t") {
AddField(std::make_unique<DynamicArrayField<zx_cpu_set_t, uint64_t, int>>(
"mask", SyscallType::kUint64Hexa, mask));
}
ZxCpuSet(const ZxCpuSet&) = delete;
ZxCpuSet& operator=(const ZxCpuSet&) = delete;
static ZxCpuSet* instance_;
};
ZxCpuSet* ZxCpuSet::instance_ = nullptr;
const ZxCpuSet* ZxCpuSet::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxCpuSet;
}
return instance_;
}
class ZxInfoThread : public Class<zx_info_thread_t> {
public:
static const ZxInfoThread* GetClass();
static uint32_t state(const zx_info_thread_t* from) { return from->state; }
static uint32_t wait_exception_channel_type(const zx_info_thread_t* from) {
return from->wait_exception_channel_type;
}
static const zx_cpu_set_t* cpu_affinity_mask(const zx_info_thread_t* from) {
return &from->cpu_affinity_mask;
}
private:
ZxInfoThread() : Class("zx_info_thread_t") {
AddField(std::make_unique<ClassField<zx_info_thread_t, uint32_t>>(
"state", SyscallType::kThreadState, state));
AddField(std::make_unique<ClassField<zx_info_thread_t, uint32_t>>(
"wait_exception_channel_type", SyscallType::kExceptionChannelType,
wait_exception_channel_type));
AddField(std::make_unique<ClassClassField<zx_info_thread_t, zx_cpu_set_t>>(
"cpu_affinity_mask", cpu_affinity_mask, ZxCpuSet::GetClass()));
}
ZxInfoThread(const ZxInfoThread&) = delete;
ZxInfoThread& operator=(const ZxInfoThread&) = delete;
static ZxInfoThread* instance_;
};
ZxInfoThread* ZxInfoThread::instance_ = nullptr;
const ZxInfoThread* ZxInfoThread::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoThread;
}
return instance_;
}
class ZxInfoThreadStats : public Class<zx_info_thread_stats_t> {
public:
static const ZxInfoThreadStats* GetClass();
static zx_duration_t total_runtime(const zx_info_thread_stats_t* from) {
return from->total_runtime;
}
static uint32_t last_scheduled_cpu(const zx_info_thread_stats_t* from) {
return from->last_scheduled_cpu;
}
private:
ZxInfoThreadStats() : Class("zx_info_thread_stats_t") {
AddField(std::make_unique<ClassField<zx_info_thread_stats_t, zx_duration_t>>(
"total_runtime", SyscallType::kDuration, total_runtime));
AddField(std::make_unique<ClassField<zx_info_thread_stats_t, uint32_t>>(
"last_scheduled_cpu", SyscallType::kUint32, last_scheduled_cpu));
}
ZxInfoThreadStats(const ZxInfoThreadStats&) = delete;
ZxInfoThreadStats& operator=(const ZxInfoThreadStats&) = delete;
static ZxInfoThreadStats* instance_;
};
ZxInfoThreadStats* ZxInfoThreadStats::instance_ = nullptr;
const ZxInfoThreadStats* ZxInfoThreadStats::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoThreadStats;
}
return instance_;
}
class ZxInfoTimer : public Class<zx_info_timer_t> {
public:
static const ZxInfoTimer* GetClass();
static uint32_t options(const zx_info_timer_t* from) { return from->options; }
static zx_time_t deadline(const zx_info_timer_t* from) { return from->deadline; }
static zx_duration_t slack(const zx_info_timer_t* from) { return from->slack; }
private:
ZxInfoTimer() : Class("zx_info_timer_t") {
AddField(std::make_unique<ClassField<zx_info_timer_t, uint32_t>>(
"options", SyscallType::kUint32, options));
AddField(std::make_unique<ClassField<zx_info_timer_t, zx_time_t>>(
"deadline", SyscallType::kMonotonicTime, deadline));
AddField(std::make_unique<ClassField<zx_info_timer_t, zx_duration_t>>(
"slack", SyscallType::kDuration, slack));
}
ZxInfoTimer(const ZxInfoTimer&) = delete;
ZxInfoTimer& operator=(const ZxInfoTimer&) = delete;
static ZxInfoTimer* instance_;
};
ZxInfoTimer* ZxInfoTimer::instance_ = nullptr;
const ZxInfoTimer* ZxInfoTimer::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoTimer;
}
return instance_;
}
class ZxInfoVmar : public Class<zx_info_vmar_t> {
public:
static const ZxInfoVmar* GetClass();
static uintptr_t base(const zx_info_vmar_t* from) { return from->base; }
static size_t len(const zx_info_vmar_t* from) { return from->len; }
private:
ZxInfoVmar() : Class("zx_info_vmar_t") {
AddField(std::make_unique<ClassField<zx_info_vmar_t, uintptr_t>>("base", SyscallType::kUintptr,
base));
AddField(std::make_unique<ClassField<zx_info_vmar_t, size_t>>("len", SyscallType::kSize, len));
}
ZxInfoVmar(const ZxInfoVmar&) = delete;
ZxInfoVmar& operator=(const ZxInfoVmar&) = delete;
static ZxInfoVmar* instance_;
};
ZxInfoVmar* ZxInfoVmar::instance_ = nullptr;
const ZxInfoVmar* ZxInfoVmar::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoVmar;
}
return instance_;
}
class ZxInfoVmo : public Class<zx_info_vmo_t> {
public:
static const ZxInfoVmo* GetClass();
static zx_koid_t koid(const zx_info_vmo_t* from) { return from->koid; }
static std::pair<const char*, size_t> name(const zx_info_vmo_t* from) {
return std::make_pair(reinterpret_cast<const char*>(from->name), sizeof(from->name));
}
static uint64_t size_bytes(const zx_info_vmo_t* from) { return from->size_bytes; }
static zx_koid_t parent_koid(const zx_info_vmo_t* from) { return from->parent_koid; }
static size_t num_children(const zx_info_vmo_t* from) { return from->num_children; }
static size_t num_mappings(const zx_info_vmo_t* from) { return from->num_mappings; }
static size_t share_count(const zx_info_vmo_t* from) { return from->share_count; }
static uint32_t flags(const zx_info_vmo_t* from) { return from->flags; }
static uint64_t committed_bytes(const zx_info_vmo_t* from) { return from->committed_bytes; }
static zx_rights_t handle_rights(const zx_info_vmo_t* from) { return from->handle_rights; }
static uint32_t cache_policy(const zx_info_vmo_t* from) { return from->cache_policy; }
static uint64_t metadata_bytes(const zx_info_vmo_t* from) { return from->metadata_bytes; }
static uint64_t committed_change_events(const zx_info_vmo_t* from) {
return from->committed_change_events;
}
private:
ZxInfoVmo() : Class("zx_info_vmo_t") {
AddField(
std::make_unique<ClassField<zx_info_vmo_t, zx_koid_t>>("koid", SyscallType::kKoid, koid));
AddField(std::make_unique<DynamicArrayField<zx_info_vmo_t, char, size_t>>(
"name", SyscallType::kChar, name));
AddField(std::make_unique<ClassField<zx_info_vmo_t, uint64_t>>(
"size_bytes", SyscallType::kUint64, size_bytes));
AddField(std::make_unique<ClassField<zx_info_vmo_t, zx_koid_t>>(
"parent_koid", SyscallType::kKoid, parent_koid));
AddField(std::make_unique<ClassField<zx_info_vmo_t, size_t>>("num_children", SyscallType::kSize,
num_children));
AddField(std::make_unique<ClassField<zx_info_vmo_t, size_t>>("num_mappings", SyscallType::kSize,
num_mappings));
AddField(std::make_unique<ClassField<zx_info_vmo_t, size_t>>("share_count", SyscallType::kSize,
share_count));
AddField(std::make_unique<ClassField<zx_info_vmo_t, uint32_t>>("flags", SyscallType::kVmoType,
flags));
AddField(std::make_unique<ClassField<zx_info_vmo_t, uint64_t>>(
"committed_bytes", SyscallType::kUint64, committed_bytes));
AddField(std::make_unique<ClassField<zx_info_vmo_t, zx_rights_t>>(
"handle_rights", SyscallType::kRights, handle_rights));
AddField(std::make_unique<ClassField<zx_info_vmo_t, uint32_t>>(
"cache_policy", SyscallType::kCachePolicy, cache_policy));
AddField(std::make_unique<ClassField<zx_info_vmo_t, uint64_t>>(
"metadata_bytes", SyscallType::kUint64, metadata_bytes));
AddField(std::make_unique<ClassField<zx_info_vmo_t, uint64_t>>(
"committed_change_events", SyscallType::kUint64, committed_change_events));
}
ZxInfoVmo(const ZxInfoVmo&) = delete;
ZxInfoVmo& operator=(const ZxInfoVmo&) = delete;
static ZxInfoVmo* instance_;
};
ZxInfoVmo* ZxInfoVmo::instance_ = nullptr;
const ZxInfoVmo* ZxInfoVmo::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxInfoVmo;
}
return instance_;
}
class ZxIommuDescIntel : public Class<zx_iommu_desc_intel_t> {
public:
static const ZxIommuDescIntel* GetClass();
static uint64_t register_base(const zx_iommu_desc_intel_t* from) { return from->register_base; }
static uint16_t pci_segment(const zx_iommu_desc_intel_t* from) { return from->pci_segment; }
static bool whole_segment(const zx_iommu_desc_intel_t* from) { return from->whole_segment; }
static uint8_t scope_bytes(const zx_iommu_desc_intel_t* from) { return from->scope_bytes; }
static uint16_t reserved_memory_bytes(const zx_iommu_desc_intel_t* from) {
return from->reserved_memory_bytes;
}
private:
ZxIommuDescIntel() : Class("zx_iommu_desc_intel_t") {
AddField(std::make_unique<ClassField<zx_iommu_desc_intel_t, uint64_t>>(
"register_base", SyscallType::kPaddr, register_base));
AddField(std::make_unique<ClassField<zx_iommu_desc_intel_t, uint16_t>>(
"pci_segment", SyscallType::kUint16, pci_segment));
AddField(std::make_unique<ClassField<zx_iommu_desc_intel_t, bool>>(
"whole_segment", SyscallType::kBool, whole_segment));
AddField(std::make_unique<ClassField<zx_iommu_desc_intel_t, uint8_t>>(
"scope_bytes", SyscallType::kUint8, scope_bytes));
AddField(std::make_unique<ClassField<zx_iommu_desc_intel_t, uint16_t>>(
"reserved_memory_bytes", SyscallType::kUint16, reserved_memory_bytes));
}
ZxIommuDescIntel(const ZxIommuDescIntel&) = delete;
ZxIommuDescIntel& operator=(const ZxIommuDescIntel&) = delete;
static ZxIommuDescIntel* instance_;
};
ZxIommuDescIntel* ZxIommuDescIntel::instance_ = nullptr;
const ZxIommuDescIntel* ZxIommuDescIntel::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxIommuDescIntel;
}
return instance_;
}
class ZxPacketUser : public Class<zx_packet_user_t> {
public:
static const ZxPacketUser* GetClass();
static std::pair<const uint64_t*, int> u64(const zx_packet_user_t* from) {
return std::make_pair(reinterpret_cast<const uint64_t*>(from->u64),
sizeof(from->u64) / sizeof(uint64_t));
}
static std::pair<const uint32_t*, int> u32(const zx_packet_user_t* from) {
return std::make_pair(reinterpret_cast<const uint32_t*>(from->u32),
sizeof(from->u32) / sizeof(uint32_t));
}
static std::pair<const uint16_t*, int> u16(const zx_packet_user_t* from) {
return std::make_pair(reinterpret_cast<const uint16_t*>(from->u16),
sizeof(from->u16) / sizeof(uint16_t));
}
static std::pair<const uint8_t*, int> c8(const zx_packet_user_t* from) {
return std::make_pair(reinterpret_cast<const uint8_t*>(from->c8),
sizeof(from->c8) / sizeof(uint8_t));
}
private:
ZxPacketUser() : Class("zx_packet_user_t") {
AddField(std::make_unique<DynamicArrayField<zx_packet_user_t, uint64_t, int>>(
"u64", SyscallType::kUint64Hexa, u64));
AddField(std::make_unique<DynamicArrayField<zx_packet_user_t, uint32_t, int>>(
"u32", SyscallType::kUint32Hexa, u32));
AddField(std::make_unique<DynamicArrayField<zx_packet_user_t, uint16_t, int>>(
"u16", SyscallType::kUint16Hexa, u16));
AddField(std::make_unique<DynamicArrayField<zx_packet_user_t, uint8_t, int>>(
"u8", SyscallType::kUint8Hexa, c8));
}
ZxPacketUser(const ZxPacketUser&) = delete;
ZxPacketUser& operator=(const ZxPacketUser&) = delete;
static ZxPacketUser* instance_;
};
ZxPacketUser* ZxPacketUser::instance_ = nullptr;
const ZxPacketUser* ZxPacketUser::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketUser;
}
return instance_;
}
class ZxPacketSignal : public Class<zx_packet_signal_t> {
public:
static const ZxPacketSignal* GetClass();
static zx_signals_t trigger(const zx_packet_signal_t* from) { return from->trigger; }
static zx_signals_t observed(const zx_packet_signal_t* from) { return from->observed; }
static uint64_t count(const zx_packet_signal_t* from) { return from->count; }
static uint64_t timestamp(const zx_packet_signal_t* from) { return from->timestamp; }
static uint64_t reserved1(const zx_packet_signal_t* from) { return from->reserved1; }
private:
ZxPacketSignal() : Class("zx_packet_signal_t") {
AddField(std::make_unique<ClassField<zx_packet_signal_t, zx_signals_t>>(
"trigger", SyscallType::kSignals, trigger));
AddField(std::make_unique<ClassField<zx_packet_signal_t, zx_signals_t>>(
"observed", SyscallType::kSignals, observed));
AddField(std::make_unique<ClassField<zx_packet_signal_t, uint64_t>>(
"count", SyscallType::kUint64, count));
AddField(std::make_unique<ClassField<zx_packet_signal_t, uint64_t>>(
"timestamp", SyscallType::kTime, timestamp));
AddField(std::make_unique<ClassField<zx_packet_signal_t, uint64_t>>(
"reserved1", SyscallType::kUint64, reserved1));
}
ZxPacketSignal(const ZxPacketSignal&) = delete;
ZxPacketSignal& operator=(const ZxPacketSignal&) = delete;
static ZxPacketSignal* instance_;
};
ZxPacketSignal* ZxPacketSignal::instance_ = nullptr;
const ZxPacketSignal* ZxPacketSignal::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketSignal;
}
return instance_;
}
class ZxPacketGuestBell : public Class<zx_packet_guest_bell_t> {
public:
static const ZxPacketGuestBell* GetClass();
static zx_gpaddr_t addr(const zx_packet_guest_bell_t* from) { return from->addr; }
static uint64_t reserved0(const zx_packet_guest_bell_t* from) { return from->reserved0; }
static uint64_t reserved1(const zx_packet_guest_bell_t* from) { return from->reserved1; }
static uint64_t reserved2(const zx_packet_guest_bell_t* from) { return from->reserved2; }
private:
ZxPacketGuestBell() : Class("zx_packet_guest_bell_t") {
AddField(std::make_unique<ClassField<zx_packet_guest_bell_t, zx_gpaddr_t>>(
"addr", SyscallType::kGpAddr, addr));
AddField(std::make_unique<ClassField<zx_packet_guest_bell_t, uint64_t>>(
"reserved0", SyscallType::kUint64, reserved0));
AddField(std::make_unique<ClassField<zx_packet_guest_bell_t, uint64_t>>(
"reserved1", SyscallType::kUint64, reserved1));
AddField(std::make_unique<ClassField<zx_packet_guest_bell_t, uint64_t>>(
"reserved2", SyscallType::kUint64, reserved2));
}
ZxPacketGuestBell(const ZxPacketGuestBell&) = delete;
ZxPacketGuestBell& operator=(const ZxPacketGuestBell&) = delete;
static ZxPacketGuestBell* instance_;
};
ZxPacketGuestBell* ZxPacketGuestBell::instance_ = nullptr;
const ZxPacketGuestBell* ZxPacketGuestBell::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketGuestBell;
}
return instance_;
}
class ZxPacketGuestMemAArch64 : public Class<zx_packet_guest_mem_aarch64_t> {
public:
static const ZxPacketGuestMemAArch64* GetClass();
static zx_gpaddr_t addr(const zx_packet_guest_mem_aarch64_t* from) { return from->addr; }
static uint8_t access_size(const zx_packet_guest_mem_aarch64_t* from) {
return from->access_size;
}
static bool sign_extend(const zx_packet_guest_mem_aarch64_t* from) { return from->sign_extend; }
static uint8_t xt(const zx_packet_guest_mem_aarch64_t* from) { return from->xt; }
static bool read(const zx_packet_guest_mem_aarch64_t* from) { return from->read; }
static uint64_t data(const zx_packet_guest_mem_aarch64_t* from) { return from->data; }
static uint64_t reserved(const zx_packet_guest_mem_aarch64_t* from) { return from->reserved; }
private:
ZxPacketGuestMemAArch64() : Class("zx_packet_guest_mem_aarch64_t") {
AddField(std::make_unique<ClassField<zx_packet_guest_mem_aarch64_t, zx_gpaddr_t>>(
"addr", SyscallType::kGpAddr, addr));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_aarch64_t, uint8_t>>(
"access_size", SyscallType::kUint8, access_size));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_aarch64_t, bool>>(
"sign_extend", SyscallType::kBool, sign_extend));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_aarch64_t, uint8_t>>(
"xt", SyscallType::kUint8, xt));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_aarch64_t, bool>>(
"read", SyscallType::kBool, read));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_aarch64_t, uint64_t>>(
"data", SyscallType::kUint64, data));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_aarch64_t, uint64_t>>(
"reserved", SyscallType::kUint64, reserved));
}
ZxPacketGuestMemAArch64(const ZxPacketGuestMemAArch64&) = delete;
ZxPacketGuestMemAArch64& operator=(const ZxPacketGuestMemAArch64&) = delete;
static ZxPacketGuestMemAArch64* instance_;
};
ZxPacketGuestMemAArch64* ZxPacketGuestMemAArch64::instance_ = nullptr;
const ZxPacketGuestMemAArch64* ZxPacketGuestMemAArch64::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketGuestMemAArch64;
}
return instance_;
}
class ZxPacketGuestMemX86 : public Class<zx_packet_guest_mem_x86_t> {
public:
static const ZxPacketGuestMemX86* GetClass();
static zx_gpaddr_t addr(const zx_packet_guest_mem_x86_t* from) { return from->addr; }
static uint8_t inst_len(const zx_packet_guest_mem_x86_t* from) { return from->inst_len; }
static std::pair<const uint8_t*, int> inst_buf(const zx_packet_guest_mem_x86_t* from) {
return std::make_pair(reinterpret_cast<const uint8_t*>(from->inst_buf),
sizeof(from->inst_buf) / sizeof(uint8_t));
}
static uint8_t default_operand_size(const zx_packet_guest_mem_x86_t* from) {
return from->default_operand_size;
}
static std::pair<const uint8_t*, int> reserved(const zx_packet_guest_mem_x86_t* from) {
return std::make_pair(reinterpret_cast<const uint8_t*>(from->reserved),
sizeof(from->reserved) / sizeof(uint8_t));
}
private:
ZxPacketGuestMemX86() : Class("zx_packet_guest_mem_x86_t") {
AddField(std::make_unique<ClassField<zx_packet_guest_mem_x86_t, zx_gpaddr_t>>(
"addr", SyscallType::kGpAddr, addr));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_x86_t, uint8_t>>(
"inst_len", SyscallType::kUint8, inst_len));
AddField(std::make_unique<DynamicArrayField<zx_packet_guest_mem_x86_t, uint8_t, int>>(
"inst_buf", SyscallType::kUint8Hexa, inst_buf));
AddField(std::make_unique<ClassField<zx_packet_guest_mem_x86_t, uint8_t>>(
"default_operand_size", SyscallType::kUint8, default_operand_size));
AddField(std::make_unique<DynamicArrayField<zx_packet_guest_mem_x86_t, uint8_t, int>>(
"reserved", SyscallType::kUint8Hexa, reserved));
}
ZxPacketGuestMemX86(const ZxPacketGuestMemX86&) = delete;
ZxPacketGuestMemX86& operator=(const ZxPacketGuestMemX86&) = delete;
static ZxPacketGuestMemX86* instance_;
};
ZxPacketGuestMemX86* ZxPacketGuestMemX86::instance_ = nullptr;
const ZxPacketGuestMemX86* ZxPacketGuestMemX86::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketGuestMemX86;
}
return instance_;
}
class ZxPacketGuestIo : public Class<zx_packet_guest_io_t> {
public:
static const ZxPacketGuestIo* GetClass();
static uint16_t port(const zx_packet_guest_io_t* from) { return from->port; }
static uint8_t access_size(const zx_packet_guest_io_t* from) { return from->access_size; }
static bool input(const zx_packet_guest_io_t* from) { return from->input; }
static uint8_t u8(const zx_packet_guest_io_t* from) { return from->u8; }
static uint16_t u16(const zx_packet_guest_io_t* from) { return from->u16; }
static uint32_t u32(const zx_packet_guest_io_t* from) { return from->u32; }
static std::pair<const uint8_t*, int> data(const zx_packet_guest_io_t* from) {
return std::make_pair(reinterpret_cast<const uint8_t*>(from->data),
sizeof(from->data) / sizeof(uint8_t));
}
static uint64_t reserved0(const zx_packet_guest_io_t* from) { return from->reserved0; }
static uint64_t reserved1(const zx_packet_guest_io_t* from) { return from->reserved1; }
static uint64_t reserved2(const zx_packet_guest_io_t* from) { return from->reserved2; }
private:
ZxPacketGuestIo() : Class("zx_packet_guest_io_t") {
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, uint16_t>>(
"port", SyscallType::kUint16, port));
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, uint8_t>>(
"access_size", SyscallType::kUint8, access_size));
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, bool>>("input", SyscallType::kBool,
input));
AddField(
std::make_unique<ClassField<zx_packet_guest_io_t, uint8_t>>("u8", SyscallType::kUint8, u8));
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, uint16_t>>(
"u16", SyscallType::kUint16, u16));
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, uint32_t>>(
"u32", SyscallType::kUint32, u32));
AddField(std::make_unique<DynamicArrayField<zx_packet_guest_io_t, uint8_t, int>>(
"data", SyscallType::kUint8Hexa, data));
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, uint64_t>>(
"reserved0", SyscallType::kUint64, reserved0));
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, uint64_t>>(
"reserved1", SyscallType::kUint64, reserved1));
AddField(std::make_unique<ClassField<zx_packet_guest_io_t, uint64_t>>(
"reserved2", SyscallType::kUint64, reserved2));
}
ZxPacketGuestIo(const ZxPacketGuestIo&) = delete;
ZxPacketGuestIo& operator=(const ZxPacketGuestIo&) = delete;
static ZxPacketGuestIo* instance_;
};
ZxPacketGuestIo* ZxPacketGuestIo::instance_ = nullptr;
const ZxPacketGuestIo* ZxPacketGuestIo::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketGuestIo;
}
return instance_;
}
// This is extracted from zx_packet_vcpu from zircon/system/public/zircon/syscalls/port.h
struct zx_packet_guest_vcpu_interrupt {
uint64_t mask;
uint8_t vector;
};
using zx_packet_guest_vcpu_interrupt_t = struct zx_packet_guest_vcpu_interrupt;
class ZxPacketGuestVcpuInterrupt : public Class<zx_packet_guest_vcpu_interrupt_t> {
public:
static const ZxPacketGuestVcpuInterrupt* GetClass();
static uint64_t mask(const zx_packet_guest_vcpu_interrupt_t* from) { return from->mask; }
static uint8_t vector(const zx_packet_guest_vcpu_interrupt_t* from) { return from->vector; }
private:
ZxPacketGuestVcpuInterrupt() : Class("zx_packet_guest_vcpu_interrupt_t") {
AddField(std::make_unique<ClassField<zx_packet_guest_vcpu_interrupt_t, uint64_t>>(
"mask", SyscallType::kUint64, mask));
AddField(std::make_unique<ClassField<zx_packet_guest_vcpu_interrupt_t, uint8_t>>(
"vector", SyscallType::kUint8, vector));
}
ZxPacketGuestVcpuInterrupt(const ZxPacketGuestVcpuInterrupt&) = delete;
ZxPacketGuestVcpuInterrupt& operator=(const ZxPacketGuestVcpuInterrupt&) = delete;
static ZxPacketGuestVcpuInterrupt* instance_;
};
ZxPacketGuestVcpuInterrupt* ZxPacketGuestVcpuInterrupt::instance_ = nullptr;
const ZxPacketGuestVcpuInterrupt* ZxPacketGuestVcpuInterrupt::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketGuestVcpuInterrupt;
}
return instance_;
}
// This is extracted from zx_packet_vcpu from zircon/system/public/zircon/syscalls/port.h
struct zx_packet_guest_vcpu_startup {
uint64_t id;
zx_gpaddr_t entry;
};
using zx_packet_guest_vcpu_startup_t = struct zx_packet_guest_vcpu_startup;
class ZxPacketGuestVcpuStartup : public Class<zx_packet_guest_vcpu_startup_t> {
public:
static const ZxPacketGuestVcpuStartup* GetClass();
static uint64_t id(const zx_packet_guest_vcpu_startup_t* from) { return from->id; }
static zx_gpaddr_t entry(const zx_packet_guest_vcpu_startup_t* from) { return from->entry; }
private:
ZxPacketGuestVcpuStartup() : Class("zx_packet_guest_vcpu_startup_t") {
AddField(std::make_unique<ClassField<zx_packet_guest_vcpu_startup_t, uint64_t>>(
"id", SyscallType::kUint64, id));
AddField(std::make_unique<ClassField<zx_packet_guest_vcpu_startup_t, zx_gpaddr_t>>(
"entry", SyscallType::kGpAddr, entry));
}
ZxPacketGuestVcpuStartup(const ZxPacketGuestVcpuStartup&) = delete;
ZxPacketGuestVcpuStartup& operator=(const ZxPacketGuestVcpuStartup&) = delete;
static ZxPacketGuestVcpuStartup* instance_;
};
ZxPacketGuestVcpuStartup* ZxPacketGuestVcpuStartup::instance_ = nullptr;
const ZxPacketGuestVcpuStartup* ZxPacketGuestVcpuStartup::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketGuestVcpuStartup;
}
return instance_;
}
class ZxPacketGuestVcpu : public Class<zx_packet_guest_vcpu_t> {
public:
static const ZxPacketGuestVcpu* GetClass();
static const zx_packet_guest_vcpu_interrupt_t* interrupt(const zx_packet_guest_vcpu_t* from) {
return reinterpret_cast<const zx_packet_guest_vcpu_interrupt_t*>(&from->interrupt);
}
static const zx_packet_guest_vcpu_startup_t* startup(const zx_packet_guest_vcpu_t* from) {
return reinterpret_cast<const zx_packet_guest_vcpu_startup_t*>(&from->startup);
}
static uint8_t type(const zx_packet_guest_vcpu_t* from) { return from->type; }
static uint64_t reserved(const zx_packet_guest_vcpu_t* from) { return from->reserved; }
private:
ZxPacketGuestVcpu() : Class("zx_packet_guest_vcpu_t") {
auto type_field = AddField(std::make_unique<ClassField<zx_packet_guest_vcpu_t, uint8_t>>(
"type", SyscallType::kPacketGuestVcpuType, type));
AddField(
std::make_unique<ClassClassField<zx_packet_guest_vcpu_t, zx_packet_guest_vcpu_interrupt_t>>(
"interrupt", interrupt, ZxPacketGuestVcpuInterrupt::GetClass()))
->DisplayIfEqual(type_field, uint8_t(ZX_PKT_GUEST_VCPU_INTERRUPT));
AddField(
std::make_unique<ClassClassField<zx_packet_guest_vcpu_t, zx_packet_guest_vcpu_startup_t>>(
"startup", startup, ZxPacketGuestVcpuStartup::GetClass()))
->DisplayIfEqual(type_field, uint8_t(ZX_PKT_GUEST_VCPU_STARTUP));
AddField(std::make_unique<ClassField<zx_packet_guest_vcpu_t, uint64_t>>(
"reserved", SyscallType::kUint64, reserved));
}
ZxPacketGuestVcpu(const ZxPacketGuestVcpu&) = delete;
ZxPacketGuestVcpu& operator=(const ZxPacketGuestVcpu&) = delete;
static ZxPacketGuestVcpu* instance_;
};
ZxPacketGuestVcpu* ZxPacketGuestVcpu::instance_ = nullptr;
const ZxPacketGuestVcpu* ZxPacketGuestVcpu::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketGuestVcpu;
}
return instance_;
}
class ZxPacketInterrupt : public Class<zx_packet_interrupt_t> {
public:
static const ZxPacketInterrupt* GetClass();
static zx_time_t timestamp(const zx_packet_interrupt_t* from) { return from->timestamp; }
static uint64_t reserved0(const zx_packet_interrupt_t* from) { return from->reserved0; }
static uint64_t reserved1(const zx_packet_interrupt_t* from) { return from->reserved1; }
static uint64_t reserved2(const zx_packet_interrupt_t* from) { return from->reserved2; }
private:
ZxPacketInterrupt() : Class("zx_packet_interrupt_t") {
AddField(std::make_unique<ClassField<zx_packet_interrupt_t, zx_time_t>>(
"timestamp", SyscallType::kTime, timestamp));
AddField(std::make_unique<ClassField<zx_packet_interrupt_t, uint64_t>>(
"reserved0", SyscallType::kUint64, reserved0));
AddField(std::make_unique<ClassField<zx_packet_interrupt_t, uint64_t>>(
"reserved1", SyscallType::kUint64, reserved1));
AddField(std::make_unique<ClassField<zx_packet_interrupt_t, uint64_t>>(
"reserved2", SyscallType::kUint64, reserved2));
}
ZxPacketInterrupt(const ZxPacketInterrupt&) = delete;
ZxPacketInterrupt& operator=(const ZxPacketInterrupt&) = delete;
static ZxPacketInterrupt* instance_;
};
ZxPacketInterrupt* ZxPacketInterrupt::instance_ = nullptr;
const ZxPacketInterrupt* ZxPacketInterrupt::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketInterrupt;
}
return instance_;
}
class ZxPacketPageRequest : public Class<zx_packet_page_request_t> {
public:
static const ZxPacketPageRequest* GetClass();
static uint16_t command(const zx_packet_page_request_t* from) { return from->command; }
static uint16_t flags(const zx_packet_page_request_t* from) { return from->flags; }
static uint32_t reserved0(const zx_packet_page_request_t* from) { return from->reserved0; }
static uint64_t offset(const zx_packet_page_request_t* from) { return from->offset; }
static uint64_t length(const zx_packet_page_request_t* from) { return from->length; }
static uint64_t reserved1(const zx_packet_page_request_t* from) { return from->reserved1; }
private:
ZxPacketPageRequest() : Class("zx_packet_page_request_t") {
AddField(std::make_unique<ClassField<zx_packet_page_request_t, uint16_t>>(
"command", SyscallType::kPacketPageRequestCommand, command));
AddField(std::make_unique<ClassField<zx_packet_page_request_t, uint16_t>>(
"flags", SyscallType::kUint16, flags));
AddField(std::make_unique<ClassField<zx_packet_page_request_t, uint32_t>>(
"reserved0", SyscallType::kUint32, reserved0));
AddField(std::make_unique<ClassField<zx_packet_page_request_t, uint64_t>>(
"offset", SyscallType::kUint64, offset));
AddField(std::make_unique<ClassField<zx_packet_page_request_t, uint64_t>>(
"length", SyscallType::kUint64, length));
AddField(std::make_unique<ClassField<zx_packet_page_request_t, uint64_t>>(
"reserved1", SyscallType::kUint64, reserved1));
}
ZxPacketPageRequest(const ZxPacketPageRequest&) = delete;
ZxPacketPageRequest& operator=(const ZxPacketPageRequest&) = delete;
static ZxPacketPageRequest* instance_;
};
ZxPacketPageRequest* ZxPacketPageRequest::instance_ = nullptr;
const ZxPacketPageRequest* ZxPacketPageRequest::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPacketPageRequest;
}
return instance_;
}
class ZxPciBar : public Class<zx_pci_bar_t> {
public:
static const ZxPciBar* GetClass();
static uint32_t id(const zx_pci_bar_t* from) { return from->id; }
static uint32_t type(const zx_pci_bar_t* from) { return from->type; }
static size_t size(const zx_pci_bar_t* from) { return from->size; }
static uintptr_t addr(const zx_pci_bar_t* from) { return from->addr; }
static zx_handle_t handle(const zx_pci_bar_t* from) { return from->handle; }
private:
ZxPciBar() : Class("zx_pci_bar_t") {
AddField(std::make_unique<ClassField<zx_pci_bar_t, uint32_t>>("id", SyscallType::kUint32, id));
auto type_field = AddField(std::make_unique<ClassField<zx_pci_bar_t, uint32_t>>(
"type", SyscallType::kPciBarType, type));
AddField(std::make_unique<ClassField<zx_pci_bar_t, size_t>>("size", SyscallType::kSize, size))
->DisplayIfEqual(type_field, uint32_t(ZX_PCI_BAR_TYPE_PIO));
AddField(
std::make_unique<ClassField<zx_pci_bar_t, uintptr_t>>("addr", SyscallType::kUintptr, addr))
->DisplayIfEqual(type_field, uint32_t(ZX_PCI_BAR_TYPE_PIO));
AddField(std::make_unique<ClassField<zx_pci_bar_t, zx_handle_t>>("handle", SyscallType::kHandle,
handle))
->DisplayIfEqual(type_field, uint32_t(ZX_PCI_BAR_TYPE_MMIO));
}
ZxPciBar(const ZxPciBar&) = delete;
ZxPciBar& operator=(const ZxPciBar&) = delete;
static ZxPciBar* instance_;
};
ZxPciBar* ZxPciBar::instance_ = nullptr;
const ZxPciBar* ZxPciBar::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPciBar;
}
return instance_;
}
class ZxPcieDeviceInfo : public Class<zx_pcie_device_info_t> {
public:
static const ZxPcieDeviceInfo* GetClass();
static uint16_t vendor_id(const zx_pcie_device_info_t* from) { return from->vendor_id; }
static uint16_t device_id(const zx_pcie_device_info_t* from) { return from->device_id; }
static uint8_t base_class(const zx_pcie_device_info_t* from) { return from->base_class; }
static uint8_t sub_class(const zx_pcie_device_info_t* from) { return from->sub_class; }
static uint8_t program_interface(const zx_pcie_device_info_t* from) {
return from->program_interface;
}
static uint8_t revision_id(const zx_pcie_device_info_t* from) { return from->revision_id; }
static uint8_t bus_id(const zx_pcie_device_info_t* from) { return from->bus_id; }
static uint8_t dev_id(const zx_pcie_device_info_t* from) { return from->dev_id; }
static uint8_t func_id(const zx_pcie_device_info_t* from) { return from->func_id; }
private:
ZxPcieDeviceInfo() : Class("zx_pcie_device_info_t") {
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint16_t>>(
"vendor_id", SyscallType::kUint16, vendor_id));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint16_t>>(
"device_id", SyscallType::kUint16, device_id));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint8_t>>(
"base_class", SyscallType::kUint8, base_class));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint8_t>>(
"sub_class", SyscallType::kUint8, sub_class));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint8_t>>(
"program_interface", SyscallType::kUint8, program_interface));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint8_t>>(
"revision_id", SyscallType::kUint8, revision_id));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint8_t>>(
"bus_id", SyscallType::kUint8, bus_id));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint8_t>>(
"dev_id", SyscallType::kUint8, dev_id));
AddField(std::make_unique<ClassField<zx_pcie_device_info_t, uint8_t>>(
"func_id", SyscallType::kUint8, func_id));
}
ZxPcieDeviceInfo(const ZxPcieDeviceInfo&) = delete;
ZxPcieDeviceInfo& operator=(const ZxPcieDeviceInfo&) = delete;
static ZxPcieDeviceInfo* instance_;
};
ZxPcieDeviceInfo* ZxPcieDeviceInfo::instance_ = nullptr;
const ZxPcieDeviceInfo* ZxPcieDeviceInfo::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPcieDeviceInfo;
}
return instance_;
}
class ZxPciInitArgIrq : public Class<zx_pci_init_arg_irq_t> {
public:
static const ZxPciInitArgIrq* GetClass();
static uint32_t global_irq(const zx_pci_init_arg_irq_t* from) { return from->global_irq; }
static bool level_triggered(const zx_pci_init_arg_irq_t* from) { return from->level_triggered; }
static bool active_high(const zx_pci_init_arg_irq_t* from) { return from->active_high; }
private:
ZxPciInitArgIrq() : Class("zx_pci_init_arg_irq_t") {
AddField(std::make_unique<ClassField<zx_pci_init_arg_irq_t, uint32_t>>(
"global_irq", SyscallType::kUint32, global_irq));
AddField(std::make_unique<ClassField<zx_pci_init_arg_irq_t, bool>>(
"level_triggered", SyscallType::kBool, level_triggered));
AddField(std::make_unique<ClassField<zx_pci_init_arg_irq_t, bool>>(
"active_high", SyscallType::kBool, active_high));
}
ZxPciInitArgIrq(const ZxPciInitArgIrq&) = delete;
ZxPciInitArgIrq& operator=(const ZxPciInitArgIrq&) = delete;
static ZxPciInitArgIrq* instance_;
};
ZxPciInitArgIrq* ZxPciInitArgIrq::instance_ = nullptr;
const ZxPciInitArgIrq* ZxPciInitArgIrq::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPciInitArgIrq;
}
return instance_;
}
class ZxPciInitArgAddrWindow : public Class<zx_pci_init_arg_addr_window_t> {
public:
static const ZxPciInitArgAddrWindow* GetClass();
static uint64_t base(const zx_pci_init_arg_addr_window_t* from) { return from->base; }
static size_t size(const zx_pci_init_arg_addr_window_t* from) { return from->size; }
static uint8_t bus_start(const zx_pci_init_arg_addr_window_t* from) { return from->bus_start; }
static uint8_t bus_end(const zx_pci_init_arg_addr_window_t* from) { return from->bus_end; }
static uint8_t cfg_space_type(const zx_pci_init_arg_addr_window_t* from) {
return from->cfg_space_type;
}
static bool has_ecam(const zx_pci_init_arg_addr_window_t* from) { return from->has_ecam; }
private:
ZxPciInitArgAddrWindow() : Class("zx_pci_init_arg_addr_window_t") {
AddField(std::make_unique<ClassField<zx_pci_init_arg_addr_window_t, uint64_t>>(
"base", SyscallType::kUint64, base));
AddField(std::make_unique<ClassField<zx_pci_init_arg_addr_window_t, size_t>>(
"size", SyscallType::kSize, size));
AddField(std::make_unique<ClassField<zx_pci_init_arg_addr_window_t, uint8_t>>(
"bus_start", SyscallType::kUint8, bus_start));
AddField(std::make_unique<ClassField<zx_pci_init_arg_addr_window_t, uint8_t>>(
"bus_end", SyscallType::kUint8, bus_end));
AddField(std::make_unique<ClassField<zx_pci_init_arg_addr_window_t, uint8_t>>(
"cfg_space_type", SyscallType::kUint8, cfg_space_type));
AddField(std::make_unique<ClassField<zx_pci_init_arg_addr_window_t, bool>>(
"has_ecam", SyscallType::kBool, has_ecam));
}
ZxPciInitArgAddrWindow(const ZxPciInitArgAddrWindow&) = delete;
ZxPciInitArgAddrWindow& operator=(const ZxPciInitArgAddrWindow&) = delete;
static ZxPciInitArgAddrWindow* instance_;
};
ZxPciInitArgAddrWindow* ZxPciInitArgAddrWindow::instance_ = nullptr;
const ZxPciInitArgAddrWindow* ZxPciInitArgAddrWindow::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPciInitArgAddrWindow;
}
return instance_;
}
class ZxPciInitArg : public Class<zx_pci_init_arg_t> {
public:
static const ZxPciInitArg* GetClass();
static std::pair<const uint32_t*, int> dev_pin_to_global_irq(const zx_pci_init_arg_t* from) {
return std::make_pair(reinterpret_cast<const uint32_t*>(from->dev_pin_to_global_irq),
sizeof(from->dev_pin_to_global_irq) / sizeof(uint32_t));
}
static uint32_t num_irqs(const zx_pci_init_arg_t* from) { return from->num_irqs; }
static const zx_pci_init_arg_irq_t* irqs(const zx_pci_init_arg_t* from) {
return reinterpret_cast<const zx_pci_init_arg_irq_t*>(from->irqs);
}
static uint32_t addr_window_count(const zx_pci_init_arg_t* from) {
return from->addr_window_count;
}
static const zx_pci_init_arg_addr_window_t* addr_windows(const zx_pci_init_arg_t* from) {
return reinterpret_cast<const zx_pci_init_arg_addr_window_t*>(from->addr_windows);
}
private:
ZxPciInitArg() : Class("zx_pci_init_arg_t") {
AddField(std::make_unique<ArrayField<zx_pci_init_arg_t, uint32_t>>(
"dev_pin_to_global_irq", SyscallType::kUint32Hexa, dev_pin_to_global_irq));
AddField(std::make_unique<ClassField<zx_pci_init_arg_t, uint32_t>>(
"num_irqs", SyscallType::kUint32, num_irqs));
AddField(std::make_unique<DynamicArrayClassField<zx_pci_init_arg_t, zx_pci_init_arg_irq_t>>(
"irqs", irqs, num_irqs, ZxPciInitArgIrq::GetClass()));
AddField(std::make_unique<ClassField<zx_pci_init_arg_t, uint32_t>>(
"addr_window_count", SyscallType::kUint32, addr_window_count));
AddField(
std::make_unique<DynamicArrayClassField<zx_pci_init_arg_t, zx_pci_init_arg_addr_window_t>>(
"addr_windows", addr_windows, addr_window_count, ZxPciInitArgAddrWindow::GetClass()));
}
ZxPciInitArg(const ZxPciInitArg&) = delete;
ZxPciInitArg& operator=(const ZxPciInitArg&) = delete;
static ZxPciInitArg* instance_;
};
ZxPciInitArg* ZxPciInitArg::instance_ = nullptr;
const ZxPciInitArg* ZxPciInitArg::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPciInitArg;
}
return instance_;
}
class ZxPolicyBasic : public Class<zx_policy_basic_t> {
public:
static const ZxPolicyBasic* GetClass();
static uint32_t condition(const zx_policy_basic_t* from) { return from->condition; }
static uint32_t policy(const zx_policy_basic_t* from) { return from->policy; }
private:
ZxPolicyBasic() : Class("zx_policy_basic_t") {
AddField(std::make_unique<ClassField<zx_policy_basic_t, uint32_t>>(
"condition", SyscallType::kPolicyCondition, condition));
AddField(std::make_unique<ClassField<zx_policy_basic_t, uint32_t>>(
"policy", SyscallType::kPolicyAction, policy));
}
ZxPolicyBasic(const ZxPolicyBasic&) = delete;
ZxPolicyBasic& operator=(const ZxPolicyBasic&) = delete;
static ZxPolicyBasic* instance_;
};
ZxPolicyBasic* ZxPolicyBasic::instance_ = nullptr;
const ZxPolicyBasic* ZxPolicyBasic::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPolicyBasic;
}
return instance_;
}
class ZxPolicyTimerSlack : public Class<zx_policy_timer_slack_t> {
public:
static const ZxPolicyTimerSlack* GetClass();
static zx_duration_t min_slack(const zx_policy_timer_slack_t* from) { return from->min_slack; }
static uint32_t default_mode(const zx_policy_timer_slack_t* from) { return from->default_mode; }
private:
ZxPolicyTimerSlack() : Class("zx_policy_timer_slack_t") {
AddField(std::make_unique<ClassField<zx_policy_timer_slack_t, zx_duration_t>>(
"min_slack", SyscallType::kDuration, min_slack));
AddField(std::make_unique<ClassField<zx_policy_timer_slack_t, uint32_t>>(
"default_mode", SyscallType::kTimerOption, default_mode));
}
ZxPolicyTimerSlack(const ZxPolicyTimerSlack&) = delete;
ZxPolicyTimerSlack& operator=(const ZxPolicyTimerSlack&) = delete;
static ZxPolicyTimerSlack* instance_;
};
ZxPolicyTimerSlack* ZxPolicyTimerSlack::instance_ = nullptr;
const ZxPolicyTimerSlack* ZxPolicyTimerSlack::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPolicyTimerSlack;
}
return instance_;
}
class ZxPortPacket : public Class<zx_port_packet_t> {
public:
static const ZxPortPacket* GetClass();
static uint64_t key(const zx_port_packet_t* from) { return from->key; }
static uint32_t type(const zx_port_packet_t* from) { return from->type; }
static zx_status_t status(const zx_port_packet_t* from) { return from->status; }
static const zx_packet_user_t* user(const zx_port_packet_t* from) { return &from->user; }
static const zx_packet_signal_t* signal(const zx_port_packet_t* from) { return &from->signal; }
static const zx_packet_guest_bell_t* guest_bell(const zx_port_packet_t* from) {
return &from->guest_bell;
}
static const zx_packet_guest_mem_aarch64_t* guest_mem_aarch64(const zx_port_packet_t* from) {
return reinterpret_cast<const zx_packet_guest_mem_aarch64_t*>(&from->guest_mem);
}
static const zx_packet_guest_mem_x86_t* guest_mem_x86(const zx_port_packet_t* from) {
return reinterpret_cast<const zx_packet_guest_mem_x86_t*>(&from->guest_mem);
}
static const zx_packet_guest_io_t* guest_io(const zx_port_packet_t* from) {
return &from->guest_io;
}
static const zx_packet_guest_vcpu_t* guest_vcpu(const zx_port_packet_t* from) {
return &from->guest_vcpu;
}
static const zx_packet_interrupt_t* interrupt(const zx_port_packet_t* from) {
return &from->interrupt;
}
static const zx_packet_page_request_t* page_request(const zx_port_packet_t* from) {
return &from->page_request;
}
private:
ZxPortPacket() : Class("zx_port_packet_t") {
// Conditional field Ids
const uint8_t kZxPortPacket_ZX_PKT_TYPE_GUEST_MEM_Arm64 = 1;
const uint8_t kZxPortPacket_ZX_PKT_TYPE_GUEST_MEM_X64 = 2;
// Fields
AddField(
std::make_unique<ClassField<zx_port_packet_t, uint64_t>>("key", SyscallType::kUint64, key));
auto type_field = AddField(std::make_unique<ClassField<zx_port_packet_t, uint32_t>>(
"type", SyscallType::kPortPacketType, type));
AddField(std::make_unique<ClassField<zx_port_packet_t, zx_status_t>>(
"status", SyscallType::kStatus, status));
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_user_t>>(
"user", user, ZxPacketUser::GetClass()))
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_USER));
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_signal_t>>(
"signal", signal, ZxPacketSignal::GetClass()))
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_SIGNAL_ONE));
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_guest_bell_t>>(
"guest_bell", guest_bell, ZxPacketGuestBell::GetClass()))
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_GUEST_BELL));
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_guest_mem_aarch64_t>>(
"guest_mem", guest_mem_aarch64, ZxPacketGuestMemAArch64::GetClass()),
kZxPortPacket_ZX_PKT_TYPE_GUEST_MEM_Arm64)
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_GUEST_MEM))
->DisplayIfArch(debug::Arch::kArm64);
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_guest_mem_x86_t>>(
"guest_mem", guest_mem_x86, ZxPacketGuestMemX86::GetClass()),
kZxPortPacket_ZX_PKT_TYPE_GUEST_MEM_X64)
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_GUEST_MEM))
->DisplayIfArch(debug::Arch::kX64);
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_guest_io_t>>(
"guest_io", guest_io, ZxPacketGuestIo::GetClass()))
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_GUEST_IO));
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_guest_vcpu_t>>(
"guest_vcpu", guest_vcpu, ZxPacketGuestVcpu::GetClass()))
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_GUEST_VCPU));
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_interrupt_t>>(
"interrupt", interrupt, ZxPacketInterrupt::GetClass()))
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_INTERRUPT));
AddField(std::make_unique<ClassClassField<zx_port_packet_t, zx_packet_page_request_t>>(
"page_request", page_request, ZxPacketPageRequest::GetClass()))
->DisplayIfEqual(type_field, uint32_t(ZX_PKT_TYPE_PAGE_REQUEST));
}
ZxPortPacket(const ZxPortPacket&) = delete;
ZxPortPacket& operator=(const ZxPortPacket&) = delete;
static ZxPortPacket* instance_;
};
ZxPortPacket* ZxPortPacket::instance_ = nullptr;
const ZxPortPacket* ZxPortPacket::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxPortPacket;
}
return instance_;
}
class ZxProfileInfo : public Class<zx_profile_info_t> {
public:
static const ZxProfileInfo* GetClass();
static uint32_t flags(const zx_profile_info_t* from) { return from->flags; }
static int32_t priority(const zx_profile_info_t* from) { return from->priority; }
static const zx_cpu_set_t* cpu_affinity_mask(const zx_profile_info_t* from) {
return &from->cpu_affinity_mask;
}
private:
ZxProfileInfo() : Class("zx_profile_info_t") {
AddField(std::make_unique<ClassField<zx_profile_info_t, uint32_t>>(
"flags", SyscallType::kProfileInfoFlags, flags));
AddField(std::make_unique<ClassField<zx_profile_info_t, int32_t>>(
"priority", SyscallType::kInt32, priority));
AddField(std::make_unique<ClassClassField<zx_profile_info_t, zx_cpu_set_t>>(
"cpu_affinity_mask", cpu_affinity_mask, ZxCpuSet::GetClass()));
}
ZxProfileInfo(const ZxProfileInfo&) = delete;
ZxProfileInfo& operator=(const ZxProfileInfo&) = delete;
static ZxProfileInfo* instance_;
};
ZxProfileInfo* ZxProfileInfo::instance_ = nullptr;
const ZxProfileInfo* ZxProfileInfo::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxProfileInfo;
}
return instance_;
}
class ZxSmcParameters : public Class<zx_smc_parameters_t> {
public:
static const ZxSmcParameters* GetClass();
static uint32_t func_id(const zx_smc_parameters_t* from) { return from->func_id; }
static uint64_t arg1(const zx_smc_parameters_t* from) { return from->arg1; }
static uint64_t arg2(const zx_smc_parameters_t* from) { return from->arg2; }
static uint64_t arg3(const zx_smc_parameters_t* from) { return from->arg3; }
static uint64_t arg4(const zx_smc_parameters_t* from) { return from->arg4; }
static uint64_t arg5(const zx_smc_parameters_t* from) { return from->arg5; }
static uint64_t arg6(const zx_smc_parameters_t* from) { return from->arg6; }
static uint16_t client_id(const zx_smc_parameters_t* from) { return from->client_id; }
static uint16_t secure_os_id(const zx_smc_parameters_t* from) { return from->secure_os_id; }
private:
ZxSmcParameters() : Class("zx_smc_parameters_t") {
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint32_t>>(
"func_id", SyscallType::kUint32, func_id));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint64_t>>(
"arg1", SyscallType::kUint64, arg1));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint64_t>>(
"arg2", SyscallType::kUint64, arg2));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint64_t>>(
"arg3", SyscallType::kUint64, arg3));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint64_t>>(
"arg4", SyscallType::kUint64, arg4));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint64_t>>(
"arg5", SyscallType::kUint64, arg5));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint64_t>>(
"arg6", SyscallType::kUint64, arg6));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint16_t>>(
"client_id", SyscallType::kUint16, client_id));
AddField(std::make_unique<ClassField<zx_smc_parameters_t, uint16_t>>(
"secure_os_id", SyscallType::kUint16, secure_os_id));
}
ZxSmcParameters(const ZxSmcParameters&) = delete;
ZxSmcParameters& operator=(const ZxSmcParameters&) = delete;
static ZxSmcParameters* instance_;
};
ZxSmcParameters* ZxSmcParameters::instance_ = nullptr;
const ZxSmcParameters* ZxSmcParameters::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxSmcParameters;
}
return instance_;
}
class ZxSmcResult : public Class<zx_smc_result_t> {
public:
static const ZxSmcResult* GetClass();
static uint64_t arg0(const zx_smc_result_t* from) { return from->arg0; }
static uint64_t arg1(const zx_smc_result_t* from) { return from->arg1; }
static uint64_t arg2(const zx_smc_result_t* from) { return from->arg2; }
static uint64_t arg3(const zx_smc_result_t* from) { return from->arg3; }
static uint64_t arg6(const zx_smc_result_t* from) { return from->arg6; }
private:
ZxSmcResult() : Class("zx_smc_result_t") {
AddField(std::make_unique<ClassField<zx_smc_result_t, uint64_t>>("arg0", SyscallType::kUint64,
arg0));
AddField(std::make_unique<ClassField<zx_smc_result_t, uint64_t>>("arg1", SyscallType::kUint64,
arg1));
AddField(std::make_unique<ClassField<zx_smc_result_t, uint64_t>>("arg2", SyscallType::kUint64,
arg2));
AddField(std::make_unique<ClassField<zx_smc_result_t, uint64_t>>("arg3", SyscallType::kUint64,
arg3));
AddField(std::make_unique<ClassField<zx_smc_result_t, uint64_t>>("arg6", SyscallType::kUint64,
arg6));
}
ZxSmcResult(const ZxSmcResult&) = delete;
ZxSmcResult& operator=(const ZxSmcResult&) = delete;
static ZxSmcResult* instance_;
};
ZxSmcResult* ZxSmcResult::instance_ = nullptr;
const ZxSmcResult* ZxSmcResult::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxSmcResult;
}
return instance_;
}
class ZxSystemPowerctlArgAcpi : public Class<zx_system_powerctl_arg_t> {
public:
static const ZxSystemPowerctlArgAcpi* GetClass();
static uint8_t target_s_state(const zx_system_powerctl_arg_t* from) {
return from->acpi_transition_s_state.target_s_state;
}
static uint8_t sleep_type_a(const zx_system_powerctl_arg_t* from) {
return from->acpi_transition_s_state.sleep_type_a;
}
static uint8_t sleep_type_b(const zx_system_powerctl_arg_t* from) {
return from->acpi_transition_s_state.sleep_type_b;
}
private:
ZxSystemPowerctlArgAcpi() : Class("zx_system_powerctl_arg_t") {
AddField(std::make_unique<ClassField<zx_system_powerctl_arg_t, uint8_t>>(
"target_s_state", SyscallType::kUint8, target_s_state));
AddField(std::make_unique<ClassField<zx_system_powerctl_arg_t, uint8_t>>(
"sleep_type_a", SyscallType::kUint8, sleep_type_a));
AddField(std::make_unique<ClassField<zx_system_powerctl_arg_t, uint8_t>>(
"sleep_type_b", SyscallType::kUint8, sleep_type_b));
}
ZxSystemPowerctlArgAcpi(const ZxSystemPowerctlArgAcpi&) = delete;
ZxSystemPowerctlArgAcpi& operator=(const ZxSystemPowerctlArgAcpi&) = delete;
static ZxSystemPowerctlArgAcpi* instance_;
};
ZxSystemPowerctlArgAcpi* ZxSystemPowerctlArgAcpi::instance_ = nullptr;
const ZxSystemPowerctlArgAcpi* ZxSystemPowerctlArgAcpi::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxSystemPowerctlArgAcpi;
}
return instance_;
}
class ZxSystemPowerctlArgX86PowerLimit : public Class<zx_system_powerctl_arg_t> {
public:
static const ZxSystemPowerctlArgX86PowerLimit* GetClass();
static uint32_t power_limit(const zx_system_powerctl_arg_t* from) {
return from->x86_power_limit.power_limit;
}
static uint32_t time_window(const zx_system_powerctl_arg_t* from) {
return from->x86_power_limit.time_window;
}
static uint8_t clamp(const zx_system_powerctl_arg_t* from) { return from->x86_power_limit.clamp; }
static uint8_t enable(const zx_system_powerctl_arg_t* from) {
return from->x86_power_limit.enable;
}
private:
ZxSystemPowerctlArgX86PowerLimit() : Class("zx_system_powerctl_arg_t") {
AddField(std::make_unique<ClassField<zx_system_powerctl_arg_t, uint32_t>>(
"power_limit", SyscallType::kUint32, power_limit));
AddField(std::make_unique<ClassField<zx_system_powerctl_arg_t, uint32_t>>(
"time_window", SyscallType::kUint32, time_window));
AddField(std::make_unique<ClassField<zx_system_powerctl_arg_t, uint8_t>>(
"clamp", SyscallType::kUint8, clamp));
AddField(std::make_unique<ClassField<zx_system_powerctl_arg_t, uint8_t>>(
"enable", SyscallType::kUint8, enable));
}
ZxSystemPowerctlArgX86PowerLimit(const ZxSystemPowerctlArgX86PowerLimit&) = delete;
ZxSystemPowerctlArgX86PowerLimit& operator=(const ZxSystemPowerctlArgX86PowerLimit&) = delete;
static ZxSystemPowerctlArgX86PowerLimit* instance_;
};
ZxSystemPowerctlArgX86PowerLimit* ZxSystemPowerctlArgX86PowerLimit::instance_ = nullptr;
const ZxSystemPowerctlArgX86PowerLimit* ZxSystemPowerctlArgX86PowerLimit::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxSystemPowerctlArgX86PowerLimit;
}
return instance_;
}
class ZxThreadStateDebugRegsAArch64Bp : public Class<zx_thread_state_debug_regs_aarch64_bp_t> {
public:
static const ZxThreadStateDebugRegsAArch64Bp* GetClass();
static uint32_t dbgbcr(const zx_thread_state_debug_regs_aarch64_bp_t* from) {
return from->dbgbcr;
}
static uint64_t dbgbvr(const zx_thread_state_debug_regs_aarch64_bp_t* from) {
return from->dbgbvr;
}
private:
ZxThreadStateDebugRegsAArch64Bp() : Class("zx_thread_state_debug_regs_aarch64_bp_t") {
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_aarch64_bp_t, uint32_t>>(
"dbgbcr", SyscallType::kUint32Hexa, dbgbcr));
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_aarch64_bp_t, uint64_t>>(
"dbgbvr", SyscallType::kUint64Hexa, dbgbvr));
}
ZxThreadStateDebugRegsAArch64Bp(const ZxThreadStateDebugRegsAArch64Bp&) = delete;
ZxThreadStateDebugRegsAArch64Bp& operator=(const ZxThreadStateDebugRegsAArch64Bp&) = delete;
static ZxThreadStateDebugRegsAArch64Bp* instance_;
};
ZxThreadStateDebugRegsAArch64Bp* ZxThreadStateDebugRegsAArch64Bp::instance_ = nullptr;
const ZxThreadStateDebugRegsAArch64Bp* ZxThreadStateDebugRegsAArch64Bp::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxThreadStateDebugRegsAArch64Bp;
}
return instance_;
}
class ZxThreadStateDebugRegsAArch64Wp : public Class<zx_thread_state_debug_regs_aarch64_wp_t> {
public:
static const ZxThreadStateDebugRegsAArch64Wp* GetClass();
static uint32_t dbgwcr(const zx_thread_state_debug_regs_aarch64_wp_t* from) {
return from->dbgwcr;
}
static uint64_t dbgwvr(const zx_thread_state_debug_regs_aarch64_wp_t* from) {
return from->dbgwvr;
}
private:
ZxThreadStateDebugRegsAArch64Wp() : Class("zx_thread_state_debug_regs_aarch64_wp_t") {
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_aarch64_wp_t, uint32_t>>(
"dbgwcr", SyscallType::kUint32Hexa, dbgwcr));
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_aarch64_wp_t, uint64_t>>(
"dbgwvr", SyscallType::kUint64Hexa, dbgwvr));
}
ZxThreadStateDebugRegsAArch64Wp(const ZxThreadStateDebugRegsAArch64Wp&) = delete;
ZxThreadStateDebugRegsAArch64Wp& operator=(const ZxThreadStateDebugRegsAArch64Wp&) = delete;
static ZxThreadStateDebugRegsAArch64Wp* instance_;
};
ZxThreadStateDebugRegsAArch64Wp* ZxThreadStateDebugRegsAArch64Wp::instance_ = nullptr;
const ZxThreadStateDebugRegsAArch64Wp* ZxThreadStateDebugRegsAArch64Wp::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxThreadStateDebugRegsAArch64Wp;
}
return instance_;
}
class ZxThreadStateDebugRegsAArch64 : public Class<zx_thread_state_debug_regs_aarch64_t> {
public:
static const ZxThreadStateDebugRegsAArch64* GetClass();
static std::pair<const zx_thread_state_debug_regs_aarch64_bp_t*, int> hw_bps(
const zx_thread_state_debug_regs_aarch64_t* from) {
return std::make_pair(
reinterpret_cast<const zx_thread_state_debug_regs_aarch64_bp_t*>(from->hw_bps),
sizeof(from->hw_bps) / sizeof(from->hw_bps[0]));
}
static uint8_t hw_bps_count(const zx_thread_state_debug_regs_aarch64_t* from) {
return from->hw_bps_count;
}
static std::pair<const zx_thread_state_debug_regs_aarch64_wp_t*, int> hw_wps(
const zx_thread_state_debug_regs_aarch64_t* from) {
return std::make_pair(
reinterpret_cast<const zx_thread_state_debug_regs_aarch64_wp_t*>(from->hw_wps),
sizeof(from->hw_wps) / sizeof(from->hw_wps[0]));
}
static uint8_t hw_wps_count(const zx_thread_state_debug_regs_aarch64_t* from) {
return from->hw_wps_count;
}
static uint32_t esr(const zx_thread_state_debug_regs_aarch64_t* from) { return from->esr; }
private:
ZxThreadStateDebugRegsAArch64() : Class("zx_thread_state_debug_regs_aarch64_t") {
AddField(std::make_unique<ArrayClassField<zx_thread_state_debug_regs_aarch64_t,
zx_thread_state_debug_regs_aarch64_bp_t>>(
"hw_bps", hw_bps, ZxThreadStateDebugRegsAArch64Bp::GetClass()));
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_aarch64_t, uint8_t>>(
"hw_bps_count", SyscallType::kUint8Hexa, hw_bps_count));
AddField(std::make_unique<ArrayClassField<zx_thread_state_debug_regs_aarch64_t,
zx_thread_state_debug_regs_aarch64_wp_t>>(
"hw_wps", hw_wps, ZxThreadStateDebugRegsAArch64Wp::GetClass()));
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_aarch64_t, uint8_t>>(
"hw_wps_count", SyscallType::kUint8Hexa, hw_wps_count));
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_aarch64_t, uint32_t>>(
"esr", SyscallType::kUint32Hexa, esr));
}
ZxThreadStateDebugRegsAArch64(const ZxThreadStateDebugRegsAArch64&) = delete;
ZxThreadStateDebugRegsAArch64& operator=(const ZxThreadStateDebugRegsAArch64&) = delete;
static ZxThreadStateDebugRegsAArch64* instance_;
};
ZxThreadStateDebugRegsAArch64* ZxThreadStateDebugRegsAArch64::instance_ = nullptr;
const ZxThreadStateDebugRegsAArch64* ZxThreadStateDebugRegsAArch64::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxThreadStateDebugRegsAArch64;
}
return instance_;
}
class ZxThreadStateDebugRegsX86 : public Class<zx_thread_state_debug_regs_x86_t> {
public:
static const ZxThreadStateDebugRegsX86* GetClass();
static std::pair<const uint64_t*, int> dr(const zx_thread_state_debug_regs_x86_t* from) {
return std::make_pair(reinterpret_cast<const uint64_t*>(from->dr),
sizeof(from->dr) / sizeof(uint64_t));
}
static uint64_t dr6(const zx_thread_state_debug_regs_x86_t* from) { return from->dr6; }
static uint64_t dr7(const zx_thread_state_debug_regs_x86_t* from) { return from->dr7; }
private:
ZxThreadStateDebugRegsX86() : Class("zx_thread_state_debug_regs_x86_t") {
AddField(std::make_unique<DynamicArrayField<zx_thread_state_debug_regs_x86_t, uint64_t, int>>(
"dr", SyscallType::kUint64Hexa, dr));
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_x86_t, uint64_t>>(
"dr6", SyscallType::kUint64Hexa, dr6));
AddField(std::make_unique<ClassField<zx_thread_state_debug_regs_x86_t, uint64_t>>(
"dr7", SyscallType::kUint64Hexa, dr7));
}
ZxThreadStateDebugRegsX86(const ZxThreadStateDebugRegsX86&) = delete;
ZxThreadStateDebugRegsX86& operator=(const ZxThreadStateDebugRegsX86&) = delete;
static ZxThreadStateDebugRegsX86* instance_;
};
ZxThreadStateDebugRegsX86* ZxThreadStateDebugRegsX86::instance_ = nullptr;
const ZxThreadStateDebugRegsX86* ZxThreadStateDebugRegsX86::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxThreadStateDebugRegsX86;
}
return instance_;
}
class ZxThreadStateGeneralRegsAArch64 : public Class<zx_thread_state_general_regs_aarch64_t> {
public:
static const ZxThreadStateGeneralRegsAArch64* GetClass();
static std::pair<const uint64_t*, int> r(const zx_thread_state_general_regs_aarch64_t* from) {
return std::make_pair(reinterpret_cast<const uint64_t*>(from->r),
sizeof(from->r) / sizeof(uint64_t));
}
static uint64_t lr(const zx_thread_state_general_regs_aarch64_t* from) { return from->lr; }
static uint64_t sp(const zx_thread_state_general_regs_aarch64_t* from) { return from->sp; }
static uint64_t pc(const zx_thread_state_general_regs_aarch64_t* from) { return from->pc; }
static uint64_t cpsr(const zx_thread_state_general_regs_aarch64_t* from) { return from->cpsr; }
static uint64_t tpidr(const zx_thread_state_general_regs_aarch64_t* from) { return from->tpidr; }
private:
ZxThreadStateGeneralRegsAArch64() : Class("zx_thread_state_general_regs_aarch64_t") {
AddField(
std::make_unique<DynamicArrayField<zx_thread_state_general_regs_aarch64_t, uint64_t, int>>(
"r", SyscallType::kUint64Hexa, r));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_aarch64_t, uint64_t>>(
"lr", SyscallType::kUint64Hexa, lr));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_aarch64_t, uint64_t>>(
"sp", SyscallType::kUint64Hexa, sp));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_aarch64_t, uint64_t>>(
"pc", SyscallType::kUint64Hexa, pc));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_aarch64_t, uint64_t>>(
"cpsr", SyscallType::kUint64Hexa, cpsr));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_aarch64_t, uint64_t>>(
"tpidr", SyscallType::kUint64Hexa, tpidr));
}
ZxThreadStateGeneralRegsAArch64(const ZxThreadStateGeneralRegsAArch64&) = delete;
ZxThreadStateGeneralRegsAArch64& operator=(const ZxThreadStateGeneralRegsAArch64&) = delete;
static ZxThreadStateGeneralRegsAArch64* instance_;
};
ZxThreadStateGeneralRegsAArch64* ZxThreadStateGeneralRegsAArch64::instance_ = nullptr;
const ZxThreadStateGeneralRegsAArch64* ZxThreadStateGeneralRegsAArch64::GetClass() {
if (instance_ == nullptr) {
instance_ = new ZxThreadStateGeneralRegsAArch64;
}
return instance_;
}
class ZxThreadStateGeneralRegsX86 : public Class<zx_thread_state_general_regs_x86_t> {
public:
static const ZxThreadStateGeneralRegsX86* GetClass();
static uint64_t rax(const zx_thread_state_general_regs_x86_t* from) { return from->rax; }
static uint64_t rbx(const zx_thread_state_general_regs_x86_t* from) { return from->rbx; }
static uint64_t rcx(const zx_thread_state_general_regs_x86_t* from) { return from->rcx; }
static uint64_t rdx(const zx_thread_state_general_regs_x86_t* from) { return from->rdx; }
static uint64_t rsi(const zx_thread_state_general_regs_x86_t* from) { return from->rsi; }
static uint64_t rdi(const zx_thread_state_general_regs_x86_t* from) { return from->rdi; }
static uint64_t rbp(const zx_thread_state_general_regs_x86_t* from) { return from->rbp; }
static uint64_t rsp(const zx_thread_state_general_regs_x86_t* from) { return from->rsp; }
static uint64_t r8(const zx_thread_state_general_regs_x86_t* from) { return from->r8; }
static uint64_t r9(const zx_thread_state_general_regs_x86_t* from) { return from->r9; }
static uint64_t r10(const zx_thread_state_general_regs_x86_t* from) { return from->r10; }
static uint64_t r11(const zx_thread_state_general_regs_x86_t* from) { return from->r11; }
static uint64_t r12(const zx_thread_state_general_regs_x86_t* from) { return from->r12; }
static uint64_t r13(const zx_thread_state_general_regs_x86_t* from) { return from->r13; }
static uint64_t r14(const zx_thread_state_general_regs_x86_t* from) { return from->r14; }
static uint64_t r15(const zx_thread_state_general_regs_x86_t* from) { return from->r15; }
static uint64_t rip(const zx_thread_state_general_regs_x86_t* from) { return from->rip; }
static uint64_t rflags(const zx_thread_state_general_regs_x86_t* from) { return from->rflags; }
static uint64_t fs_base(const zx_thread_state_general_regs_x86_t* from) { return from->fs_base; }
static uint64_t gs_base(const zx_thread_state_general_regs_x86_t* from) { return from->gs_base; }
private:
ZxThreadStateGeneralRegsX86() : Class("zx_thread_state_general_regs_x86_t") {
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rax", SyscallType::kUint64Hexa, rax));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rbx", SyscallType::kUint64Hexa, rbx));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rcx", SyscallType::kUint64Hexa, rcx));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rdx", SyscallType::kUint64Hexa, rdx));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rsi", SyscallType::kUint64Hexa, rsi));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rdi", SyscallType::kUint64Hexa, rdi));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rbp", SyscallType::kUint64Hexa, rbp));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rsp", SyscallType::kUint64Hexa, rsp));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r8", SyscallType::kUint64Hexa, r8));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r9", SyscallType::kUint64Hexa, r9));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r10", SyscallType::kUint64Hexa, r10));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r11", SyscallType::kUint64Hexa, r11));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r12", SyscallType::kUint64Hexa, r12));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r13", SyscallType::kUint64Hexa, r13));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r14", SyscallType::kUint64Hexa, r14));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"r15", SyscallType::kUint64Hexa, r15));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rip", SyscallType::kUint64Hexa, rip));
AddField(std::make_unique<ClassField<zx_thread_state_general_regs_x86_t, uint64_t>>(
"rflags", SyscallType::kUint64Hexa, rflags