xref: /titanic_41/usr/src/uts/intel/amd64/krtld/kobj_crt.s (revision ba2e4443695ee6a6f420a35cd4fc3d3346d22932)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29/*
30 * exit routine from linker/loader to kernel
31 */
32
33#include <sys/asm_linkage.h>
34#include <sys/reboot.h>
35
36/*
37 *  exitto is called from main() and does 1 things
38 *	It then jumps directly to the just-loaded standalone.
39 *	There is NO RETURN from exitto().
40 */
41
42#if defined(lint)
43
44/* ARGSUSED */
45void
46exitto(caddr_t entrypoint)
47{}
48
49#else	/* lint */
50
51
52	ENTRY(exitto)
53
54	/preserve destination in temporary register %r11
55	movq	%rdi, %r11
56
57	/holds address of array of pointers to functions
58	/ $arg1
59	movq	$romp, %rax
60	movq    (%rax), %rdi
61
62	/holds address of bootops structure
63	/ $arg2
64	movq	$ops, %rax
65	movq    (%rax), %rdx
66
67	movq	boothowto, %rax
68	andq	$RB_DEBUGENTER, %rax
69	jz	1f
70
71	/ Enter the debugger
72	int	$T_DBGENTR
73
741:	/ Call destination
75	call   *%r11
76
77	SET_SIZE(exitto)
78
79#endif
80
81