nmi.h revision 251767
1181624Skmacy/****************************************************************************** 2181624Skmacy * nmi.h 3181624Skmacy * 4181624Skmacy * NMI callback registration and reason codes. 5181624Skmacy * 6181624Skmacy * Permission is hereby granted, free of charge, to any person obtaining a copy 7181624Skmacy * of this software and associated documentation files (the "Software"), to 8181624Skmacy * deal in the Software without restriction, including without limitation the 9181624Skmacy * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10181624Skmacy * sell copies of the Software, and to permit persons to whom the Software is 11181624Skmacy * furnished to do so, subject to the following conditions: 12181624Skmacy * 13181624Skmacy * The above copyright notice and this permission notice shall be included in 14181624Skmacy * all copies or substantial portions of the Software. 15181624Skmacy * 16181624Skmacy * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17181624Skmacy * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18181624Skmacy * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19181624Skmacy * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20181624Skmacy * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21181624Skmacy * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22181624Skmacy * DEALINGS IN THE SOFTWARE. 23181624Skmacy * 24181624Skmacy * Copyright (c) 2005, Keir Fraser <keir@xensource.com> 25181624Skmacy */ 26181624Skmacy 27181624Skmacy#ifndef __XEN_PUBLIC_NMI_H__ 28181624Skmacy#define __XEN_PUBLIC_NMI_H__ 29181624Skmacy 30251767Sgibbs#include "xen.h" 31251767Sgibbs 32181624Skmacy/* 33181624Skmacy * NMI reason codes: 34181624Skmacy * Currently these are x86-specific, stored in arch_shared_info.nmi_reason. 35181624Skmacy */ 36181624Skmacy /* I/O-check error reported via ISA port 0x61, bit 6. */ 37181624Skmacy#define _XEN_NMIREASON_io_error 0 38181624Skmacy#define XEN_NMIREASON_io_error (1UL << _XEN_NMIREASON_io_error) 39181624Skmacy /* Parity error reported via ISA port 0x61, bit 7. */ 40181624Skmacy#define _XEN_NMIREASON_parity_error 1 41181624Skmacy#define XEN_NMIREASON_parity_error (1UL << _XEN_NMIREASON_parity_error) 42181624Skmacy /* Unknown hardware-generated NMI. */ 43181624Skmacy#define _XEN_NMIREASON_unknown 2 44181624Skmacy#define XEN_NMIREASON_unknown (1UL << _XEN_NMIREASON_unknown) 45181624Skmacy 46181624Skmacy/* 47181624Skmacy * long nmi_op(unsigned int cmd, void *arg) 48181624Skmacy * NB. All ops return zero on success, else a negative error code. 49181624Skmacy */ 50181624Skmacy 51181624Skmacy/* 52181624Skmacy * Register NMI callback for this (calling) VCPU. Currently this only makes 53181624Skmacy * sense for domain 0, vcpu 0. All other callers will be returned EINVAL. 54181624Skmacy * arg == pointer to xennmi_callback structure. 55181624Skmacy */ 56181624Skmacy#define XENNMI_register_callback 0 57181624Skmacystruct xennmi_callback { 58181624Skmacy unsigned long handler_address; 59181624Skmacy unsigned long pad; 60181624Skmacy}; 61181624Skmacytypedef struct xennmi_callback xennmi_callback_t; 62181624SkmacyDEFINE_XEN_GUEST_HANDLE(xennmi_callback_t); 63181624Skmacy 64181624Skmacy/* 65181624Skmacy * Deregister NMI callback for this (calling) VCPU. 66181624Skmacy * arg == NULL. 67181624Skmacy */ 68181624Skmacy#define XENNMI_unregister_callback 1 69181624Skmacy 70181624Skmacy#endif /* __XEN_PUBLIC_NMI_H__ */ 71181624Skmacy 72181624Skmacy/* 73181624Skmacy * Local variables: 74181624Skmacy * mode: C 75181624Skmacy * c-set-style: "BSD" 76181624Skmacy * c-basic-offset: 4 77181624Skmacy * tab-width: 4 78181624Skmacy * indent-tabs-mode: nil 79181624Skmacy * End: 80181624Skmacy */ 81