]>
git.saurik.com Git - apple/xnu.git/blob - bsd/i386/dis_tables.h
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 /* Copyright (c) 1988 AT&T */
27 /* All Rights Reserved */
33 /* #pragma ident "@(#)dis_tables.h 1.10 07/07/10 SMI" */
36 * Constants and prototypes for the IA32 disassembler backend. See dis_tables.c
37 * for usage information and documentation.
44 #if !defined(__APPLE__)
45 #include <sys/types.h>
46 #include <sys/inttypes.h>
47 #include <sys/param.h>
49 #include <sys/types.h>
51 #include <sys/param.h>
52 #endif /* __APPLE__ */
63 #define NCPS 12 /* number of chars per symbol */
66 * data structures that must be provided to dtrace_dis86()
68 typedef struct d86opnd
{
69 char d86_opnd
[OPLEN
]; /* symbolic rep of operand */
70 char d86_prefix
[PFIXLEN
]; /* any prefix string or "" */
71 uint_t d86_mode
; /* mode for immediate */
72 uint_t d86_value_size
; /* size in bytes of d86_value */
73 uint64_t d86_value
; /* immediate value of opnd */
76 typedef struct dis86
{
79 uint_t d86_len
; /* instruction length */
80 int d86_rmindex
; /* index of modrm byte or -1 */
81 uint_t d86_memsize
; /* size of memory referenced */
82 char d86_bytes
[16]; /* bytes of instruction */
85 uint_t d86_rex_prefix
; /* value of REX prefix if !0 */
86 char *d86_seg_prefix
; /* segment prefix, if any */
90 struct d86opnd d86_opnd
[4]; /* up to 4 operands */
91 int (*d86_check_func
)(void *);
92 int (*d86_get_byte
)(void *);
94 int (*d86_sym_lookup
)(void *, uint64_t, char *, size_t);
95 int (*d86_sprintf_func
)(char *, size_t, const char *, ...);
102 extern int dtrace_disx86(dis86_t
*x
, uint_t cpu_mode
);
104 #define DIS_F_OCTAL 0x1 /* Print all numbers in octal */
105 #define DIS_F_NOIMMSYM 0x2 /* Don't print symbols for immediates (.o) */
108 extern void dtrace_disx86_str(dis86_t
*x
, uint_t cpu_mode
, uint64_t pc
,
109 char *buf
, size_t len
);
116 #endif /* _DIS_TABLES_H */