Path: blob/master/include/xen/interface/callback.h
10817 views
/******************************************************************************1* callback.h2*3* Register guest OS callbacks with Xen.4*5* Permission is hereby granted, free of charge, to any person obtaining a copy6* of this software and associated documentation files (the "Software"), to7* deal in the Software without restriction, including without limitation the8* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or9* sell copies of the Software, and to permit persons to whom the Software is10* furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice shall be included in13* all copies or substantial portions of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE18* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING20* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER21* DEALINGS IN THE SOFTWARE.22*23* Copyright (c) 2006, Ian Campbell24*/2526#ifndef __XEN_PUBLIC_CALLBACK_H__27#define __XEN_PUBLIC_CALLBACK_H__2829#include "xen.h"3031/*32* Prototype for this hypercall is:33* long callback_op(int cmd, void *extra_args)34* @cmd == CALLBACKOP_??? (callback operation).35* @extra_args == Operation-specific extra arguments (NULL if none).36*/3738/* ia64, x86: Callback for event delivery. */39#define CALLBACKTYPE_event 04041/* x86: Failsafe callback when guest state cannot be restored by Xen. */42#define CALLBACKTYPE_failsafe 14344/* x86/64 hypervisor: Syscall by 64-bit guest app ('64-on-64-on-64'). */45#define CALLBACKTYPE_syscall 24647/*48* x86/32 hypervisor: Only available on x86/32 when supervisor_mode_kernel49* feature is enabled. Do not use this callback type in new code.50*/51#define CALLBACKTYPE_sysenter_deprecated 35253/* x86: Callback for NMI delivery. */54#define CALLBACKTYPE_nmi 45556/*57* x86: sysenter is only available as follows:58* - 32-bit hypervisor: with the supervisor_mode_kernel feature enabled59* - 64-bit hypervisor: 32-bit guest applications on Intel CPUs60* ('32-on-32-on-64', '32-on-64-on-64')61* [nb. also 64-bit guest applications on Intel CPUs62* ('64-on-64-on-64'), but syscall is preferred]63*/64#define CALLBACKTYPE_sysenter 56566/*67* x86/64 hypervisor: Syscall by 32-bit guest app on AMD CPUs68* ('32-on-32-on-64', '32-on-64-on-64')69*/70#define CALLBACKTYPE_syscall32 77172/*73* Disable event deliver during callback? This flag is ignored for event and74* NMI callbacks: event delivery is unconditionally disabled.75*/76#define _CALLBACKF_mask_events 077#define CALLBACKF_mask_events (1U << _CALLBACKF_mask_events)7879/*80* Register a callback.81*/82#define CALLBACKOP_register 083struct callback_register {84uint16_t type;85uint16_t flags;86xen_callback_t address;87};8889/*90* Unregister a callback.91*92* Not all callbacks can be unregistered. -EINVAL will be returned if93* you attempt to unregister such a callback.94*/95#define CALLBACKOP_unregister 196struct callback_unregister {97uint16_t type;98uint16_t _unused;99};100101#endif /* __XEN_PUBLIC_CALLBACK_H__ */102103104