1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 205e4d316SH. Peter Anvin #ifndef _ASM_X86_XEN_EVENTS_H 305e4d316SH. Peter Anvin #define _ASM_X86_XEN_EVENTS_H 4bb898558SAl Viro 53cfa210bSChristoph Hellwig #include <xen/xen.h> 63cfa210bSChristoph Hellwig 7bb898558SAl Viro enum ipi_vector { 8bb898558SAl Viro XEN_RESCHEDULE_VECTOR, 9bb898558SAl Viro XEN_CALL_FUNCTION_VECTOR, 10bb898558SAl Viro XEN_CALL_FUNCTION_SINGLE_VECTOR, 11bb898558SAl Viro XEN_SPIN_UNLOCK_VECTOR, 121ff2b0c3SLin Ming XEN_IRQ_WORK_VECTOR, 136efa20e4SKonrad Rzeszutek Wilk XEN_NMI_VECTOR, 14bb898558SAl Viro 15bb898558SAl Viro XEN_NR_IPIS, 16bb898558SAl Viro }; 17bb898558SAl Viro xen_irqs_disabled(struct pt_regs * regs)18bb898558SAl Virostatic inline int xen_irqs_disabled(struct pt_regs *regs) 19bb898558SAl Viro { 20bb898558SAl Viro return raw_irqs_disabled_flags(regs->flags); 21bb898558SAl Viro } 22bb898558SAl Viro 23c81611c4SIan Campbell /* No need for a barrier -- XCHG is a barrier on x86. */ 24c81611c4SIan Campbell #define xchg_xen_ulong(ptr, val) xchg((ptr), (val)) 25c81611c4SIan Campbell 26*b1c3497eSJane Malalane extern bool xen_have_vector_callback; 2784d582d2SBoris Ostrovsky 2884d582d2SBoris Ostrovsky /* 2984d582d2SBoris Ostrovsky * Events delivered via platform PCI interrupts are always 3084d582d2SBoris Ostrovsky * routed to vcpu 0 and hence cannot be rebound. 3184d582d2SBoris Ostrovsky */ xen_support_evtchn_rebind(void)3284d582d2SBoris Ostrovskystatic inline bool xen_support_evtchn_rebind(void) 3384d582d2SBoris Ostrovsky { 3484d582d2SBoris Ostrovsky return (!xen_hvm_domain() || xen_have_vector_callback); 3584d582d2SBoris Ostrovsky } 3684d582d2SBoris Ostrovsky 37*b1c3497eSJane Malalane extern bool xen_percpu_upcall; 3805e4d316SH. Peter Anvin #endif /* _ASM_X86_XEN_EVENTS_H */ 39