fixmap.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. __end_of_fixed_addresses
  34. };
  35. extern void __set_fixmap (enum fixed_addresses idx,
  36. unsigned long phys, pgprot_t flags);
  37. /*
  38. * used by vmalloc.c.
  39. *
  40. * Leave one empty page between vmalloc'ed areas and
  41. * the start of the fixmap, and leave one page empty
  42. * at the top of mem..
  43. */
  44. #define FIXADDR_TOP (TASK_SIZE - 2 * PAGE_SIZE)
  45. #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
  46. #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
  47. #include <asm-generic/fixmap.h>
  48. #endif