ia64/xen-unstable

view xen/include/xen/trace.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents 74621a2add54
children
line source
1 /******************************************************************************
2 * include/xen/trace.h
3 *
4 * Xen Trace Buffer
5 *
6 * Copyright (C) 2003 by Intel Research Cambridge
7 *
8 * Author: Mark Williamson, mark.a.williamson@intel.com
9 * Date: January 2004
10 *
11 * Copyright (C) 2005 Bin Ren
12 *
13 * The trace buffer code is designed to allow debugging traces of Xen to be
14 * generated on UP / SMP machines. Each trace entry is timestamped so that
15 * it's possible to reconstruct a chronological record of trace events.
16 *
17 * Access to the trace buffers is via a dom0 hypervisor op and analysis of
18 * trace buffer contents can then be performed using a userland tool.
19 */
21 #ifndef __XEN_TRACE_H__
22 #define __XEN_TRACE_H__
24 extern int tb_init_done;
26 #include <xen/config.h>
27 #include <public/sysctl.h>
28 #include <public/trace.h>
29 #include <asm/trace.h>
31 /* Used to initialise trace buffer functionality */
32 void init_trace_bufs(void);
34 /* used to retrieve the physical address of the trace buffers */
35 int tb_control(struct xen_sysctl_tbuf_op *tbc);
37 int trace_will_trace_event(u32 event);
39 void __trace_var(u32 event, int cycles, int extra, unsigned char *extra_data);
41 static inline void trace_var(u32 event, int cycles, int extra,
42 unsigned char *extra_data)
43 {
44 if ( unlikely(tb_init_done) )
45 __trace_var(event, cycles, extra, extra_data);
46 }
48 /* Convenience macros for calling the trace function. */
49 #define TRACE_0D(_e) \
50 do { \
51 trace_var(_e, 1, 0, NULL); \
52 } while ( 0 )
54 #define TRACE_1D(_e,d1) \
55 do { \
56 if ( unlikely(tb_init_done) ) \
57 { \
58 u32 _d[1]; \
59 _d[0] = d1; \
60 __trace_var(_e, 1, sizeof(*_d), (unsigned char *)_d); \
61 } \
62 } while ( 0 )
64 #define TRACE_2D(_e,d1,d2) \
65 do { \
66 if ( unlikely(tb_init_done) ) \
67 { \
68 u32 _d[2]; \
69 _d[0] = d1; \
70 _d[1] = d2; \
71 __trace_var(_e, 1, sizeof(*_d)*2, (unsigned char *)_d); \
72 } \
73 } while ( 0 )
75 #define TRACE_3D(_e,d1,d2,d3) \
76 do { \
77 if ( unlikely(tb_init_done) ) \
78 { \
79 u32 _d[3]; \
80 _d[0] = d1; \
81 _d[1] = d2; \
82 _d[2] = d3; \
83 __trace_var(_e, 1, sizeof(*_d)*3, (unsigned char *)_d); \
84 } \
85 } while ( 0 )
87 #define TRACE_4D(_e,d1,d2,d3,d4) \
88 do { \
89 if ( unlikely(tb_init_done) ) \
90 { \
91 u32 _d[4]; \
92 _d[0] = d1; \
93 _d[1] = d2; \
94 _d[2] = d3; \
95 _d[3] = d4; \
96 __trace_var(_e, 1, sizeof(*_d)*4, (unsigned char *)_d); \
97 } \
98 } while ( 0 )
100 #define TRACE_5D(_e,d1,d2,d3,d4,d5) \
101 do { \
102 if ( unlikely(tb_init_done) ) \
103 { \
104 u32 _d[5]; \
105 _d[0] = d1; \
106 _d[1] = d2; \
107 _d[2] = d3; \
108 _d[3] = d4; \
109 _d[4] = d5; \
110 __trace_var(_e, 1, sizeof(*_d)*5, (unsigned char *)_d); \
111 } \
112 } while ( 0 )
114 #endif /* __XEN_TRACE_H__ */