dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / abi / apptrace / common / mach.h
blob12fbb0f05eb933c850efbcf34d6ea0f8dc29dd40
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _MACH_H
28 #define _MACH_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #include <sys/reg.h>
37 #include <sys/types.h>
39 #if defined(__sparc)
41 #define GETARG0(regset) regset->lr_rego0
42 #define GETARG1(regset) regset->lr_rego1
43 #define GETARG2(regset) regset->lr_rego2
44 #define GETARG3(regset) regset->lr_rego3
45 #define GETARG4(regset) regset->lr_rego4
46 #define GETARG5(regset) regset->lr_rego5
48 #define GETARG_6NUP(i, regset) (((ulong_t *)regset->lr_rego6)[23+i-6])
50 #define GETFRAME(regset) regset->lr_rego6
51 #define GETPREVPC(regset) regset->lr_rego7
53 #elif defined(__amd64)
55 #define GETARG0(regset) regset->lr_rdi
56 #define GETARG1(regset) regset->lr_rsi
57 #define GETARG2(regset) regset->lr_rdx
58 #define GETARG3(regset) regset->lr_rcx
59 #define GETARG4(regset) regset->lr_r8
60 #define GETARG5(regset) regset->lr_r9
62 #define GETARG_6NUP(i, regset) (((ulong_t *)regset->lr_rsp)[i+1-6])
64 #define GETFRAME(regset) (regset->lr_rbp)
65 #define GETPREVPC(regset) (*(uintptr_t *)regset->lr_rsp)
67 #elif defined(i386)
69 #define GETARG0(regset) (((ulong_t *)regset->lr_esp)[1])
70 #define GETARG1(regset) (((ulong_t *)regset->lr_esp)[2])
71 #define GETARG2(regset) (((ulong_t *)regset->lr_esp)[3])
72 #define GETARG3(regset) (((ulong_t *)regset->lr_esp)[4])
73 #define GETARG4(regset) (((ulong_t *)regset->lr_esp)[5])
74 #define GETARG5(regset) (((ulong_t *)regset->lr_esp)[6])
76 #define GETARG_6NUP(i, regset) (((ulong_t *)regset->lr_esp)[i+1])
78 #define GETFRAME(regset) (regset->lr_ebp)
79 #define GETPREVPC(regset) (*(uintptr_t *)regset->lr_esp)
80 #else
81 #error unsupported architecture!
82 #endif
84 #ifdef __cplusplus
86 #endif
88 #endif /* _MACH_H */