1242723Sjhibbits/*
2242723Sjhibbits * CDDL HEADER START
3242723Sjhibbits *
4242723Sjhibbits * The contents of this file are subject to the terms of the
5242723Sjhibbits * Common Development and Distribution License, Version 1.0 only
6242723Sjhibbits * (the "License").  You may not use this file except in compliance
7242723Sjhibbits * with the License.
8242723Sjhibbits *
9242723Sjhibbits * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10242723Sjhibbits * or http://www.opensolaris.org/os/licensing.
11242723Sjhibbits * See the License for the specific language governing permissions
12242723Sjhibbits * and limitations under the License.
13242723Sjhibbits *
14242723Sjhibbits * When distributing Covered Code, include this CDDL HEADER in each
15242723Sjhibbits * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16242723Sjhibbits * If applicable, add the following below this CDDL HEADER, with the
17242723Sjhibbits * fields enclosed by brackets "[]" replaced with your own identifying
18242723Sjhibbits * information: Portions Copyright [yyyy] [name of copyright owner]
19242723Sjhibbits *
20242723Sjhibbits * CDDL HEADER END
21242723Sjhibbits */
22256543Sjhibbits/* Portions Copyright 2013 Justin Hibbits */
23242723Sjhibbits/*
24242723Sjhibbits * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
25242723Sjhibbits * Use is subject to license terms.
26242723Sjhibbits */
27242723Sjhibbits
28242723Sjhibbits#ifndef	_FASTTRAP_ISA_H
29242723Sjhibbits#define	_FASTTRAP_ISA_H
30242723Sjhibbits
31242723Sjhibbits#pragma ident	"%Z%%M%	%I%	%E% SMI"
32242723Sjhibbits
33242723Sjhibbits#include <sys/types.h>
34242723Sjhibbits
35242723Sjhibbits#ifdef	__cplusplus
36242723Sjhibbitsextern "C" {
37242723Sjhibbits#endif
38242723Sjhibbits
39242723Sjhibbits#define	FASTTRAP_SUNWDTRACE_SIZE	64
40256543Sjhibbits#define FASTTRAP_INSTR			0x0FFFDDDD
41242723Sjhibbits
42256543Sjhibbitstypedef	uint32_t	fasttrap_instr_t;
43256543Sjhibbits
44256543Sjhibbitstypedef struct fasttrap_machtp_t {
45256543Sjhibbits	fasttrap_instr_t	ftmt_instr;	/* original instruction */
46256543Sjhibbits	uintptr_t		ftmt_dest;	/* branch target */
47256543Sjhibbits	uint8_t			ftmt_type;	/* emulation type */
48256543Sjhibbits	uint8_t			ftmt_flags;	/* emulation flags */
49256543Sjhibbits	uint8_t			ftmt_bo;	/* BO field */
50256543Sjhibbits	uint8_t			ftmt_bi;	/* BI field (CR bit) */
51256543Sjhibbits} fasttrap_machtp_t;
52256543Sjhibbits
53256543Sjhibbits#define	ftt_instr	ftt_mtp.ftmt_instr
54256543Sjhibbits#define	ftt_dest	ftt_mtp.ftmt_dest
55256543Sjhibbits#define	ftt_type	ftt_mtp.ftmt_type
56256543Sjhibbits#define	ftt_flags	ftt_mtp.ftmt_flags
57256543Sjhibbits#define	ftt_bo		ftt_mtp.ftmt_bo
58256543Sjhibbits#define	ftt_bi		ftt_mtp.ftmt_bi
59256543Sjhibbits
60256543Sjhibbits#define FASTTRAP_T_COMMON	0x00
61256543Sjhibbits#define FASTTRAP_T_B		0x01
62256543Sjhibbits#define FASTTRAP_T_BC		0x02
63256543Sjhibbits#define FASTTRAP_T_BLR		0x03
64256543Sjhibbits#define FASTTRAP_T_BCTR		0x04
65256543Sjhibbits#define FASTTRAP_T_NOP		0x05
66256543Sjhibbits
67256543Sjhibbits#define	FASTTRAP_AFRAMES		3
68256543Sjhibbits#define	FASTTRAP_RETURN_AFRAMES		4
69256543Sjhibbits#define	FASTTRAP_ENTRY_AFRAMES		3
70256543Sjhibbits#define	FASTTRAP_OFFSET_AFRAMES		3
71256543Sjhibbits
72242723Sjhibbits#ifdef	__cplusplus
73242723Sjhibbits}
74242723Sjhibbits#endif
75242723Sjhibbits
76242723Sjhibbits#endif	/* _FASTTRAP_ISA_H */
77