//! Auto-generated bindings to the DOF-related types in `dtrace.h`
/* automatically generated by rust-bindgen 0.57.0 */

#![allow(non_camel_case_types)]

use zerocopy::{AsBytes, FromBytes};

pub const DIF_VERSION_1: u32 = 1;
pub const DIF_VERSION_2: u32 = 2;
pub const DIF_VERSION: u32 = 2;
pub const DIF_DIR_NREGS: u32 = 8;
pub const DIF_DTR_NREGS: u32 = 8;
pub const DIF_OP_OR: u32 = 1;
pub const DIF_OP_XOR: u32 = 2;
pub const DIF_OP_AND: u32 = 3;
pub const DIF_OP_SLL: u32 = 4;
pub const DIF_OP_SRL: u32 = 5;
pub const DIF_OP_SUB: u32 = 6;
pub const DIF_OP_ADD: u32 = 7;
pub const DIF_OP_MUL: u32 = 8;
pub const DIF_OP_SDIV: u32 = 9;
pub const DIF_OP_UDIV: u32 = 10;
pub const DIF_OP_SREM: u32 = 11;
pub const DIF_OP_UREM: u32 = 12;
pub const DIF_OP_NOT: u32 = 13;
pub const DIF_OP_MOV: u32 = 14;
pub const DIF_OP_CMP: u32 = 15;
pub const DIF_OP_TST: u32 = 16;
pub const DIF_OP_BA: u32 = 17;
pub const DIF_OP_BE: u32 = 18;
pub const DIF_OP_BNE: u32 = 19;
pub const DIF_OP_BG: u32 = 20;
pub const DIF_OP_BGU: u32 = 21;
pub const DIF_OP_BGE: u32 = 22;
pub const DIF_OP_BGEU: u32 = 23;
pub const DIF_OP_BL: u32 = 24;
pub const DIF_OP_BLU: u32 = 25;
pub const DIF_OP_BLE: u32 = 26;
pub const DIF_OP_BLEU: u32 = 27;
pub const DIF_OP_LDSB: u32 = 28;
pub const DIF_OP_LDSH: u32 = 29;
pub const DIF_OP_LDSW: u32 = 30;
pub const DIF_OP_LDUB: u32 = 31;
pub const DIF_OP_LDUH: u32 = 32;
pub const DIF_OP_LDUW: u32 = 33;
pub const DIF_OP_LDX: u32 = 34;
pub const DIF_OP_RET: u32 = 35;
pub const DIF_OP_NOP: u32 = 36;
pub const DIF_OP_SETX: u32 = 37;
pub const DIF_OP_SETS: u32 = 38;
pub const DIF_OP_SCMP: u32 = 39;
pub const DIF_OP_LDGA: u32 = 40;
pub const DIF_OP_LDGS: u32 = 41;
pub const DIF_OP_STGS: u32 = 42;
pub const DIF_OP_LDTA: u32 = 43;
pub const DIF_OP_LDTS: u32 = 44;
pub const DIF_OP_STTS: u32 = 45;
pub const DIF_OP_SRA: u32 = 46;
pub const DIF_OP_CALL: u32 = 47;
pub const DIF_OP_PUSHTR: u32 = 48;
pub const DIF_OP_PUSHTV: u32 = 49;
pub const DIF_OP_POPTS: u32 = 50;
pub const DIF_OP_FLUSHTS: u32 = 51;
pub const DIF_OP_LDGAA: u32 = 52;
pub const DIF_OP_LDTAA: u32 = 53;
pub const DIF_OP_STGAA: u32 = 54;
pub const DIF_OP_STTAA: u32 = 55;
pub const DIF_OP_LDLS: u32 = 56;
pub const DIF_OP_STLS: u32 = 57;
pub const DIF_OP_ALLOCS: u32 = 58;
pub const DIF_OP_COPYS: u32 = 59;
pub const DIF_OP_STB: u32 = 60;
pub const DIF_OP_STH: u32 = 61;
pub const DIF_OP_STW: u32 = 62;
pub const DIF_OP_STX: u32 = 63;
pub const DIF_OP_ULDSB: u32 = 64;
pub const DIF_OP_ULDSH: u32 = 65;
pub const DIF_OP_ULDSW: u32 = 66;
pub const DIF_OP_ULDUB: u32 = 67;
pub const DIF_OP_ULDUH: u32 = 68;
pub const DIF_OP_ULDUW: u32 = 69;
pub const DIF_OP_ULDX: u32 = 70;
pub const DIF_OP_RLDSB: u32 = 71;
pub const DIF_OP_RLDSH: u32 = 72;
pub const DIF_OP_RLDSW: u32 = 73;
pub const DIF_OP_RLDUB: u32 = 74;
pub const DIF_OP_RLDUH: u32 = 75;
pub const DIF_OP_RLDUW: u32 = 76;
pub const DIF_OP_RLDX: u32 = 77;
pub const DIF_OP_XLATE: u32 = 78;
pub const DIF_OP_XLARG: u32 = 79;
pub const DIF_OP_STRIP: u32 = 80;
pub const DIF_INTOFF_MAX: u32 = 65535;
pub const DIF_STROFF_MAX: u32 = 65535;
pub const DIF_REGISTER_MAX: u32 = 255;
pub const DIF_VARIABLE_MAX: u32 = 65535;
pub const DIF_SUBROUTINE_MAX: u32 = 65535;
pub const DIF_VAR_ARRAY_MIN: u32 = 0;
pub const DIF_VAR_ARRAY_UBASE: u32 = 128;
pub const DIF_VAR_ARRAY_MAX: u32 = 255;
pub const DIF_VAR_OTHER_MIN: u32 = 256;
pub const DIF_VAR_OTHER_UBASE: u32 = 1280;
pub const DIF_VAR_OTHER_MAX: u32 = 65535;
pub const DIF_VAR_ARGS: u32 = 0;
pub const DIF_VAR_REGS: u32 = 1;
pub const DIF_VAR_UREGS: u32 = 2;
pub const DIF_VAR_CURTHREAD: u32 = 256;
pub const DIF_VAR_TIMESTAMP: u32 = 257;
pub const DIF_VAR_VTIMESTAMP: u32 = 258;
pub const DIF_VAR_IPL: u32 = 259;
pub const DIF_VAR_EPID: u32 = 260;
pub const DIF_VAR_ID: u32 = 261;
pub const DIF_VAR_ARG0: u32 = 262;
pub const DIF_VAR_ARG1: u32 = 263;
pub const DIF_VAR_ARG2: u32 = 264;
pub const DIF_VAR_ARG3: u32 = 265;
pub const DIF_VAR_ARG4: u32 = 266;
pub const DIF_VAR_ARG5: u32 = 267;
pub const DIF_VAR_ARG6: u32 = 268;
pub const DIF_VAR_ARG7: u32 = 269;
pub const DIF_VAR_ARG8: u32 = 270;
pub const DIF_VAR_ARG9: u32 = 271;
pub const DIF_VAR_STACKDEPTH: u32 = 272;
pub const DIF_VAR_CALLER: u32 = 273;
pub const DIF_VAR_PROBEPROV: u32 = 274;
pub const DIF_VAR_PROBEMOD: u32 = 275;
pub const DIF_VAR_PROBEFUNC: u32 = 276;
pub const DIF_VAR_PROBENAME: u32 = 277;
pub const DIF_VAR_PID: u32 = 278;
pub const DIF_VAR_TID: u32 = 279;
pub const DIF_VAR_EXECNAME: u32 = 280;
pub const DIF_VAR_ZONENAME: u32 = 281;
pub const DIF_VAR_WALLTIMESTAMP: u32 = 282;
pub const DIF_VAR_USTACKDEPTH: u32 = 283;
pub const DIF_VAR_UCALLER: u32 = 284;
pub const DIF_VAR_PPID: u32 = 285;
pub const DIF_VAR_UID: u32 = 286;
pub const DIF_VAR_GID: u32 = 287;
pub const DIF_VAR_ERRNO: u32 = 288;
pub const DIF_VAR_PTHREAD_SELF: u32 = 512;
pub const DIF_VAR_DISPATCHQADDR: u32 = 513;
pub const DIF_VAR_MACHTIMESTAMP: u32 = 514;
pub const DIF_VAR_CPU: u32 = 515;
pub const DIF_VAR_CPUINSTRS: u32 = 516;
pub const DIF_VAR_CPUCYCLES: u32 = 517;
pub const DIF_VAR_VINSTRS: u32 = 518;
pub const DIF_VAR_VCYCLES: u32 = 519;
pub const DIF_SUBR_RAND: u32 = 0;
pub const DIF_SUBR_MUTEX_OWNED: u32 = 1;
pub const DIF_SUBR_MUTEX_OWNER: u32 = 2;
pub const DIF_SUBR_MUTEX_TYPE_ADAPTIVE: u32 = 3;
pub const DIF_SUBR_MUTEX_TYPE_SPIN: u32 = 4;
pub const DIF_SUBR_RW_READ_HELD: u32 = 5;
pub const DIF_SUBR_RW_WRITE_HELD: u32 = 6;
pub const DIF_SUBR_RW_ISWRITER: u32 = 7;
pub const DIF_SUBR_COPYIN: u32 = 8;
pub const DIF_SUBR_COPYINSTR: u32 = 9;
pub const DIF_SUBR_SPECULATION: u32 = 10;
pub const DIF_SUBR_PROGENYOF: u32 = 11;
pub const DIF_SUBR_STRLEN: u32 = 12;
pub const DIF_SUBR_COPYOUT: u32 = 13;
pub const DIF_SUBR_COPYOUTSTR: u32 = 14;
pub const DIF_SUBR_ALLOCA: u32 = 15;
pub const DIF_SUBR_BCOPY: u32 = 16;
pub const DIF_SUBR_COPYINTO: u32 = 17;
pub const DIF_SUBR_MSGDSIZE: u32 = 18;
pub const DIF_SUBR_MSGSIZE: u32 = 19;
pub const DIF_SUBR_GETMAJOR: u32 = 20;
pub const DIF_SUBR_GETMINOR: u32 = 21;
pub const DIF_SUBR_DDI_PATHNAME: u32 = 22;
pub const DIF_SUBR_STRJOIN: u32 = 23;
pub const DIF_SUBR_LLTOSTR: u32 = 24;
pub const DIF_SUBR_BASENAME: u32 = 25;
pub const DIF_SUBR_DIRNAME: u32 = 26;
pub const DIF_SUBR_CLEANPATH: u32 = 27;
pub const DIF_SUBR_STRCHR: u32 = 28;
pub const DIF_SUBR_STRRCHR: u32 = 29;
pub const DIF_SUBR_STRSTR: u32 = 30;
pub const DIF_SUBR_STRTOK: u32 = 31;
pub const DIF_SUBR_SUBSTR: u32 = 32;
pub const DIF_SUBR_INDEX: u32 = 33;
pub const DIF_SUBR_RINDEX: u32 = 34;
pub const DIF_SUBR_HTONS: u32 = 35;
pub const DIF_SUBR_HTONL: u32 = 36;
pub const DIF_SUBR_HTONLL: u32 = 37;
pub const DIF_SUBR_NTOHS: u32 = 38;
pub const DIF_SUBR_NTOHL: u32 = 39;
pub const DIF_SUBR_NTOHLL: u32 = 40;
pub const DIF_SUBR_INET_NTOP: u32 = 41;
pub const DIF_SUBR_INET_NTOA: u32 = 42;
pub const DIF_SUBR_INET_NTOA6: u32 = 43;
pub const DIF_SUBR_TOUPPER: u32 = 44;
pub const DIF_SUBR_TOLOWER: u32 = 45;
pub const DIF_SUBR_JSON: u32 = 46;
pub const DIF_SUBR_STRTOLL: u32 = 47;
pub const DIF_SUBR_STRIP: u32 = 48;
pub const DIF_SUBR_MAX: u32 = 48;
pub const DIF_SUBR_APPLE_MIN: u32 = 200;
pub const DIF_SUBR_VM_KERNEL_ADDRPERM: u32 = 200;
pub const DIF_SUBR_KDEBUG_TRACE: u32 = 201;
pub const DIF_SUBR_KDEBUG_TRACE_STRING: u32 = 202;
pub const DIF_SUBR_APPLE_MAX: u32 = 202;
pub const DIF_INSTR_NOP: u32 = 603979776;
pub const DIF_INSTR_POPTS: u32 = 838860800;
pub const DIF_INSTR_FLUSHTS: u32 = 855638016;
pub const DIF_REG_R0: u32 = 0;
pub const DIF_TYPE_CTF: u32 = 0;
pub const DIF_TYPE_STRING: u32 = 1;
pub const DIF_TF_BYREF: u32 = 1;
pub const DIF_TF_BYUREF: u32 = 2;
pub const DOF_ID_SIZE: u32 = 16;
pub const DOF_ID_MAG0: u32 = 0;
pub const DOF_ID_MAG1: u32 = 1;
pub const DOF_ID_MAG2: u32 = 2;
pub const DOF_ID_MAG3: u32 = 3;
pub const DOF_ID_MODEL: u32 = 4;
pub const DOF_ID_ENCODING: u32 = 5;
pub const DOF_ID_VERSION: u32 = 6;
pub const DOF_ID_DIFVERS: u32 = 7;
pub const DOF_ID_DIFIREG: u32 = 8;
pub const DOF_ID_DIFTREG: u32 = 9;
pub const DOF_ID_PAD: u32 = 10;
pub const DOF_MAG_MAG0: u32 = 127;
pub const DOF_MAG_MAG1: u8 = 68u8;
pub const DOF_MAG_MAG2: u8 = 79u8;
pub const DOF_MAG_MAG3: u8 = 70u8;
pub const DOF_MAG_STRING: &'static [u8; 5usize] = b"\x7FDOF\0";
pub const DOF_MAG_STRLEN: u32 = 4;
pub const DOF_MODEL_NONE: u32 = 0;
pub const DOF_MODEL_ILP32: u32 = 1;
pub const DOF_MODEL_LP64: u32 = 2;
pub const DOF_MODEL_NATIVE: u32 = 2;
pub const DOF_ENCODE_NONE: u32 = 0;
pub const DOF_ENCODE_LSB: u32 = 1;
pub const DOF_ENCODE_MSB: u32 = 2;
pub const DOF_ENCODE_NATIVE: u32 = 1;

pub const DOF_VERSION_1: u32 = 1;
pub const DOF_VERSION_2: u32 = 2;
pub const DOF_VERSION_3: u32 = 3;
#[cfg(target_os = "macos")]
pub const DOF_VERSION: u32 = 3;
#[cfg(not(target_os = "macos"))]
pub const DOF_VERSION: u32 = 2;

pub const DOF_FL_VALID: u32 = 0;
pub const DOF_SECIDX_NONE: i32 = -1;
pub const DOF_STRIDX_NONE: i32 = -1;
pub const DOF_SECT_NONE: u32 = 0;
pub const DOF_SECT_COMMENTS: u32 = 1;
pub const DOF_SECT_SOURCE: u32 = 2;
pub const DOF_SECT_ECBDESC: u32 = 3;
pub const DOF_SECT_PROBEDESC: u32 = 4;
pub const DOF_SECT_ACTDESC: u32 = 5;
pub const DOF_SECT_DIFOHDR: u32 = 6;
pub const DOF_SECT_DIF: u32 = 7;
pub const DOF_SECT_STRTAB: u32 = 8;
pub const DOF_SECT_VARTAB: u32 = 9;
pub const DOF_SECT_RELTAB: u32 = 10;
pub const DOF_SECT_TYPTAB: u32 = 11;
pub const DOF_SECT_URELHDR: u32 = 12;
pub const DOF_SECT_KRELHDR: u32 = 13;
pub const DOF_SECT_OPTDESC: u32 = 14;
pub const DOF_SECT_PROVIDER: u32 = 15;
pub const DOF_SECT_PROBES: u32 = 16;
pub const DOF_SECT_PRARGS: u32 = 17;
pub const DOF_SECT_PROFFS: u32 = 18;
pub const DOF_SECT_INTTAB: u32 = 19;
pub const DOF_SECT_UTSNAME: u32 = 20;
pub const DOF_SECT_XLTAB: u32 = 21;
pub const DOF_SECT_XLMEMBERS: u32 = 22;
pub const DOF_SECT_XLIMPORT: u32 = 23;
pub const DOF_SECT_XLEXPORT: u32 = 24;
pub const DOF_SECT_PREXPORT: u32 = 25;
pub const DOF_SECT_PRENOFFS: u32 = 26;
pub const DOF_SECF_LOAD: u32 = 1;
pub const DOF_RELO_NONE: u32 = 0;
pub const DOF_RELO_SETX: u32 = 1;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dtrace_diftype {
    pub dtdt_kind: u8,
    pub dtdt_ckind: u8,
    pub dtdt_flags: u8,
    pub dtdt_pad: u8,
    pub dtdt_size: u32,
}
pub type dtrace_diftype_t = dtrace_diftype;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_hdr {
    pub dofh_ident: [u8; 16usize],
    pub dofh_flags: u32,
    pub dofh_hdrsize: u32,
    pub dofh_secsize: u32,
    pub dofh_secnum: u32,
    pub dofh_secoff: u64,
    pub dofh_loadsz: u64,
    pub dofh_filesz: u64,
    pub dofh_pad: u64,
}
pub type dof_hdr_t = dof_hdr;
pub type dof_secidx_t = u32;
pub type dof_stridx_t = u32;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_sec {
    pub dofs_type: u32,
    pub dofs_align: u32,
    pub dofs_flags: u32,
    pub dofs_entsize: u32,
    pub dofs_offset: u64,
    pub dofs_size: u64,
}
pub type dof_sec_t = dof_sec;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_ecbdesc {
    pub dofe_probes: dof_secidx_t,
    pub dofe_pred: dof_secidx_t,
    pub dofe_actions: dof_secidx_t,
    pub dofe_pad: u32,
    pub dofe_uarg: u64,
}
pub type dof_ecbdesc_t = dof_ecbdesc;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_probedesc {
    pub dofp_strtab: dof_secidx_t,
    pub dofp_provider: dof_stridx_t,
    pub dofp_mod: dof_stridx_t,
    pub dofp_func: dof_stridx_t,
    pub dofp_name: dof_stridx_t,
    pub dofp_id: u32,
}
pub type dof_probedesc_t = dof_probedesc;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_actdesc {
    pub dofa_difo: dof_secidx_t,
    pub dofa_strtab: dof_secidx_t,
    pub dofa_kind: u32,
    pub dofa_ntuple: u32,
    pub dofa_arg: u64,
    pub dofa_uarg: u64,
}
pub type dof_actdesc_t = dof_actdesc;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_difohdr {
    pub dofd_rtype: dtrace_diftype_t,
    pub dofd_links: [dof_secidx_t; 1usize],
}
pub type dof_difohdr_t = dof_difohdr;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_relohdr {
    pub dofr_strtab: dof_secidx_t,
    pub dofr_relsec: dof_secidx_t,
    pub dofr_tgtsec: dof_secidx_t,
}
pub type dof_relohdr_t = dof_relohdr;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_relodesc {
    pub dofr_name: dof_stridx_t,
    pub dofr_type: u32,
    pub dofr_offset: u64,
    pub dofr_data: u64,
}
pub type dof_relodesc_t = dof_relodesc;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_optdesc {
    pub dofo_option: u32,
    pub dofo_strtab: dof_secidx_t,
    pub dofo_value: u64,
}
pub type dof_optdesc_t = dof_optdesc;
pub type dof_attr_t = u32;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_provider {
    pub dofpv_strtab: dof_secidx_t,
    pub dofpv_probes: dof_secidx_t,
    pub dofpv_prargs: dof_secidx_t,
    pub dofpv_proffs: dof_secidx_t,
    pub dofpv_name: dof_stridx_t,
    pub dofpv_provattr: dof_attr_t,
    pub dofpv_modattr: dof_attr_t,
    pub dofpv_funcattr: dof_attr_t,
    pub dofpv_nameattr: dof_attr_t,
    pub dofpv_argsattr: dof_attr_t,
    pub dofpv_prenoffs: dof_secidx_t,
}
pub type dof_provider_t = dof_provider;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_probe {
    pub dofpr_addr: u64,
    pub dofpr_func: dof_stridx_t,
    pub dofpr_name: dof_stridx_t,
    pub dofpr_nargv: dof_stridx_t,
    pub dofpr_xargv: dof_stridx_t,
    pub dofpr_argidx: u32,
    pub dofpr_offidx: u32,
    pub dofpr_nargc: u8,
    pub dofpr_xargc: u8,
    pub dofpr_noffs: u16,
    pub dofpr_enoffidx: u32,
    pub dofpr_nenoffs: u16,
    pub dofpr_pad1: u16,
    pub dofpr_pad2: u32,
}
pub type dof_probe_t = dof_probe;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_xlator {
    pub dofxl_members: dof_secidx_t,
    pub dofxl_strtab: dof_secidx_t,
    pub dofxl_argv: dof_stridx_t,
    pub dofxl_argc: u32,
    pub dofxl_type: dof_stridx_t,
    pub dofxl_attr: dof_attr_t,
}
pub type dof_xlator_t = dof_xlator;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_xlmember {
    pub dofxm_difo: dof_secidx_t,
    pub dofxm_name: dof_stridx_t,
    pub dofxm_type: dtrace_diftype_t,
}
pub type dof_xlmember_t = dof_xlmember;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dof_xlref {
    pub dofxr_xlator: dof_secidx_t,
    pub dofxr_member: u32,
    pub dofxr_argn: u32,
}
pub type dof_xlref_t = dof_xlref;
#[repr(C)]
#[derive(AsBytes, FromBytes, Copy, Clone)]
pub struct dof_helper {
    pub dofhp_mod: [::std::os::raw::c_char; 64usize],
    pub dofhp_addr: u64,
    pub dofhp_dof: u64,
}
impl Default for dof_helper {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub type dof_helper_t = dof_helper;
#[repr(C)]
#[derive(AsBytes, FromBytes, Copy, Clone)]
pub struct dof_ioctl_data {
    pub dofiod_count: u64,
    pub dofiod_helpers: [dof_helper_t; 1usize],
}
impl Default for dof_ioctl_data {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub type dof_ioctl_data_t = dof_ioctl_data;
#[repr(C)]
#[derive(AsBytes, FromBytes, Debug, Default, Copy, Clone)]
pub struct dt_node {
    pub _address: u8,
}
