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 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Internal ISA-dependent functions.
39 * Note that some ISA-dependent functions are exposed to applications, and found
48 * ISA dependent function to determine if the instruction at the given address
49 * is a syscall instruction. On x86, we have multiple system call instructions.
50 * this function returns 1 if there is a system call at the given address, 2 if
51 * there is a less preferred system call, and 0 if there is no system call
54 extern int Pissyscall(struct ps_prochandle
*, uintptr_t);
56 * Works the same way as Pissyscall(), except operates on an in-memory buffer.
58 extern int Pissyscall_text(struct ps_prochandle
*, const void *buf
,
62 /* amd64 stack doubleword aligned, unaligned in 32-bit mode */
63 #define PSTACK_ALIGN32(sp) ((sp) & ~(2 * sizeof (int64_t) - 1))
64 #define PSTACK_ALIGN64(sp) (sp)
66 /* i386 stack is unaligned */
67 #define PSTACK_ALIGN32(sp) (sp)
68 #define PSTACK_ALIGN64(sp) ALIGN32(sp)
69 #elif defined(__sparc)
70 /* sparc stack is doubleword aligned for 64-bit values */
71 #define PSTACK_ALIGN32(sp) ((sp) & ~(2 * sizeof (int32_t) - 1))
72 #define PSTACK_ALIGN64(sp) ((sp) & ~(2 * sizeof (int64_t) - 1))
78 * Given an argument count, stack pointer, and syscall index, sets up the stack
79 * and appropriate registers. The stack pointer should be the top of the stack
80 * area, after any space reserved for arguments passed by reference. Returns a
81 * pointer which is later passed to Psyscall_copyargs().
83 extern uintptr_t Psyscall_setup(struct ps_prochandle
*, int, int, uintptr_t);
86 * Copies all arguments out to the stack once we're stopped before the syscall.
88 extern int Psyscall_copyinargs(struct ps_prochandle
*, int, argdes_t
*,
92 * Copies out arguments to their original values.
94 extern int Psyscall_copyoutargs(struct ps_prochandle
*, int, argdes_t
*,
101 #endif /* _PISADEP_H */