dt_as.h revision 2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License, Version 1.0 only
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * (the "License"). You may not use this file except in compliance
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * or http://www.opensolaris.org/os/licensing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright/*
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown
cb174861876aea6950a7ab4ce944aff84b1914cdjoyce mcintosh#ifndef _DT_AS_H
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define _DT_AS_H
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#pragma ident "%Z%%M% %I% %E% SMI"
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#include <sys/types.h>
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#include <sys/dtrace.h>
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#ifdef __cplusplus
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossextern "C" {
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#endif
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rosstypedef struct dt_irnode {
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross uint_t di_label; /* label number or DT_LBL_NONE */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross dif_instr_t di_instr; /* instruction opcode */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross void *di_extern; /* opcode-specific external reference */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross struct dt_irnode *di_next; /* next instruction */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross} dt_irnode_t;
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#define DT_LBL_NONE 0 /* no label on this instruction */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rosstypedef struct dt_irlist {
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross dt_irnode_t *dl_list; /* pointer to first node in list */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross dt_irnode_t *dl_last; /* pointer to last node in list */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross uint_t dl_len; /* number of valid instructions */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross uint_t dl_label; /* next label number to assign */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross} dt_irlist_t;
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossextern void dt_irlist_create(dt_irlist_t *);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern void dt_irlist_destroy(dt_irlist_t *);
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borregoextern void dt_irlist_append(dt_irlist_t *, dt_irnode_t *);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern uint_t dt_irlist_label(dt_irlist_t *);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#ifdef __cplusplus
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif /* _DT_AS_H */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw