2 #include <linux/config.h>
5 .ascii "GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=3.0,VIRT_BASE=0xC0000000"
6 .ascii ",LOADER=generic"
10 #include <linux/threads.h>
11 #include <linux/linkage.h>
12 #include <asm/segment.h>
13 #include <asm/thread_info.h>
14 #include <asm/asm_offsets.h>
15 #include <asm-xen/xen-public/arch-x86_32.h>
18 * References to members of the new_cpu_data structure.
21 #define X86 new_cpu_data+CPUINFO_x86
22 #define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor
23 #define X86_MODEL new_cpu_data+CPUINFO_x86_model
24 #define X86_MASK new_cpu_data+CPUINFO_x86_mask
25 #define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math
26 #define X86_CPUID new_cpu_data+CPUINFO_cpuid_level
27 #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
28 #define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id
33 /* Copy the necessary stuff from xen_start_info structure. */
34 mov $xen_start_info_union,%edi
41 #endif /* CONFIG_SMP */
43 /* Set up the stack pointer */
49 xorl %eax,%eax # call CPUID with 0 -> return vendor ID
51 movl %eax,X86_CPUID # save CPUID level
52 movl %ebx,X86_VENDOR_ID # lo 4 chars
53 movl %edx,X86_VENDOR_ID+4 # next 4 chars
54 movl %ecx,X86_VENDOR_ID+8 # last 4 chars
56 movl $1,%eax # Use the CPUID instruction to get CPU type
58 movb %al,%cl # save reg for future use
59 andb $0x0f,%ah # mask processor family
61 andb $0xf0,%al # mask model
64 andb $0x0f,%cl # mask mask revision
66 movl %edx,X86_CAPABILITY
70 xorl %eax,%eax # Clear FS/GS and LDT
73 cld # gcc2 wants the direction flag cleared at all times
78 je 1f # the first CPU calls start_kernel
79 # all other CPUs call initialize_secondary
80 call initialize_secondary
83 #endif /* CONFIG_SMP */
86 jmp L6 # main should never return here, but
87 # just in case, we know what happens.
90 movl $(__KERNEL_DS),%eax # reload all the segment registers
91 movw %ax,%ss # after changing gdt.
93 movl $(__USER_DS),%eax # DS/ES contains default USER segment
97 popl %eax # reload CS by intersegment return
103 .long init_thread_union+THREAD_SIZE
112 .word 0 # 32-bit align idt_desc.address
114 .word IDT_ENTRIES*8-1 # idt contains 256 entries
117 # boot GDT descriptor (later on used by CPU#0):
118 .word 0 # 32 bit align gdt_desc.address
123 .fill NR_CPUS-1,8,0 # space for the other GDT descriptors
126 ENTRY(empty_zero_page)
129 ENTRY(swapper_pg_dir)
133 .quad 0x0000000000000000 /* NULL descriptor */
134 .quad 0x0000000000000000 /* 0x0b reserved */
135 .quad 0x0000000000000000 /* 0x13 reserved */
136 .quad 0x0000000000000000 /* 0x1b reserved */
137 .quad 0x0000000000000000 /* 0x20 unused */
138 .quad 0x0000000000000000 /* 0x28 unused */
139 .quad 0x0000000000000000 /* 0x33 TLS entry 1 */
140 .quad 0x0000000000000000 /* 0x3b TLS entry 2 */
141 .quad 0x0000000000000000 /* 0x43 TLS entry 3 */
142 .quad 0x0000000000000000 /* 0x4b reserved */
143 .quad 0x0000000000000000 /* 0x53 reserved */
144 .quad 0x0000000000000000 /* 0x5b reserved */
146 .quad 0x00cfbb000000c3ff /* 0x60 kernel 4GB code at 0x00000000 */
147 .quad 0x00cfb3000000c3ff /* 0x68 kernel 4GB data at 0x00000000 */
148 .quad 0x00cffb000000c3ff /* 0x73 user 4GB code at 0x00000000 */
149 .quad 0x00cff3000000c3ff /* 0x7b user 4GB data at 0x00000000 */
151 .quad 0x0000000000000000 /* 0x80 TSS descriptor */
152 .quad 0x0000000000000000 /* 0x88 LDT descriptor */
154 /* Segments used for calling PnP BIOS */
155 .quad 0x0000000000000000 /* 0x90 32-bit code */
156 .quad 0x0000000000000000 /* 0x98 16-bit code */
157 .quad 0x0000000000000000 /* 0xa0 16-bit data */
158 .quad 0x0000000000000000 /* 0xa8 16-bit data */
159 .quad 0x0000000000000000 /* 0xb0 16-bit data */
161 * The APM segments have byte granularity and their bases
162 * and limits are set at run time.
164 .quad 0x0000000000000000 /* 0xb8 APM CS code */
165 .quad 0x0000000000000000 /* 0xc0 APM CS 16 code (16 bit) */
166 .quad 0x0000000000000000 /* 0xc8 APM DS data */
168 .quad 0x0000000000000000 /* 0xd0 - unused */
169 .quad 0x0000000000000000 /* 0xd8 - unused */
170 .quad 0x0000000000000000 /* 0xe0 - unused */
171 .quad 0x0000000000000000 /* 0xe8 - unused */
172 .quad 0x0000000000000000 /* 0xf0 - unused */
173 .quad 0x0000000000000000 /* 0xf8 - GDT entry 31: double-fault TSS */
174 .fill GDT_ENTRIES-32,8,0
181 * Real beginning of normal "text" segment