ia64/xen-unstable

view xen/include/xen/rangeset.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 d966b7a00959
children
line source
1 /******************************************************************************
2 * rangeset.h
3 *
4 * Creation, maintenance and automatic destruction of per-domain sets of
5 * numeric ranges.
6 *
7 * Copyright (c) 2005, K A Fraser
8 */
10 #ifndef __XEN_RANGESET_H__
11 #define __XEN_RANGESET_H__
13 struct domain;
14 struct rangeset;
16 /*
17 * Initialise/destroy per-domain rangeset information.
18 *
19 * It is invalid to create or destroy a rangeset belonging to a domain @d
20 * before rangeset_domain_initialise(d) returns or after calling
21 * rangeset_domain_destroy(d).
22 */
23 void rangeset_domain_initialise(
24 struct domain *d);
25 void rangeset_domain_destroy(
26 struct domain *d);
28 /*
29 * Create/destroy a rangeset. Optionally attach to specified domain @d for
30 * auto-destruction when the domain dies. A name may be specified, for use
31 * in debug pretty-printing, and various RANGESETF flags (defined below).
32 *
33 * It is invalid to perform any operation on a rangeset @r after calling
34 * rangeset_destroy(r).
35 */
36 struct rangeset *rangeset_new(
37 struct domain *d, char *name, unsigned int flags);
38 void rangeset_destroy(
39 struct rangeset *r);
41 /* Flags for passing to rangeset_new(). */
42 /* Pretty-print range limits in hexadecimal. */
43 #define _RANGESETF_prettyprint_hex 0
44 #define RANGESETF_prettyprint_hex (1U << _RANGESETF_prettyprint_hex)
46 int __must_check rangeset_is_empty(
47 struct rangeset *r);
49 /* Add/remove/query a numeric range. */
50 int __must_check rangeset_add_range(
51 struct rangeset *r, unsigned long s, unsigned long e);
52 int __must_check rangeset_remove_range(
53 struct rangeset *r, unsigned long s, unsigned long e);
54 int __must_check rangeset_contains_range(
55 struct rangeset *r, unsigned long s, unsigned long e);
57 /* Add/remove/query a single number. */
58 int __must_check rangeset_add_singleton(
59 struct rangeset *r, unsigned long s);
60 int __must_check rangeset_remove_singleton(
61 struct rangeset *r, unsigned long s);
62 int __must_check rangeset_contains_singleton(
63 struct rangeset *r, unsigned long s);
65 /* Rangeset pretty printing. */
66 void rangeset_printk(
67 struct rangeset *r);
68 void rangeset_domain_printk(
69 struct domain *d);
71 #endif /* __XEN_RANGESET_H__ */