Initial revision
[linux-2.6.git] / include / asm-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 file may be distributed separately from the Linux kernel, or
10  * incorporated into other software packages, subject to the following license:
11  * 
12  * Permission is hereby granted, free of charge, to any person obtaining a copy
13  * of this source file (the "Software"), to deal in the Software without
14  * restriction, including without limitation the rights to use, copy, modify,
15  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
16  * and to permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  * 
19  * The above copyright notice and this permission notice shall be included in
20  * all copies or substantial portions of the Software.
21  * 
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28  * IN THE SOFTWARE.
29  */
30
31 #ifndef __ASM_BALLOON_H__
32 #define __ASM_BALLOON_H__
33
34 /*
35  * Inform the balloon driver that it should allow some slop for device-driver
36  * memory activities.
37  */
38 extern void balloon_update_driver_allowance(long delta);
39
40 /* Give up unmapped pages to the balloon driver. */
41 extern void balloon_put_pages(unsigned long *mfn_list, unsigned long nr_mfns);
42
43 /*
44  * Prevent the balloon driver from changing the memory reservation during
45  * a driver critical region.
46  */
47 extern spinlock_t balloon_lock;
48 #define balloon_lock(__flags)   spin_lock_irqsave(&balloon_lock, __flags)
49 #define balloon_unlock(__flags) spin_unlock_irqrestore(&balloon_lock, __flags)
50
51 #endif /* __ASM_BALLOON_H__ */