ia64/xen-unstable

view xen/include/xen/xenoprof.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 2f9e1348aa98
children
line source
1 /******************************************************************************
2 * xenoprof.h
3 *
4 * Xenoprof: Xenoprof enables performance profiling in Xen
5 *
6 * Copyright (C) 2005 Hewlett-Packard Co.
7 * written by Aravind Menon & Jose Renato Santos
8 */
10 #ifndef __XEN_XENOPROF_H__
11 #define __XEN_XENOPROF_H__
13 #include <xen/config.h>
14 #include <public/xenoprof.h>
15 #include <asm/xenoprof.h>
17 #define XENOPROF_DOMAIN_IGNORED 0
18 #define XENOPROF_DOMAIN_ACTIVE 1
19 #define XENOPROF_DOMAIN_PASSIVE 2
21 #define XENOPROF_IDLE 0
22 #define XENOPROF_INITIALIZED 1
23 #define XENOPROF_COUNTERS_RESERVED 2
24 #define XENOPROF_READY 3
25 #define XENOPROF_PROFILING 4
27 #ifndef CONFIG_COMPAT
28 typedef struct xenoprof_buf xenoprof_buf_t;
29 #else
30 #include <compat/xenoprof.h>
31 typedef union {
32 struct xenoprof_buf native;
33 struct compat_oprof_buf compat;
34 } xenoprof_buf_t;
35 #endif
37 struct xenoprof_vcpu {
38 int event_size;
39 xenoprof_buf_t *buffer;
40 };
42 struct xenoprof {
43 char *rawbuf;
44 int npages;
45 int nbuf;
46 int bufsize;
47 int domain_type;
48 int domain_ready;
49 int is_primary;
50 #ifdef CONFIG_COMPAT
51 int is_compat;
52 #endif
53 struct xenoprof_vcpu *vcpu;
54 };
56 #ifndef CONFIG_COMPAT
57 #define XENOPROF_COMPAT(x) 0
58 #define xenoprof_buf(d, b, field) ((b)->field)
59 #else
60 #define XENOPROF_COMPAT(x) ((x)->is_compat)
61 #define xenoprof_buf(d, b, field) (*(!(d)->xenoprof->is_compat ? \
62 &(b)->native.field : \
63 &(b)->compat.field))
64 #endif
66 struct domain;
67 void free_xenoprof_pages(struct domain *d);
69 int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
70 int xenoprof_add_trace(struct domain *d, struct vcpu *v,
71 unsigned long eip, int mode);
73 #define PMU_OWNER_NONE 0
74 #define PMU_OWNER_XENOPROF 1
75 #define PMU_OWNER_HVM 2
76 int acquire_pmu_ownship(int pmu_ownership);
77 void release_pmu_ownship(int pmu_ownership);
79 #endif /* __XEN__XENOPROF_H__ */