highmem.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
  3. #ifndef __ASM_CSKY_HIGHMEM_H
  4. #define __ASM_CSKY_HIGHMEM_H
  5. #ifdef __KERNEL__
  6. #include <linux/init.h>
  7. #include <linux/interrupt.h>
  8. #include <linux/uaccess.h>
  9. #include <asm/kmap_types.h>
  10. #include <asm/cache.h>
  11. /* undef for production */
  12. #define HIGHMEM_DEBUG 1
  13. /* declarations for highmem.c */
  14. extern unsigned long highstart_pfn, highend_pfn;
  15. extern pte_t *pkmap_page_table;
  16. /*
  17. * Right now we initialize only a single pte table. It can be extended
  18. * easily, subsequent pte tables have to be allocated in one physical
  19. * chunk of RAM.
  20. */
  21. #define LAST_PKMAP 1024
  22. #define LAST_PKMAP_MASK (LAST_PKMAP-1)
  23. #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
  24. #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
  25. extern void *kmap_high(struct page *page);
  26. extern void kunmap_high(struct page *page);
  27. extern void *kmap(struct page *page);
  28. extern void kunmap(struct page *page);
  29. extern void *kmap_atomic(struct page *page);
  30. extern void __kunmap_atomic(void *kvaddr);
  31. extern void *kmap_atomic_pfn(unsigned long pfn);
  32. extern struct page *kmap_atomic_to_page(void *ptr);
  33. #define flush_cache_kmaps() do {} while (0)
  34. extern void kmap_init(void);
  35. #define kmap_prot PAGE_KERNEL
  36. #endif /* __KERNEL__ */
  37. #endif /* __ASM_CSKY_HIGHMEM_H */