8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sgs / link_audit / common / mach.h
blobf489dd837eb4a1182b51f9b6bca486e915f09ce4
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _MACH_DOT_H
26 #define _MACH_DOT_H
28 #include <sys/reg.h>
29 #include <sys/types.h>
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #if defined(__sparc)
37 #define GETARG0(regset) regset->lr_rego0
38 #define GETARG1(regset) regset->lr_rego1
39 #define GETARG2(regset) regset->lr_rego2
40 #define GETARG3(regset) regset->lr_rego3
41 #define GETARG4(regset) regset->lr_rego4
42 #define GETARG5(regset) regset->lr_rego5
44 #define GETFRAME(regset) regset->lr_rego6
45 #define GETPREVPC(regset) regset->lr_rego7
47 #elif defined(__i386)
49 #define GETARG0(regset) (((ulong_t *)regset->lr_esp)[1])
50 #define GETARG1(regset) (((ulong_t *)regset->lr_esp)[2])
51 #define GETARG2(regset) (((ulong_t *)regset->lr_esp)[3])
52 #define GETARG3(regset) (((ulong_t *)regset->lr_esp)[4])
53 #define GETARG4(regset) (((ulong_t *)regset->lr_esp)[5])
54 #define GETARG5(regset) (((ulong_t *)regset->lr_esp)[6])
56 #define GETFRAME(regset) (regset->lr_ebp)
57 #define GETPREVPC(regset) (*(uintptr_t *)regset->lr_esp)
58 #elif defined(__amd64)
59 #define GETARG0(regset) regset->lr_rdi
60 #define GETARG1(regset) regset->lr_rsi
61 #define GETARG2(regset) regset->lr_rdx
62 #define GETARG3(regset) regset->lr_rcx
63 #define GETARG4(regset) regset->lr_r8
64 #define GETARG5(regset) regset->lr_r9
66 #define GETFRAME(regset) (regset->lr_rbp)
67 #define GETPREVPC(regset) (*(uintptr_t *)regset->lr_rsp)
68 #else
69 #error unsupported architecture!
70 #endif
73 #ifdef __cplusplus
75 #endif
77 #endif /* _MACH_DOT_H */