highmem.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 1999 Gerhard Wichert, Siemens AG
  3. * Gerhard.Wichert@pdb.siemens.de
  4. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation, version 2.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  13. * NON INFRINGEMENT. See the GNU General Public License for
  14. * more details.
  15. *
  16. * Used in CONFIG_HIGHMEM systems for memory pages which
  17. * are not addressable by direct kernel virtual addresses.
  18. *
  19. */
  20. #ifndef _ASM_TILE_HIGHMEM_H
  21. #define _ASM_TILE_HIGHMEM_H
  22. #include <linux/interrupt.h>
  23. #include <linux/threads.h>
  24. #include <asm/tlbflush.h>
  25. #include <asm/homecache.h>
  26. /* declarations for highmem.c */
  27. extern unsigned long highstart_pfn, highend_pfn;
  28. extern pte_t *pkmap_page_table;
  29. /*
  30. * Ordering is:
  31. *
  32. * FIXADDR_TOP
  33. * fixed_addresses
  34. * FIXADDR_START
  35. * temp fixed addresses
  36. * FIXADDR_BOOT_START
  37. * Persistent kmap area
  38. * PKMAP_BASE
  39. * VMALLOC_END
  40. * Vmalloc area
  41. * VMALLOC_START
  42. * high_memory
  43. */
  44. #define LAST_PKMAP_MASK (LAST_PKMAP-1)
  45. #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
  46. #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
  47. void *kmap_high(struct page *page);
  48. void kunmap_high(struct page *page);
  49. void *kmap(struct page *page);
  50. void kunmap(struct page *page);
  51. void *kmap_fix_kpte(struct page *page, int finished);
  52. /* This macro is used only in map_new_virtual() to map "page". */
  53. #define kmap_prot page_to_kpgprot(page)
  54. void *kmap_atomic(struct page *page);
  55. void __kunmap_atomic(void *kvaddr);
  56. void *kmap_atomic_pfn(unsigned long pfn);
  57. void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
  58. void *kmap_atomic_prot(struct page *page, pgprot_t prot);
  59. void kmap_atomic_fix_kpte(struct page *page, int finished);
  60. #define flush_cache_kmaps() do { } while (0)
  61. #endif /* _ASM_TILE_HIGHMEM_H */