Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Trunk/i386/include/i386/fasttrap_isa.h

1/*
2 * CDDL HEADER START
3 *
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.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef_FASTTRAP_ISA_H
27#define_FASTTRAP_ISA_H
28
29/*
30 * #pragma ident"@(#)fasttrap_isa.h1.606/09/19 SMI"
31 */
32
33#include <sys/types.h>
34#include <stdint.h>
35
36#ifdef__cplusplus
37extern "C" {
38#endif
39
40#defineFASTTRAP_MAX_INSTR_SIZE15
41
42#defineFASTTRAP_INSTR0xcc
43
44#defineFASTTRAP_SUNWDTRACE_SIZE64
45
46typedefuint8_tfasttrap_instr_t;
47
48typedef struct fasttrap_machtp {
49uint8_tftmt_instr[FASTTRAP_MAX_INSTR_SIZE]; /* orig. instr. */
50uint8_tftmt_size;/* instruction size */
51#if __sol64 || defined(__APPLE__)
52uint8_tftmt_ripmode;/* %rip-relative handling mode */
53uint8_tftmt_modrm;/* saved modrm byte */
54#endif
55uint8_tftmt_type;/* emulation type */
56uint8_tftmt_code;/* branch condition */
57uint8_tftmt_base;/* branch base */
58uint8_tftmt_index;/* branch index */
59uint8_tftmt_scale;/* branch scale */
60uint8_tftmt_segment;/* segment for memory accesses */
61user_addr_tftmt_dest;/* destination of control flow */
62} fasttrap_machtp_t;
63
64#defineftt_instrftt_mtp.ftmt_instr
65#if __sol64 || defined(__APPLE__)
66#defineftt_ripmodeftt_mtp.ftmt_ripmode
67#defineftt_modrmftt_mtp.ftmt_modrm
68#endif
69#defineftt_sizeftt_mtp.ftmt_size
70#defineftt_typeftt_mtp.ftmt_type
71#defineftt_codeftt_mtp.ftmt_code
72#defineftt_baseftt_mtp.ftmt_base
73#defineftt_indexftt_mtp.ftmt_index
74#defineftt_scaleftt_mtp.ftmt_scale
75#defineftt_segmentftt_mtp.ftmt_segment
76#defineftt_destftt_mtp.ftmt_dest
77
78#defineFASTTRAP_T_COMMON0x00/* common case -- no emulation */
79#defineFASTTRAP_T_JCC0x01/* near and far conditional jumps */
80#defineFASTTRAP_T_LOOP0x02/* loop instructions */
81#defineFASTTRAP_T_JCXZ0x03/* jump if %ecx/%rcx is zero */
82#defineFASTTRAP_T_JMP0x04/* relative jump */
83#defineFASTTRAP_T_CALL0x05/* near call (and link) */
84#defineFASTTRAP_T_RET0x06/* ret */
85#defineFASTTRAP_T_RET160x07/* ret <imm16> */
86
87/*
88 * For performance rather than correctness.
89 */
90#defineFASTTRAP_T_PUSHL_EBP0x10/* pushl %ebp (for function entry) */
91#defineFASTTRAP_T_NOP0x11/* nop */
92
93#defineFASTTRAP_RIP_10x1
94#defineFASTTRAP_RIP_20x2
95#defineFASTTRAP_RIP_X0x4
96
97/*
98 * Segment values.
99 */
100#defineFASTTRAP_SEG_NONE0
101#defineFASTTRAP_SEG_CS1
102#defineFASTTRAP_SEG_DS2
103#defineFASTTRAP_SEG_ES3
104#defineFASTTRAP_SEG_FS4
105#defineFASTTRAP_SEG_GS5
106#defineFASTTRAP_SEG_SS6
107
108#defineFASTTRAP_RETURN_AFRAMES6
109#defineFASTTRAP_ENTRY_AFRAMES5
110#defineFASTTRAP_OFFSET_AFRAMES5
111
112#ifdef__cplusplus
113}
114#endif
115
116#endif/* _FASTTRAP_ISA_H */
117

Archive Download this file

Revision: 1622