spaces.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #define CAC_BASE _AC(0x80000000, UL)
  21. #define IO_BASE _AC(0xa0000000, UL)
  22. #define UNCAC_BASE _AC(0xa0000000, UL)
  23. #ifndef MAP_BASE
  24. #define MAP_BASE _AC(0xc0000000, UL)
  25. #endif
  26. /*
  27. * Memory above this physical address will be considered highmem.
  28. */
  29. #ifndef HIGHMEM_START
  30. #define HIGHMEM_START _AC(0x20000000, UL)
  31. #endif
  32. #endif /* CONFIG_32BIT */
  33. #ifdef CONFIG_64BIT
  34. #ifndef CAC_BASE
  35. #ifdef CONFIG_DMA_NONCOHERENT
  36. #define CAC_BASE _AC(0x9800000000000000, UL)
  37. #else
  38. #define CAC_BASE _AC(0xa800000000000000, UL)
  39. #endif
  40. #endif
  41. #ifndef IO_BASE
  42. #define IO_BASE _AC(0x9000000000000000, UL)
  43. #endif
  44. #ifndef UNCAC_BASE
  45. #define UNCAC_BASE _AC(0x9000000000000000, UL)
  46. #endif
  47. #ifndef MAP_BASE
  48. #define MAP_BASE _AC(0xc000000000000000, UL)
  49. #endif
  50. /*
  51. * Memory above this physical address will be considered highmem.
  52. * Fixme: 59 bits is a fictive number and makes assumptions about processors
  53. * in the distant future. Nobody will care for a few years :-)
  54. */
  55. #ifndef HIGHMEM_START
  56. #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL))
  57. #endif
  58. #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK))
  59. #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
  60. #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
  61. #endif /* CONFIG_64BIT */
  62. /*
  63. * This handles the memory map.
  64. */
  65. #ifndef PAGE_OFFSET
  66. #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
  67. #endif
  68. #endif /* __ASM_MACH_GENERIC_SPACES_H */