xref: /illumos-gate/usr/src/uts/intel/os/door_support.c (revision 533affcbc7fc4d0c8132976ea454aaa715fe2307)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #include <sys/types.h>
28 #include <sys/systm.h>
29 #include <sys/door.h>
30 #include <sys/proc.h>
31 #include <sys/thread.h>
32 #include <sys/stack.h>
33 #include <sys/privregs.h>
34 
35 int
36 door_finish_dispatch(caddr_t newsp)
37 {
38 	void lwp_setsp(klwp_t *, caddr_t);
39 
40 	/*
41 	 * If being traced, need to copy in syscall arguments for /proc
42 	 * before changing the sp.  In most cases, this will have no
43 	 * effect, since we'll have already done this in door_return().
44 	 */
45 	if (curthread->t_post_sys && PTOU(ttoproc(curthread))->u_systrap)
46 		(void) save_syscall_args();
47 	lwp_setsp(ttolwp(curthread), newsp);
48 	lwptoregs(ttolwp(curthread))->r_fp = 0;	/* stack ends here */
49 
50 	return (0);
51 }
52 
53 /*ARGSUSED*/
54 uintptr_t
55 door_final_sp(uintptr_t resultsp, size_t align, int datamodel)
56 {
57 	return (resultsp);
58 }
59