spaces.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
  7. * Copyright (C) 2000, 2002 Maciej W. Rozycki
  8. * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
  9. */
  10. #ifndef _ASM_MACH_GENERIC_SPACES_H
  11. #define _ASM_MACH_GENERIC_SPACES_H
  12. #include <linux/const.h>
  13. /*
  14. * This gives the physical RAM offset.
  15. */
  16. #ifndef PHYS_OFFSET
  17. #define PHYS_OFFSET _AC(0, UL)
  18. #endif
  19. #ifdef CONFIG_32BIT
  20. #ifdef CONFIG_KVM_GUEST
  21. #define CAC_BASE _AC(0x40000000, UL)
  22. #else
  23. #define CAC_BASE _AC(0x80000000, UL)
  24. #endif
  25. #ifndef IO_BASE
  26. #define IO_BASE _AC(0xa0000000, UL)
  27. #endif
  28. #ifndef UNCAC_BASE
  29. #define UNCAC_BASE _AC(0xa0000000, UL)
  30. #endif
  31. #ifndef MAP_BASE
  32. #ifdef CONFIG_KVM_GUEST
  33. #define MAP_BASE _AC(0x60000000, UL)
  34. #else
  35. #define MAP_BASE _AC(0xc0000000, UL)
  36. #endif
  37. #endif
  38. /*
  39. * Memory above this physical address will be considered highmem.
  40. */
  41. #ifndef HIGHMEM_START
  42. #define HIGHMEM_START _AC(0x20000000, UL)
  43. #endif
  44. #endif /* CONFIG_32BIT */
  45. #ifdef CONFIG_64BIT
  46. #ifndef CAC_BASE
  47. #ifdef CONFIG_DMA_NONCOHERENT
  48. #define CAC_BASE _AC(0x9800000000000000, UL)
  49. #else
  50. #define CAC_BASE _AC(0xa800000000000000, UL)
  51. #endif
  52. #endif
  53. #ifndef IO_BASE
  54. #define IO_BASE _AC(0x9000000000000000, UL)
  55. #endif
  56. #ifndef UNCAC_BASE
  57. #define UNCAC_BASE _AC(0x9000000000000000, UL)
  58. #endif
  59. #ifndef MAP_BASE
  60. #define MAP_BASE _AC(0xc000000000000000, UL)
  61. #endif
  62. /*
  63. * Memory above this physical address will be considered highmem.
  64. * Fixme: 59 bits is a fictive number and makes assumptions about processors
  65. * in the distant future. Nobody will care for a few years :-)
  66. */
  67. #ifndef HIGHMEM_START
  68. #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
  69. #endif
  70. #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
  71. #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
  72. #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
  73. #endif /* CONFIG_64BIT */
  74. /*
  75. * This handles the memory map.
  76. */
  77. #ifndef PAGE_OFFSET
  78. #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
  79. #endif
  80. #ifndef FIXADDR_TOP
  81. #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
  82. #endif
  83. #endif /* __ASM_MACH_GENERIC_SPACES_H */