forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/arch/xtensa/include/asm/highmem.h
....@@ -13,12 +13,11 @@
1313 #define _XTENSA_HIGHMEM_H
1414
1515 #include <linux/wait.h>
16
+#include <linux/pgtable.h>
1617 #include <asm/cacheflush.h>
1718 #include <asm/fixmap.h>
18
-#include <asm/kmap_types.h>
19
-#include <asm/pgtable.h>
2019
21
-#define PKMAP_BASE ((FIXADDR_START - \
20
+#define PKMAP_BASE ((FIXADDR_START - \
2221 (LAST_PKMAP + 1) * PAGE_SIZE) & PMD_MASK)
2322 #define LAST_PKMAP (PTRS_PER_PTE * DCACHE_N_COLORS)
2423 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
....@@ -63,37 +62,19 @@
6362
6463 extern pte_t *pkmap_page_table;
6564
66
-void *kmap_high(struct page *page);
67
-void kunmap_high(struct page *page);
68
-
69
-static inline void *kmap(struct page *page)
70
-{
71
- /* Check if this memory layout is broken because PKMAP overlaps
72
- * page table.
73
- */
74
- BUILD_BUG_ON(PKMAP_BASE <
75
- TLBTEMP_BASE_1 + TLBTEMP_SIZE);
76
- BUG_ON(in_interrupt());
77
- if (!PageHighMem(page))
78
- return page_address(page);
79
- return kmap_high(page);
80
-}
81
-
82
-static inline void kunmap(struct page *page)
83
-{
84
- BUG_ON(in_interrupt());
85
- if (!PageHighMem(page))
86
- return;
87
- kunmap_high(page);
88
-}
89
-
9065 static inline void flush_cache_kmaps(void)
9166 {
9267 flush_cache_all();
9368 }
9469
95
-void *kmap_atomic(struct page *page);
96
-void __kunmap_atomic(void *kvaddr);
70
+enum fixed_addresses kmap_local_map_idx(int type, unsigned long pfn);
71
+#define arch_kmap_local_map_idx kmap_local_map_idx
72
+
73
+enum fixed_addresses kmap_local_unmap_idx(int type, unsigned long addr);
74
+#define arch_kmap_local_unmap_idx kmap_local_unmap_idx
75
+
76
+#define arch_kmap_local_post_unmap(vaddr) \
77
+ local_flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE)
9778
9879 void kmap_init(void);
9980