Lines Matching +full:global +full:- +full:regs
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
5 * Copyright (c) 2004-2006,2008 Kip Macy
73 #include <xen/xen-os.h>
79 #include <contrib/xen/arch-x86/cpuid.h>
80 #include <contrib/xen/arch-x86/hvm/start_info.h>
96 /*--------------------------- Forward Declarations ---------------------------*/
100 /*---------------------------- Extern Declarations ---------------------------*/
107 /*-------------------------------- Global Data -------------------------------*/
119 /*-------------------------------- Xen PV init -------------------------------*/
124 static int xen = -1; in isxen()
126 u_int regs[4]; in isxen() local
128 if (xen != -1) in isxen()
134 * this is sufficient to distinguish Xen PVH booting from non-Xen PVH in isxen()
135 * and skip some very early Xen-specific code in the non-Xen case. in isxen()
139 do_cpuid(base, regs); in isxen()
140 if (regs[1] == XEN_CPUID_SIGNATURE_EBX && in isxen()
141 regs[2] == XEN_CPUID_SIGNATURE_ECX && in isxen()
142 regs[3] == XEN_CPUID_SIGNATURE_EDX) { in isxen()
163 if (start_info->magic != XEN_HVM_START_MAGIC_VALUE) { in hammer_time_xen()
165 start_info->magic); in hammer_time_xen()
176 physfree = MAX(roundup2((vm_paddr_t)_end - KERNBASE, PAGE_SIZE), in hammer_time_xen()
179 if (start_info->memmap_paddr != 0) in hammer_time_xen()
180 physfree = MAX(roundup2(start_info->memmap_paddr + in hammer_time_xen()
181 start_info->memmap_entries * in hammer_time_xen()
185 if (start_info->modlist_paddr != 0) { in hammer_time_xen()
188 if (start_info->nr_modules == 0) { in hammer_time_xen()
193 (start_info->modlist_paddr + KERNBASE); in hammer_time_xen()
194 for (i = 0; i < start_info->nr_modules; i++) in hammer_time_xen()
201 hvm_start_flags = start_info->flags; in hammer_time_xen()
207 /*-------------------------------- PV specific -------------------------------*/
224 if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) || in xen_pvh_parse_symtab()
225 ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || in xen_pvh_parse_symtab()
226 ehdr->e_version > 1) { in xen_pvh_parse_symtab()
232 shdr = (Elf_Shdr *)((uint8_t *)ehdr + ehdr->e_shoff); in xen_pvh_parse_symtab()
234 for (i = 1; i < ehdr->e_shnum; i++) { in xen_pvh_parse_symtab()
263 if (start_info->modlist_paddr != 0) { in xen_pvh_parse_preload_data()
268 (start_info->modlist_paddr + KERNBASE); in xen_pvh_parse_preload_data()
277 if ((header->flags & XENHEADER_HAS_MODULEP_OFFSET) != in xen_pvh_parse_preload_data()
284 header->modulep_offset + KERNBASE); in xen_pvh_parse_preload_data()
303 off = mod[0].paddr + header->modulep_offset - metadata + in xen_pvh_parse_preload_data()
317 off = mod[0].paddr + KERNBASE - metadata; in xen_pvh_parse_preload_data()
339 if (start_info->cmdline_paddr != 0) in xen_pvh_parse_preload_data()
341 (char *)(start_info->cmdline_paddr + KERNBASE), in xen_pvh_parse_preload_data()
354 acpi_set_root(start_info->rsdp_paddr); in xen_pvh_parse_preload_data()
372 entries = (struct hvm_memmap_table_entry *)(start_info->memmap_paddr + KERNBASE); in pvh_parse_memmap_start_info()
373 nentries = start_info->memmap_entries; in pvh_parse_memmap_start_info()
427 if ((start_info->version >= 1) && (start_info->memmap_paddr != 0)) in pvh_parse_memmap()