1/******************************************************************************
2 * debug_op.h
3 *
4 * Copyright (c) 2007 Tristan Gingold <tgingold@free.fr>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef __XEN_PUBLIC_IA64_DEBUG_OP_H__
26#define __XEN_PUBLIC_IA64_DEBUG_OP_H__
27
28/* Set/Get extra conditions to break.  */
29#define XEN_IA64_DEBUG_OP_SET_FLAGS 1
30#define XEN_IA64_DEBUG_OP_GET_FLAGS 2
31
32/* Break on kernel single step.  */
33#define XEN_IA64_DEBUG_ON_KERN_SSTEP   (1 << 0)
34
35/* Break on kernel debug (breakpoint or watch point).  */
36#define XEN_IA64_DEBUG_ON_KERN_DEBUG   (1 << 1)
37
38/* Break on kernel taken branch.  */
39#define XEN_IA64_DEBUG_ON_KERN_TBRANCH (1 << 2)
40
41/* Break on interrupt injection.  */
42#define XEN_IA64_DEBUG_ON_EXTINT       (1 << 3)
43
44/* Break on interrupt injection.  */
45#define XEN_IA64_DEBUG_ON_EXCEPT       (1 << 4)
46
47/* Break on event injection.  */
48#define XEN_IA64_DEBUG_ON_EVENT        (1 << 5)
49
50/* Break on privop/virtualized instruction (slow path only).  */
51#define XEN_IA64_DEBUG_ON_PRIVOP       (1 << 6)
52
53/* Break on emulated PAL call (at entry).  */
54#define XEN_IA64_DEBUG_ON_PAL          (1 << 7)
55
56/* Break on emulated SAL call (at entry).  */
57#define XEN_IA64_DEBUG_ON_SAL          (1 << 8)
58
59/* Break on emulated EFI call (at entry).  */
60#define XEN_IA64_DEBUG_ON_EFI          (1 << 9)
61
62/* Break on rfi emulation (slow path only, before exec).  */
63#define XEN_IA64_DEBUG_ON_RFI          (1 << 10)
64
65/* Break on address translation switch.  */
66#define XEN_IA64_DEBUG_ON_MMU          (1 << 11)
67
68/* Break on bad guest physical address.  */
69#define XEN_IA64_DEBUG_ON_BAD_MPA      (1 << 12)
70
71/* Force psr.ss bit.  */
72#define XEN_IA64_DEBUG_FORCE_SS        (1 << 13)
73
74/* Force psr.db bit.  */
75#define XEN_IA64_DEBUG_FORCE_DB        (1 << 14)
76
77/* Break on ITR/PTR.  */
78#define XEN_IA64_DEBUG_ON_TR           (1 << 15)
79
80/* Break on ITC/PTC.L/PTC.G/PTC.GA.  */
81#define XEN_IA64_DEBUG_ON_TC           (1 << 16)
82
83/* Get translation cache.  */
84#define XEN_IA64_DEBUG_OP_GET_TC   3
85
86/* Translate virtual address to guest physical address.  */
87#define XEN_IA64_DEBUG_OP_TRANSLATE 4
88
89union xen_ia64_debug_op {
90    uint64_t flags;
91    struct xen_ia64_debug_vtlb {
92        uint64_t nbr;                             /* IN/OUT */
93        XEN_GUEST_HANDLE_64(ia64_tr_entry_t) tr;  /* IN/OUT */
94    } vtlb;
95};
96typedef union xen_ia64_debug_op xen_ia64_debug_op_t;
97DEFINE_XEN_GUEST_HANDLE(xen_ia64_debug_op_t);
98
99#endif /* __XEN_PUBLIC_IA64_DEBUG_OP_H__ */
100