direct-io.hg

view linux-2.6-xen-sparse/include/xen/balloon.h @ 11509:2e6c10dc7c0b

[POWERPC][XEN] make sure put_domain() is called in case of allocate_rma() failuer

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Tue Sep 12 10:53:46 2006 -0400 (2006-09-12)
parents 2b78726766d1
children be6f5e262d84
line source
1 /******************************************************************************
2 * balloon.h
3 *
4 * Xen balloon driver - enables returning/claiming memory to/from Xen.
5 *
6 * Copyright (c) 2003, B Dragovic
7 * Copyright (c) 2003-2004, M Williamson, K Fraser
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
34 #ifndef __ASM_BALLOON_H__
35 #define __ASM_BALLOON_H__
37 /*
38 * Inform the balloon driver that it should allow some slop for device-driver
39 * memory activities.
40 */
41 void
42 balloon_update_driver_allowance(
43 long delta);
45 /* Allocate an empty low-memory page range. */
46 struct page *
47 balloon_alloc_empty_page_range(
48 unsigned long nr_pages);
50 /* Deallocate an empty page range, adding to the balloon. */
51 void
52 balloon_dealloc_empty_page_range(
53 struct page *page, unsigned long nr_pages);
55 void
56 balloon_release_driver_page(
57 struct page *page);
59 /*
60 * Prevent the balloon driver from changing the memory reservation during
61 * a driver critical region.
62 */
63 extern spinlock_t balloon_lock;
64 #define balloon_lock(__flags) spin_lock_irqsave(&balloon_lock, __flags)
65 #define balloon_unlock(__flags) spin_unlock_irqrestore(&balloon_lock, __flags)
67 #endif /* __ASM_BALLOON_H__ */