This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / xen / balloon.h
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  */
33
34 #ifndef __ASM_BALLOON_H__
35 #define __ASM_BALLOON_H__
36
37 /*
38  * Inform the balloon driver that it should allow some slop for device-driver
39  * memory activities.
40  */
41 extern void
42 balloon_update_driver_allowance(
43         long delta);
44
45 /* Allocate an empty low-memory page range. */
46 extern struct page *
47 balloon_alloc_empty_page_range(
48         unsigned long nr_pages);
49
50 /* Deallocate an empty page range, adding to the balloon. */
51 extern void
52 balloon_dealloc_empty_page_range(
53         struct page *page, unsigned long nr_pages);
54
55 /*
56  * Prevent the balloon driver from changing the memory reservation during
57  * a driver critical region.
58  */
59 extern spinlock_t balloon_lock;
60 #define balloon_lock(__flags)   spin_lock_irqsave(&balloon_lock, __flags)
61 #define balloon_unlock(__flags) spin_unlock_irqrestore(&balloon_lock, __flags)
62
63 #endif /* __ASM_BALLOON_H__ */