The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/amd64/amd64/xen-locore.S

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2003 Peter Wemm <peter@FreeBSD.org>
    3  * Copyright (c) 2011-2012 Spectra Logic Corporation
    4  * Copyright (c) 2013 Roger Pau Monne <royger@FreeBSD.org>
    5  * All rights reserved.
    6  *
    7  * This software was developed by Cherry G. Mathew <cherry@zyx.in>
    8  * under sponsorship from Spectra Logic Corporation.
    9  *
   10  * Redistribution and use in source and binary forms, with or without
   11  * modification, are permitted provided that the following conditions
   12  * are met:
   13  * 1. Redistributions of source code must retain the above copyright
   14  *    notice, this list of conditions and the following disclaimer.
   15  * 2. Redistributions in binary form must reproduce the above copyright
   16  *    notice, this list of conditions and the following disclaimer in the
   17  *    documentation and/or other materials provided with the distribution.
   18  *
   19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   29  * SUCH DAMAGE.
   30  *
   31  * $FreeBSD: releng/11.1/sys/amd64/amd64/xen-locore.S 284870 2015-06-26 07:12:17Z royger $
   32  */
   33 
   34 #include <machine/asmacros.h>
   35 #include <machine/psl.h>
   36 #include <machine/pmap.h>
   37 #include <machine/specialreg.h>
   38 
   39 #include <xen/xen-os.h>
   40 #define __ASSEMBLY__
   41 #include <xen/interface/elfnote.h>
   42 
   43 #include "assym.s"
   44 
   45 .section __xen_guest
   46         ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz, "FreeBSD")
   47         ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz, __XSTRING(__FreeBSD_version))
   48         ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz, "xen-3.0")
   49         ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      .quad,  KERNBASE)
   50         ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   .quad,  0)
   51         ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad,  xen_start)
   52         ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad,  hypercall_page)
   53         ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   .quad,  HYPERVISOR_VIRT_START)
   54         ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, "writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel|hvm_callback_vector")
   55         ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
   56         ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .long,  PG_V, PG_V)
   57         ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
   58         ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long,  0)
   59         ELFNOTE(Xen, XEN_ELFNOTE_BSD_SYMTAB,     .asciz, "yes")
   60 
   61         .text
   62 .p2align PAGE_SHIFT, 0x90       /* Hypercall_page needs to be PAGE aligned */
   63 
   64 NON_GPROF_ENTRY(hypercall_page)
   65         .skip   0x1000, 0x90    /* Fill with "nop"s */
   66 
   67 NON_GPROF_ENTRY(xen_start)
   68         /* Don't trust what the loader gives for rflags. */
   69         pushq   $PSL_KERNEL
   70         popfq
   71 
   72         /* Parameters for the xen init function */
   73         movq    %rsi, %rdi              /* shared_info (arg 1) */
   74         movq    %rsp, %rsi              /* xenstack    (arg 2) */
   75 
   76         /* Use our own stack */
   77         movq    $bootstack,%rsp
   78         xorl    %ebp, %ebp
   79 
   80         /* u_int64_t hammer_time_xen(start_info_t *si, u_int64_t xenstack); */
   81         call    hammer_time_xen
   82         movq    %rax, %rsp              /* set up kstack for mi_startup() */
   83         call    mi_startup              /* autoconfiguration, mountroot etc */
   84 
   85         /* NOTREACHED */
   86 0:      hlt
   87         jmp     0b

Cache object: 073bb181fcd78f51036c3c8641853afe


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.