18c2ecf20Sopenharmony_ci/******************************************************************************
28c2ecf20Sopenharmony_ci * hypervisor.h
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Linux-specific hypervisor handling.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (c) 2002-2004, K A Fraser
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or
98c2ecf20Sopenharmony_ci * modify it under the terms of the GNU General Public License version 2
108c2ecf20Sopenharmony_ci * as published by the Free Software Foundation; or, when distributed
118c2ecf20Sopenharmony_ci * separately from the Linux kernel or incorporated into other
128c2ecf20Sopenharmony_ci * software packages, subject to the following license:
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
158c2ecf20Sopenharmony_ci * of this source file (the "Software"), to deal in the Software without
168c2ecf20Sopenharmony_ci * restriction, including without limitation the rights to use, copy, modify,
178c2ecf20Sopenharmony_ci * merge, publish, distribute, sublicense, and/or sell copies of the Software,
188c2ecf20Sopenharmony_ci * and to permit persons to whom the Software is furnished to do so, subject to
198c2ecf20Sopenharmony_ci * the following conditions:
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
228c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
258c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
268c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
278c2ecf20Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
288c2ecf20Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
298c2ecf20Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
308c2ecf20Sopenharmony_ci * IN THE SOFTWARE.
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#ifndef _ASM_X86_XEN_HYPERVISOR_H
348c2ecf20Sopenharmony_ci#define _ASM_X86_XEN_HYPERVISOR_H
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciextern struct shared_info *HYPERVISOR_shared_info;
378c2ecf20Sopenharmony_ciextern struct start_info *xen_start_info;
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#include <asm/processor.h>
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistatic inline uint32_t xen_cpuid_base(void)
428c2ecf20Sopenharmony_ci{
438c2ecf20Sopenharmony_ci	return hypervisor_cpuid_base("XenVMMXenVMM", 2);
448c2ecf20Sopenharmony_ci}
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#ifdef CONFIG_XEN
478c2ecf20Sopenharmony_ciextern bool __init xen_hvm_need_lapic(void);
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_cistatic inline bool __init xen_x2apic_para_available(void)
508c2ecf20Sopenharmony_ci{
518c2ecf20Sopenharmony_ci	return xen_hvm_need_lapic();
528c2ecf20Sopenharmony_ci}
538c2ecf20Sopenharmony_ci#else
548c2ecf20Sopenharmony_cistatic inline bool __init xen_x2apic_para_available(void)
558c2ecf20Sopenharmony_ci{
568c2ecf20Sopenharmony_ci	return (xen_cpuid_base() != 0);
578c2ecf20Sopenharmony_ci}
588c2ecf20Sopenharmony_ci#endif
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#ifdef CONFIG_HOTPLUG_CPU
618c2ecf20Sopenharmony_civoid xen_arch_register_cpu(int num);
628c2ecf20Sopenharmony_civoid xen_arch_unregister_cpu(int num);
638c2ecf20Sopenharmony_ci#endif
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#endif /* _ASM_X86_XEN_HYPERVISOR_H */
66