xref: /titanic_41/usr/src/uts/common/xen/public/nmi.h (revision 843e19887f64dde75055cf8842fc4db2171eff45)
1*843e1988Sjohnlev /******************************************************************************
2*843e1988Sjohnlev  * nmi.h
3*843e1988Sjohnlev  *
4*843e1988Sjohnlev  * NMI callback registration and reason codes.
5*843e1988Sjohnlev  *
6*843e1988Sjohnlev  * Permission is hereby granted, free of charge, to any person obtaining a copy
7*843e1988Sjohnlev  * of this software and associated documentation files (the "Software"), to
8*843e1988Sjohnlev  * deal in the Software without restriction, including without limitation the
9*843e1988Sjohnlev  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10*843e1988Sjohnlev  * sell copies of the Software, and to permit persons to whom the Software is
11*843e1988Sjohnlev  * furnished to do so, subject to the following conditions:
12*843e1988Sjohnlev  *
13*843e1988Sjohnlev  * The above copyright notice and this permission notice shall be included in
14*843e1988Sjohnlev  * all copies or substantial portions of the Software.
15*843e1988Sjohnlev  *
16*843e1988Sjohnlev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*843e1988Sjohnlev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*843e1988Sjohnlev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19*843e1988Sjohnlev  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*843e1988Sjohnlev  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21*843e1988Sjohnlev  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22*843e1988Sjohnlev  * DEALINGS IN THE SOFTWARE.
23*843e1988Sjohnlev  *
24*843e1988Sjohnlev  * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
25*843e1988Sjohnlev  */
26*843e1988Sjohnlev 
27*843e1988Sjohnlev #ifndef __XEN_PUBLIC_NMI_H__
28*843e1988Sjohnlev #define __XEN_PUBLIC_NMI_H__
29*843e1988Sjohnlev 
30*843e1988Sjohnlev /*
31*843e1988Sjohnlev  * NMI reason codes:
32*843e1988Sjohnlev  * Currently these are x86-specific, stored in arch_shared_info.nmi_reason.
33*843e1988Sjohnlev  */
34*843e1988Sjohnlev  /* I/O-check error reported via ISA port 0x61, bit 6. */
35*843e1988Sjohnlev #define _XEN_NMIREASON_io_error     0
36*843e1988Sjohnlev #define XEN_NMIREASON_io_error      (1UL << _XEN_NMIREASON_io_error)
37*843e1988Sjohnlev  /* Parity error reported via ISA port 0x61, bit 7. */
38*843e1988Sjohnlev #define _XEN_NMIREASON_parity_error 1
39*843e1988Sjohnlev #define XEN_NMIREASON_parity_error  (1UL << _XEN_NMIREASON_parity_error)
40*843e1988Sjohnlev  /* Unknown hardware-generated NMI. */
41*843e1988Sjohnlev #define _XEN_NMIREASON_unknown      2
42*843e1988Sjohnlev #define XEN_NMIREASON_unknown       (1UL << _XEN_NMIREASON_unknown)
43*843e1988Sjohnlev 
44*843e1988Sjohnlev /*
45*843e1988Sjohnlev  * long nmi_op(unsigned int cmd, void *arg)
46*843e1988Sjohnlev  * NB. All ops return zero on success, else a negative error code.
47*843e1988Sjohnlev  */
48*843e1988Sjohnlev 
49*843e1988Sjohnlev /*
50*843e1988Sjohnlev  * Register NMI callback for this (calling) VCPU. Currently this only makes
51*843e1988Sjohnlev  * sense for domain 0, vcpu 0. All other callers will be returned EINVAL.
52*843e1988Sjohnlev  * arg == pointer to xennmi_callback structure.
53*843e1988Sjohnlev  */
54*843e1988Sjohnlev #define XENNMI_register_callback   0
55*843e1988Sjohnlev struct xennmi_callback {
56*843e1988Sjohnlev     unsigned long handler_address;
57*843e1988Sjohnlev     unsigned long pad;
58*843e1988Sjohnlev };
59*843e1988Sjohnlev typedef struct xennmi_callback xennmi_callback_t;
60*843e1988Sjohnlev DEFINE_XEN_GUEST_HANDLE(xennmi_callback_t);
61*843e1988Sjohnlev 
62*843e1988Sjohnlev /*
63*843e1988Sjohnlev  * Deregister NMI callback for this (calling) VCPU.
64*843e1988Sjohnlev  * arg == NULL.
65*843e1988Sjohnlev  */
66*843e1988Sjohnlev #define XENNMI_unregister_callback 1
67*843e1988Sjohnlev 
68*843e1988Sjohnlev #endif /* __XEN_PUBLIC_NMI_H__ */
69*843e1988Sjohnlev 
70*843e1988Sjohnlev /*
71*843e1988Sjohnlev  * Local variables:
72*843e1988Sjohnlev  * mode: C
73*843e1988Sjohnlev  * c-set-style: "BSD"
74*843e1988Sjohnlev  * c-basic-offset: 4
75*843e1988Sjohnlev  * tab-width: 4
76*843e1988Sjohnlev  * indent-tabs-mode: nil
77*843e1988Sjohnlev  * End:
78*843e1988Sjohnlev  */
79