1*a864dc36Sdarran /* 2*a864dc36Sdarran * CDDL HEADER START 3*a864dc36Sdarran * 4*a864dc36Sdarran * The contents of this file are subject to the terms of the 5*a864dc36Sdarran * Common Development and Distribution License, Version 1.0 only 6*a864dc36Sdarran * (the "License"). You may not use this file except in compliance 7*a864dc36Sdarran * with the License. 8*a864dc36Sdarran * 9*a864dc36Sdarran * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*a864dc36Sdarran * or http://www.opensolaris.org/os/licensing. 11*a864dc36Sdarran * See the License for the specific language governing permissions 12*a864dc36Sdarran * and limitations under the License. 13*a864dc36Sdarran * 14*a864dc36Sdarran * When distributing Covered Code, include this CDDL HEADER in each 15*a864dc36Sdarran * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*a864dc36Sdarran * If applicable, add the following below this CDDL HEADER, with the 17*a864dc36Sdarran * fields enclosed by brackets "[]" replaced with your own identifying 18*a864dc36Sdarran * information: Portions Copyright [yyyy] [name of copyright owner] 19*a864dc36Sdarran * 20*a864dc36Sdarran * CDDL HEADER END 21*a864dc36Sdarran */ 22*a864dc36Sdarran /* 23*a864dc36Sdarran * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*a864dc36Sdarran * Use is subject to license terms. 25*a864dc36Sdarran */ 26*a864dc36Sdarran 27*a864dc36Sdarran #ifndef _DT_AS_H 28*a864dc36Sdarran #define _DT_AS_H 29*a864dc36Sdarran 30*a864dc36Sdarran #pragma ident "%Z%%M% %I% %E% SMI" 31*a864dc36Sdarran 32*a864dc36Sdarran #include <sys/types.h> 33*a864dc36Sdarran #include <sys/dtrace.h> 34*a864dc36Sdarran 35*a864dc36Sdarran #ifdef __cplusplus 36*a864dc36Sdarran extern "C" { 37*a864dc36Sdarran #endif 38*a864dc36Sdarran 39*a864dc36Sdarran typedef struct dt_irnode { 40*a864dc36Sdarran uint_t di_label; /* label number or DT_LBL_NONE */ 41*a864dc36Sdarran dif_instr_t di_instr; /* instruction opcode */ 42*a864dc36Sdarran void *di_extern; /* opcode-specific external reference */ 43*a864dc36Sdarran struct dt_irnode *di_next; /* next instruction */ 44*a864dc36Sdarran } dt_irnode_t; 45*a864dc36Sdarran 46*a864dc36Sdarran #define DT_LBL_NONE 0 /* no label on this instruction */ 47*a864dc36Sdarran 48*a864dc36Sdarran typedef struct dt_irlist { 49*a864dc36Sdarran dt_irnode_t *dl_list; /* pointer to first node in list */ 50*a864dc36Sdarran dt_irnode_t *dl_last; /* pointer to last node in list */ 51*a864dc36Sdarran uint_t dl_len; /* number of valid instructions */ 52*a864dc36Sdarran uint_t dl_label; /* next label number to assign */ 53*a864dc36Sdarran } dt_irlist_t; 54*a864dc36Sdarran 55*a864dc36Sdarran extern void dt_irlist_create(dt_irlist_t *); 56*a864dc36Sdarran extern void dt_irlist_destroy(dt_irlist_t *); 57*a864dc36Sdarran extern void dt_irlist_append(dt_irlist_t *, dt_irnode_t *); 58*a864dc36Sdarran extern uint_t dt_irlist_label(dt_irlist_t *); 59*a864dc36Sdarran 60*a864dc36Sdarran #ifdef __cplusplus 61*a864dc36Sdarran } 62*a864dc36Sdarran #endif 63*a864dc36Sdarran 64*a864dc36Sdarran #endif /* _DT_AS_H */ 65