highmem.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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/kmap_types.h>
  25. #include <asm/tlbflush.h>
  26. #include <asm/homecache.h>
  27. /* declarations for highmem.c */
  28. extern unsigned long highstart_pfn, highend_pfn;
  29. extern pte_t *pkmap_page_table;
  30. /*
  31. * Ordering is:
  32. *
  33. * FIXADDR_TOP
  34. * fixed_addresses
  35. * FIXADDR_START
  36. * temp fixed addresses
  37. * FIXADDR_BOOT_START
  38. * Persistent kmap area
  39. * PKMAP_BASE
  40. * VMALLOC_END
  41. * Vmalloc area
  42. * VMALLOC_START
  43. * high_memory
  44. */
  45. #define LAST_PKMAP_MASK (LAST_PKMAP-1)
  46. #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
  47. #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
  48. void *kmap_high(struct page *page);
  49. void kunmap_high(struct page *page);
  50. void *kmap(struct page *page);
  51. void kunmap(struct page *page);
  52. void *kmap_fix_kpte(struct page *page, int finished);
  53. /* This macro is used only in map_new_virtual() to map "page". */
  54. #define kmap_prot page_to_kpgprot(page)
  55. void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type);
  56. void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
  57. void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
  58. struct page *kmap_atomic_to_page(void *ptr);
  59. void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot);
  60. void *kmap_atomic(struct page *page, enum km_type type);
  61. void kmap_atomic_fix_kpte(struct page *page, int finished);
  62. #define flush_cache_kmaps() do { } while (0)
  63. #endif /* _ASM_TILE_HIGHMEM_H */