4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1993 by Sun Microsystems, Inc.
26 #pragma ident "%Z%%M% %I% %E% SMI"
29 * opcodes of the call instructions
32 * offset (in bytes) of the code from the entry address of a routine.
33 * (see asgnsamples for use and explanation.)
35 #define OFFSET_OF_CODE 0 /* there is no mask on a SPARC */
36 #define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
38 * address at which text begins N_TXTADDR is defined in a.out.h
41 extern size_t textbegin
;
42 #define TORIGIN (unsigned int) textbegin
44 #define TORIGIN ((unsigned long) N_TXTADDR(xbuf))
47 * Macros for manipulating instruction fields. These use the
48 * structures defined below
50 #define OP(x) (((union instruct *) (x))->f_1.op)
51 #define DISP30(x) (((union instruct *) (x))->f_1.disp30)
52 #define OP3(x) (((union instruct *) (x))->f_3c.op3)
53 #define RD(x) (((union instruct *) (x))->f_3c.rd)
54 #define IMMED(x) (((union instruct *) (x))->f_3c.i)
55 #define SIMM13(x) (((((union instruct *) (x))->f_3d.simm13) << 19) >> 19)
56 #define RS1(x) (((union instruct *) (x))->f_3c.rs1)
57 #define RS2(x) (((union instruct *) (x))->f_3c.rs2)
59 * a few values for operand and register fields
68 * A macro for converting from instructp to the appropriate address in
71 #define PC_VAL(x) ((x) - (unsigned long) textspace + TORIGIN)
73 * structures for decoding instructions