David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Synopsys, Inc. (www.synopsys.com) |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _ASM_HIGHMEM_H |
| 7 | #define _ASM_HIGHMEM_H |
| 8 | |
| 9 | #ifdef CONFIG_HIGHMEM |
| 10 | |
| 11 | #include <uapi/asm/page.h> |
| 12 | #include <asm/kmap_types.h> |
| 13 | |
| 14 | /* start after vmalloc area */ |
| 15 | #define FIXMAP_BASE (PAGE_OFFSET - FIXMAP_SIZE - PKMAP_SIZE) |
| 16 | #define FIXMAP_SIZE PGDIR_SIZE /* only 1 PGD worth */ |
| 17 | #define KM_TYPE_NR ((FIXMAP_SIZE >> PAGE_SHIFT)/NR_CPUS) |
| 18 | #define FIXMAP_ADDR(nr) (FIXMAP_BASE + ((nr) << PAGE_SHIFT)) |
| 19 | |
| 20 | /* start after fixmap area */ |
| 21 | #define PKMAP_BASE (FIXMAP_BASE + FIXMAP_SIZE) |
| 22 | #define PKMAP_SIZE PGDIR_SIZE |
| 23 | #define LAST_PKMAP (PKMAP_SIZE >> PAGE_SHIFT) |
| 24 | #define LAST_PKMAP_MASK (LAST_PKMAP - 1) |
| 25 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) |
| 26 | #define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT) |
| 27 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 28 | #include <asm/cacheflush.h> |
| 29 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 30 | extern void kmap_init(void); |
| 31 | |
| 32 | static inline void flush_cache_kmaps(void) |
| 33 | { |
| 34 | flush_cache_all(); |
| 35 | } |
| 36 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 37 | #endif |
| 38 | |
| 39 | #endif |