balloon.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #ifndef __XEN_BALLOON_H__
  34. #define __XEN_BALLOON_H__
  35. #include <linux/spinlock.h>
  36. #if 0
  37. /*
  38. * Inform the balloon driver that it should allow some slop for device-driver
  39. * memory activities.
  40. */
  41. void balloon_update_driver_allowance(long delta);
  42. /* Allocate/free a set of empty pages in low memory (i.e., no RAM mapped). */
  43. struct page **alloc_empty_pages_and_pagevec(int nr_pages);
  44. void free_empty_pages_and_pagevec(struct page **pagevec, int nr_pages);
  45. void balloon_release_driver_page(struct page *page);
  46. /*
  47. * Prevent the balloon driver from changing the memory reservation during
  48. * a driver critical region.
  49. */
  50. extern spinlock_t balloon_lock;
  51. #define balloon_lock(__flags) spin_lock_irqsave(&balloon_lock, __flags)
  52. #define balloon_unlock(__flags) spin_unlock_irqrestore(&balloon_lock, __flags)
  53. #endif
  54. #endif /* __XEN_BALLOON_H__ */