2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A#
define OP2(x) (((x) >>
22) &
0x07)
2N/A#
define COND(x) (((x) >>
25) &
0x0f)
2N/A#
define A(x) (((x) >>
29) &
0x01)
2N/A * Leave a dummy instruction in the last slot to simplify edge 2N/A * If we encounter an existing tracepoint, query the 2N/A * kernel to find out the instruction that was 2N/A * replaced at this spot. 2N/A "Pread() failed\n");
2N/A if ((
text[i] &
0xc1f80000) ==
0x81e00000) {
2N/A if ((
text[i] &
0xc1f80000) ==
0x81e80000) {
2N/A /* call or jmpl w/ restore in the slot */ 2N/A if (((
text[i] &
0xc0000000) ==
0x40000000 ||
2N/A (
text[i] &
0xc1f80000) ==
0x81c00000) &&
2N/A (
text[i +
1] &
0xc1f80000) ==
0x81e80000)
2N/A /* call to one of the stret routines */ 2N/A if ((
text[i] &
0xc0000000) ==
0x40000000) {
2N/A if ((
text[i] &
0xc0000000) ==
0x40000000) {
2N/A /* jmpl into %g0 -- this includes the retl pseudo op */ 2N/A if ((
text[i] &
0xfff80000) ==
0x81c00000)
2N/A /* external branch -- possible return site */ 2N/A * Interpret branches outside of the function's 2N/A * bounds as potential return sites. If the 2N/A * branch is a ba,a don't skip the instruction 2N/A * in the delay slot. 2N/A * If we're matching against everything, just iterate through each 2N/A * instruction in the function, otherwise look for matching offset 2N/A * names by constructing the string and comparing it against the