#ifndef _PCITOOL_UI_H
#define _PCITOOL_UI_H
#ifdef __cplusplus
extern "C" {
#endif
#define SUCCESS 0
#define FAILURE -1
#define NEXUS_FLAG 0x1
#define LEAF_FLAG 0x2
#define INTR_FLAG 0x4
#define PROBEDEV_FLAG 0x8
#define PROBETREE_FLAG 0x10
#define PROBEALL_FLAG 0x20
#define PROBERNG_FLAG 0x40
#define PROBE_FLAGS (PROBEDEV_FLAG | PROBETREE_FLAG | PROBEALL_FLAG | \
PROBERNG_FLAG)
#define ALL_COMMANDS (NEXUS_FLAG | LEAF_FLAG | INTR_FLAG | PROBE_FLAGS)
#define READ_FLAG 0x80
#define WRITE_FLAG 0x100
#define OFFSET_FLAG 0x200
#define SIZE_FLAG 0x400
#define ENDIAN_FLAG 0x800
#define BYTEDUMP_FLAG 0x1000
#define CHARDUMP_FLAG 0x2000
#define ERRCONT_FLAG 0x4000
#define VERBOSE_FLAG 0x8000
#define QUIET_FLAG 0x10000
#define LOOP_FLAG 0x20000
#define SHOWCTLR_FLAG 0x40000
#define SETGRP_FLAG 0x80000
#define BANK_SPEC_FLAG (0x10000ULL << 32)
#define BASE_SPEC_FLAG (0x20000ULL << 32)
#define BUS_SPEC_FLAG (0x40000ULL << 32)
#define DEV_SPEC_FLAG (0x80000ULL << 32)
#define FUNC_SPEC_FLAG (0x100000ULL << 32)
#define CPU_SPEC_FLAG (0x200000ULL << 32)
#define INO_ALL_FLAG (0x400000ULL << 32)
#define INO_SPEC_FLAG (0x800000ULL << 32)
#define MSI_ALL_FLAG (0x1000000ULL << 32)
#define MSI_SPEC_FLAG (0x2000000ULL << 32)
#define IS_VERBOSE(flags) (flags & VERBOSE_FLAG)
#define IS_QUIET(flags) (flags & QUIET_FLAG)
#define IS_LOOP(flags) (flags & LOOP_FLAG)
typedef struct uiargs {
uint64_t write_value;
uint64_t base_address;
uint64_t flags;
uint32_t offset;
uint32_t bytedump_amt;
uint32_t intr_cpu;
uint32_t old_cpu;
uint8_t bus;
uint8_t device;
uint8_t function;
uint8_t size;
uint8_t bank;
uint8_t intr_ino;
uint16_t intr_msi;
boolean_t big_endian;
} pcitool_uiargs_t;
int get_commandline_args(int argc, char *argv[], pcitool_uiargs_t *parsed_args);
void usage(char *name);
#ifdef __cplusplus
}
#endif
#endif