xencomm.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) 2006 Hollis Blanchard <hollisb@us.ibm.com>, IBM Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef _ASM_IA64_XEN_XENCOMM_H
  19. #define _ASM_IA64_XEN_XENCOMM_H
  20. #include <xen/xencomm.h>
  21. #include <asm/pgtable.h>
  22. /* Must be called before any hypercall. */
  23. extern void xencomm_initialize(void);
  24. extern int xencomm_is_initialized(void);
  25. /* Check if virtual contiguity means physical contiguity
  26. * where the passed address is a pointer value in virtual address.
  27. * On ia64, identity mapping area in region 7 or the piece of region 5
  28. * that is mapped by itr[IA64_TR_KERNEL]/dtr[IA64_TR_KERNEL]
  29. */
  30. static inline int xencomm_is_phys_contiguous(unsigned long addr)
  31. {
  32. return (PAGE_OFFSET <= addr &&
  33. addr < (PAGE_OFFSET + (1UL << IA64_MAX_PHYS_BITS))) ||
  34. (KERNEL_START <= addr &&
  35. addr < KERNEL_START + KERNEL_TR_PAGE_SIZE);
  36. }
  37. #endif /* _ASM_IA64_XEN_XENCOMM_H */