fixmap.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (C) 1998 Ingo Molnar
  3. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation, version 2.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  12. * NON INFRINGEMENT. See the GNU General Public License for
  13. * more details.
  14. */
  15. #ifndef _ASM_TILE_FIXMAP_H
  16. #define _ASM_TILE_FIXMAP_H
  17. #include <asm/page.h>
  18. #ifndef __ASSEMBLY__
  19. #include <linux/kernel.h>
  20. #ifdef CONFIG_HIGHMEM
  21. #include <linux/threads.h>
  22. #include <asm/kmap_types.h>
  23. #endif
  24. /*
  25. * Here we define all the compile-time 'special' virtual
  26. * addresses. The point is to have a constant address at
  27. * compile time, but to set the physical address only
  28. * in the boot process. We allocate these special addresses
  29. * from the end of supervisor virtual memory backwards.
  30. * Also this lets us do fail-safe vmalloc(), we
  31. * can guarantee that these special addresses and
  32. * vmalloc()-ed addresses never overlap.
  33. *
  34. * these 'compile-time allocated' memory buffers are
  35. * fixed-size 4k pages. (or larger if used with an increment
  36. * higher than 1) use fixmap_set(idx,phys) to associate
  37. * physical memory with fixmap indices.
  38. *
  39. * TLB entries of such buffers will not be flushed across
  40. * task switches.
  41. */
  42. enum fixed_addresses {
  43. #ifdef __tilegx__
  44. /*
  45. * TILEPro has unmapped memory above so the hole isn't needed,
  46. * and in any case the hole pushes us over a single 16MB pmd.
  47. */
  48. FIX_HOLE,
  49. #endif
  50. #ifdef CONFIG_HIGHMEM
  51. FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
  52. FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
  53. #endif
  54. #ifdef __tilegx__ /* see homecache.c */
  55. FIX_HOMECACHE_BEGIN,
  56. FIX_HOMECACHE_END = FIX_HOMECACHE_BEGIN+(NR_CPUS)-1,
  57. #endif
  58. __end_of_permanent_fixed_addresses,
  59. /*
  60. * Temporary boot-time mappings, used before ioremap() is functional.
  61. * Not currently needed by the Tile architecture.
  62. */
  63. #define NR_FIX_BTMAPS 0
  64. #if NR_FIX_BTMAPS
  65. FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
  66. FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
  67. __end_of_fixed_addresses
  68. #else
  69. __end_of_fixed_addresses = __end_of_permanent_fixed_addresses
  70. #endif
  71. };
  72. #define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
  73. #define __FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
  74. #define FIXADDR_START (FIXADDR_TOP + PAGE_SIZE - __FIXADDR_SIZE)
  75. #define FIXADDR_BOOT_START (FIXADDR_TOP + PAGE_SIZE - __FIXADDR_BOOT_SIZE)
  76. #include <asm-generic/fixmap.h>
  77. #endif /* !__ASSEMBLY__ */
  78. #endif /* _ASM_TILE_FIXMAP_H */