1/* 2 * Copyright (c) 2007 Apple Inc. All rights reserved. 3 * 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. The rights granted to you under the License 10 * may not be used to create, or enable the creation or redistribution of, 11 * unlawful or unlicensed copies of an Apple operating system, or to 12 * circumvent, violate, or enable the circumvention or violation of, any 13 * terms of an Apple operating system software license agreement. 14 * 15 * Please obtain a copy of the License at 16 * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 * 18 * The Original Code and all software distributed under the License are 19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 * Please see the License for the specific language governing rights and 24 * limitations under the License. 25 * 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 */ 28 29/* 30 * CDDL HEADER START 31 * 32 * The contents of this file are subject to the terms of the 33 * Common Development and Distribution License, Version 1.0 only 34 * (the "License"). You may not use this file except in compliance 35 * with the License. 36 * 37 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 38 * or http://www.opensolaris.org/os/licensing. 39 * See the License for the specific language governing permissions 40 * and limitations under the License. 41 * 42 * When distributing Covered Code, include this CDDL HEADER in each 43 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 44 * If applicable, add the following below this CDDL HEADER, with the 45 * fields enclosed by brackets "[]" replaced with your own identifying 46 * information: Portions Copyright [yyyy] [name of copyright owner] 47 * 48 * CDDL HEADER END 49 */ 50/* 51 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 52 * Use is subject to license terms. 53 */ 54 55#ifndef _FASTTRAP_ISA_H 56#define _FASTTRAP_ISA_H 57 58/* #pragma ident "@(#)fasttrap_isa.h 1.4 05/06/08 SMI" */ 59 60#include <sys/types.h> 61#if defined(__APPLE__) 62#include <stdint.h> 63#endif 64 65#ifdef __cplusplus 66extern "C" { 67#endif 68 69typedef uint32_t fasttrap_instr_t; 70 71typedef struct fasttrap_machtp { 72 fasttrap_instr_t ftmt_instr; /* Original instruction */ 73 int32_t ftmt_trgt; /* Offset or absolute address */ 74 uint8_t ftmt_type; /* Emulation function type */ 75#define ftmtNOP 0 76#define ftmtCommon 1 77#define ftmtB 2 78#define ftmtBC 3 79#define ftmtBLR 4 80#define ftmtBCTR 5 81 uint8_t ftmt_bo; /* Branch options */ 82 uint8_t ftmt_bi; /* Condition bit */ 83 uint8_t ftmt_flgs; /* Flags */ 84#define ftmtAbs 2 85#define ftmtLink 1 86} fasttrap_machtp_t; 87 88#define ftt_instr ftt_mtp.ftmt_instr 89#define ftt_trgt ftt_mtp.ftmt_trgt 90#define ftt_type ftt_mtp.ftmt_type 91#define ftt_bo ftt_mtp.ftmt_bo 92#define ftt_bi ftt_mtp.ftmt_bi 93#define ftt_flgs ftt_mtp.ftmt_flgs 94 95#define FASTTRAP_INSTR 0x0FFFDDDD 96#define T_DTRACE_RET (0x2E * 4) 97 98#define FASTTRAP_RETURN_AFRAMES 7 99#define FASTTRAP_ENTRY_AFRAMES 7 100#define FASTTRAP_OFFSET_AFRAMES 6 101 102#ifdef __cplusplus 103} 104#endif 105 106#endif /* _FASTTRAP_ISA_H */ 107