debuggers.hg

view xen/include/xen/rangeset.h @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
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__ */