fixmap.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __UM_FIXMAP_H
  2. #define __UM_FIXMAP_H
  3. #include <asm/processor.h>
  4. #include <asm/kmap_types.h>
  5. #include <asm/archparam.h>
  6. #include <asm/page.h>
  7. #include <linux/threads.h>
  8. /*
  9. * Here we define all the compile-time 'special' virtual
  10. * addresses. The point is to have a constant address at
  11. * compile time, but to set the physical address only
  12. * in the boot process. We allocate these special addresses
  13. * from the end of virtual memory (0xfffff000) backwards.
  14. * Also this lets us do fail-safe vmalloc(), we
  15. * can guarantee that these special addresses and
  16. * vmalloc()-ed addresses never overlap.
  17. *
  18. * these 'compile-time allocated' memory buffers are
  19. * fixed-size 4k pages. (or larger if used with an increment
  20. * highger than 1) use fixmap_set(idx,phys) to associate
  21. * physical memory with fixmap indices.
  22. *
  23. * TLB entries of such buffers will not be flushed across
  24. * task switches.
  25. */
  26. /*
  27. * on UP currently we will have no trace of the fixmap mechanizm,
  28. * no page table allocations, etc. This might change in the
  29. * future, say framebuffers for the console driver(s) could be
  30. * fix-mapped?
  31. */
  32. enum fixed_addresses {
  33. #ifdef CONFIG_HIGHMEM
  34. FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
  35. FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
  36. #endif
  37. __end_of_fixed_addresses
  38. };
  39. extern void __set_fixmap (enum fixed_addresses idx,
  40. unsigned long phys, pgprot_t flags);
  41. /*
  42. * used by vmalloc.c.
  43. *
  44. * Leave one empty page between vmalloc'ed areas and
  45. * the start of the fixmap, and leave one page empty
  46. * at the top of mem..
  47. */
  48. #define FIXADDR_TOP (TASK_SIZE - 2 * PAGE_SIZE)
  49. #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
  50. #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
  51. #include <asm-generic/fixmap.h>
  52. #endif