#ifndef _FASTTRAP_ISA_H
#define _FASTTRAP_ISA_H
#include <sys/types.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define FASTTRAP_MAX_INSTR_SIZE 15
#define FASTTRAP_INSTR 0xcc
#define FASTTRAP_SUNWDTRACE_SIZE 64
typedef uint8_t fasttrap_instr_t;
typedef struct fasttrap_machtp {
uint8_t ftmt_instr[FASTTRAP_MAX_INSTR_SIZE];
uint8_t ftmt_size;
#if __sol64 || defined(__APPLE__)
uint8_t ftmt_ripmode;
uint8_t ftmt_modrm;
#endif
uint8_t ftmt_type;
uint8_t ftmt_code;
uint8_t ftmt_base;
uint8_t ftmt_index;
uint8_t ftmt_scale;
uint8_t ftmt_segment;
user_addr_t ftmt_dest;
} fasttrap_machtp_t;
#define ftt_instr ftt_mtp.ftmt_instr
#if __sol64 || defined(__APPLE__)
#define ftt_ripmode ftt_mtp.ftmt_ripmode
#define ftt_modrm ftt_mtp.ftmt_modrm
#endif
#define ftt_size ftt_mtp.ftmt_size
#define ftt_type ftt_mtp.ftmt_type
#define ftt_code ftt_mtp.ftmt_code
#define ftt_base ftt_mtp.ftmt_base
#define ftt_index ftt_mtp.ftmt_index
#define ftt_scale ftt_mtp.ftmt_scale
#define ftt_segment ftt_mtp.ftmt_segment
#define ftt_dest ftt_mtp.ftmt_dest
#define FASTTRAP_T_COMMON 0x00
#define FASTTRAP_T_JCC 0x01
#define FASTTRAP_T_LOOP 0x02
#define FASTTRAP_T_JCXZ 0x03
#define FASTTRAP_T_JMP 0x04
#define FASTTRAP_T_CALL 0x05
#define FASTTRAP_T_RET 0x06
#define FASTTRAP_T_RET16 0x07
#define FASTTRAP_T_PUSHL_EBP 0x10
#define FASTTRAP_T_NOP 0x11
#define FASTTRAP_RIP_1 0x1
#define FASTTRAP_RIP_2 0x2
#define FASTTRAP_RIP_X 0x4
#define FASTTRAP_SEG_NONE 0
#define FASTTRAP_SEG_CS 1
#define FASTTRAP_SEG_DS 2
#define FASTTRAP_SEG_ES 3
#define FASTTRAP_SEG_FS 4
#define FASTTRAP_SEG_GS 5
#define FASTTRAP_SEG_SS 6
#define FASTTRAP_RETURN_AFRAMES 6
#define FASTTRAP_ENTRY_AFRAMES 5
#define FASTTRAP_OFFSET_AFRAMES 5
#ifdef __cplusplus
}
#endif
#endif