1 /******************************************************************************
4 * Xen balloon driver - enables returning/claiming memory to/from Xen.
6 * Copyright (c) 2003, B Dragovic
7 * Copyright (c) 2003-2004, M Williamson, K Fraser
9 * This file may be distributed separately from the Linux kernel, or
10 * incorporated into other software packages, subject to the following license:
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:
19 * The above copyright notice and this permission notice shall be included in
20 * all copies or substantial portions of the Software.
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
31 #ifndef __ASM_BALLOON_H__
32 #define __ASM_BALLOON_H__
35 * Inform the balloon driver that it should allow some slop for device-driver
38 extern void balloon_update_driver_allowance(long delta);
40 /* Give up unmapped pages to the balloon driver. */
41 extern void balloon_put_pages(unsigned long *mfn_list, unsigned long nr_mfns);
44 * Prevent the balloon driver from changing the memory reservation during
45 * a driver critical region.
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)
51 #endif /* __ASM_BALLOON_H__ */