blob: 63d49a523ed307f9407e805ca507bf293ad0dfca [file] [log] [blame]
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -07001/* Xen-specific pieces of head.S, intended to be included in the right
2 place in head.S */
3
4#ifdef CONFIG_XEN
5
6#include <linux/elfnote.h>
Sam Ravnborg08b6d292008-01-30 13:33:25 +01007#include <linux/init.h>
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -07008
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -07009#include <asm/boot.h>
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070010#include <asm/asm.h>
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070011#include <asm/page.h>
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070012
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070013#include <xen/interface/elfnote.h>
Jeremy Fitzhardinge7e0edc12008-05-31 01:33:04 +010014#include <asm/xen/interface.h>
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070015
Sam Ravnborg08b6d292008-01-30 13:33:25 +010016 __INIT
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070017ENTRY(startup_xen)
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070018 cld
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070019#ifdef CONFIG_X86_32
20 mov %esi,xen_start_info
21 mov $init_thread_union+THREAD_SIZE,%esp
22#else
23 mov %rsi,xen_start_info
24 mov $init_thread_union+THREAD_SIZE,%rsp
25#endif
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070026 jmp xen_start_kernel
Sam Ravnborg08b6d292008-01-30 13:33:25 +010027
28 __FINIT
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070029
Jeremy Fitzhardingea987b162008-06-16 15:01:56 -070030.pushsection .text
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070031 .align PAGE_SIZE_asm
32ENTRY(hypercall_page)
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070033 .skip PAGE_SIZE_asm
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070034.popsection
35
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070036 ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")
37 ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "2.6")
38 ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070039#ifdef CONFIG_X86_32
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070040 ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __PAGE_OFFSET)
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070041#else
42 ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __START_KERNEL_map)
43#endif
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070044 ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, _ASM_PTR startup_xen)
45 ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070046 ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb")
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070047 ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070048 ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
Jeremy Fitzhardinge7e0edc12008-05-31 01:33:04 +010049 ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
50 .quad _PAGE_PRESENT; .quad _PAGE_PRESENT)
51 ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070052 ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, _ASM_PTR __HYPERVISOR_VIRT_START)
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070053 ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, _ASM_PTR 0)
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070054
55#endif /*CONFIG_XEN */