8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / uts / i86pc / dboot / dboot_xen.s
blobdda17358d1bd5985b47faed6a41321f3f3ee7651
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 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/asm_linkage.h>
30 #include <sys/asm_misc.h>
31 #include "dboot_xboot.h"
33 #if defined(__lint)
35 #else /* __lint */
37 #if defined(__amd64)
39 ENTRY_NP(_start)
41 * At entry we are passed a (start_info_t *) in %rsi.
43 movq %rsi, xen_info(%rip)
46 * make sure we have sane processor state
48 xorw %ax, %ax
49 movw %ax, %fs
50 movw %ax, %gs
51 pushq $0
52 popfq
53 pushq $0
56 * go off and unpack the kernel bits, adjust page tables, etc.
58 call startup_kernel
61 * we can only setup a stack after startup_kernel().
62 * Its in the lower part of memroy.
64 leaq stack_space(%rip), %rsp
65 addq $STACK_SIZE, %rsp
66 andl $0xfffffff0, %esp
68 pushq $0x0 /* push a dead-end frame */
69 pushq $0x0
70 movq %rsp, %rbp
73 * when we get back, load the kernel entry point and jump to it
74 * The address of the xboot_info is the kernel's only argument.
76 movl entry_addr_low, %esi
77 movq $0xffffffff00000000,%rdx
78 orq %rdx, %rsi /* set upper bits of entry addr */
80 movl bi, %edi
81 call *%rsi
82 SET_SIZE(_start)
84 #elif defined(__i386)
86 ENTRY_NP(_start)
88 * At entry we are passed a (start_info_t *) in %esi.
90 movl %esi, xen_info
93 * make sure we have sane processor state
95 cld
96 xorw %ax, %ax
97 movw %ax, %fs
98 movw %ax, %gs
102 * go off and unpack the kernel bits, adjust page tables, etc.
104 call startup_kernel
107 * we can only setup a stack after startup_kernel().
109 movl $stack_space, %esp /* load my stack pointer */
110 addl $STACK_SIZE, %esp
112 pushl $0x0 /* push a dead-end frame */
113 pushl $0x0
114 movl %esp, %ebp
117 * when we get back, load the kernel entry point and jump to it
118 * The address of the xboot_info is the kernel's only argument.
120 movl entry_addr_low, %esi
121 movl bi, %eax
122 pushl %eax
123 call *%esi
124 SET_SIZE(_start)
126 #endif /* __i386 */
128 #endif /* __lint */