Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

csky: pgtable.h: Coding convention

C-SKY page table attributes only have 'Dirty' and 'Valid' to
emulate 'PRESENT, READ, WRITE, EXEC, DIRTY, ACCESSED'.

This patch cleanup unnecessary definition.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Arnd Bergmann <arnd@arndb.de>

Guo Ren a8fac05a 5e144c42

+36 -55
+4 -13
arch/csky/abiv1/inc/abi/pgtable-bits.h
··· 5 5 #define __ASM_CSKY_PGTABLE_BITS_H 6 6 7 7 /* implemented in software */ 8 - #define _PAGE_ACCESSED (1<<3) 9 - #define PAGE_ACCESSED_BIT (3) 10 - 8 + #define _PAGE_PRESENT (1<<0) 11 9 #define _PAGE_READ (1<<1) 12 10 #define _PAGE_WRITE (1<<2) 13 - #define _PAGE_PRESENT (1<<0) 14 - 11 + #define _PAGE_ACCESSED (1<<3) 15 12 #define _PAGE_MODIFIED (1<<4) 16 - #define PAGE_MODIFIED_BIT (4) 17 13 18 14 /* implemented in hardware */ 19 15 #define _PAGE_GLOBAL (1<<6) 20 - 21 16 #define _PAGE_VALID (1<<7) 22 - #define PAGE_VALID_BIT (7) 23 - 24 17 #define _PAGE_DIRTY (1<<8) 25 - #define PAGE_DIRTY_BIT (8) 26 18 27 19 #define _PAGE_CACHE (3<<9) 28 20 #define _PAGE_UNCACHE (2<<9) 29 21 #define _PAGE_SO _PAGE_UNCACHE 30 - 31 22 #define _CACHE_MASK (7<<9) 32 23 33 - #define _CACHE_CACHED (_PAGE_VALID | _PAGE_CACHE) 34 - #define _CACHE_UNCACHED (_PAGE_VALID | _PAGE_UNCACHE) 24 + #define _CACHE_CACHED _PAGE_CACHE 25 + #define _CACHE_UNCACHED _PAGE_UNCACHE 35 26 36 27 #define HAVE_ARCH_UNMAPPED_AREA 37 28
+2 -12
arch/csky/abiv2/inc/abi/pgtable-bits.h
··· 6 6 7 7 /* implemented in software */ 8 8 #define _PAGE_ACCESSED (1<<7) 9 - #define PAGE_ACCESSED_BIT (7) 10 - 11 9 #define _PAGE_READ (1<<8) 12 10 #define _PAGE_WRITE (1<<9) 13 11 #define _PAGE_PRESENT (1<<10) 14 - 15 12 #define _PAGE_MODIFIED (1<<11) 16 - #define PAGE_MODIFIED_BIT (11) 17 13 18 14 /* implemented in hardware */ 19 15 #define _PAGE_GLOBAL (1<<0) 20 - 21 16 #define _PAGE_VALID (1<<1) 22 - #define PAGE_VALID_BIT (1) 23 - 24 17 #define _PAGE_DIRTY (1<<2) 25 - #define PAGE_DIRTY_BIT (2) 26 18 27 19 #define _PAGE_SO (1<<5) 28 20 #define _PAGE_BUF (1<<6) 29 - 30 21 #define _PAGE_CACHE (1<<3) 31 - 32 22 #define _CACHE_MASK _PAGE_CACHE 33 23 34 - #define _CACHE_CACHED (_PAGE_VALID | _PAGE_CACHE | _PAGE_BUF) 35 - #define _CACHE_UNCACHED (_PAGE_VALID) 24 + #define _CACHE_CACHED (_PAGE_CACHE | _PAGE_BUF) 25 + #define _CACHE_UNCACHED (0) 36 26 37 27 #endif /* __ASM_CSKY_PGTABLE_BITS_H */
+30 -30
arch/csky/include/asm/pgtable.h
··· 41 41 #define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) \ 42 42 | pgprot_val(prot)) 43 43 44 - #define __READABLE (_PAGE_READ | _PAGE_VALID | _PAGE_ACCESSED) 45 - #define __WRITEABLE (_PAGE_WRITE | _PAGE_DIRTY | _PAGE_MODIFIED) 46 - 47 44 #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | \ 48 45 _CACHE_MASK) 49 46 ··· 56 59 pgprot_val(pgprot)) 57 60 58 61 /* 59 - * CSKY can't do page protection for execute, and considers that the same like 60 - * read. Also, write permissions imply read permissions. This is the closest 61 - * we can get by reasonable means.. 62 + * C-SKY only has VALID and DIRTY bit in hardware. So we need to use the 63 + * two bits emulate PRESENT, READ, WRITE, EXEC, MODIFIED, ACCESSED. 62 64 */ 63 65 #define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED) 64 66 65 - #define PAGE_NONE __pgprot(_PAGE_BASE | _CACHE_CACHED) 66 - #define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_READ | _PAGE_WRITE | \ 67 + #define PAGE_NONE __pgprot(_PAGE_BASE | \ 67 68 _CACHE_CACHED) 68 - #define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_READ | _CACHE_CACHED) 69 - #define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_READ | _CACHE_CACHED) 70 - #define PAGE_KERNEL __pgprot(_PAGE_BASE | __READABLE | __WRITEABLE | \ 71 - _PAGE_GLOBAL | _CACHE_CACHED) 72 - #define PAGE_USERIO __pgprot(_PAGE_BASE | _PAGE_READ | _PAGE_WRITE | \ 69 + #define PAGE_READ __pgprot(_PAGE_BASE | _PAGE_READ | \ 70 + _CACHE_CACHED) 71 + #define PAGE_WRITE __pgprot(_PAGE_BASE | _PAGE_READ | _PAGE_WRITE | \ 72 + _CACHE_CACHED) 73 + #define PAGE_SHARED PAGE_WRITE 74 + 75 + #define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_READ | _PAGE_VALID | \ 76 + _PAGE_WRITE | _PAGE_DIRTY | _PAGE_MODIFIED | \ 77 + _PAGE_GLOBAL | \ 73 78 _CACHE_CACHED) 74 79 75 - #define _PAGE_IOREMAP \ 76 - (_PAGE_BASE | __READABLE | __WRITEABLE | _PAGE_GLOBAL | \ 77 - _CACHE_UNCACHED | _PAGE_SO) 80 + #define _PAGE_IOREMAP (_PAGE_BASE | _PAGE_READ | _PAGE_VALID | \ 81 + _PAGE_WRITE | _PAGE_DIRTY | _PAGE_MODIFIED | \ 82 + _PAGE_GLOBAL | \ 83 + _CACHE_UNCACHED | _PAGE_SO) 78 84 79 85 #define __P000 PAGE_NONE 80 - #define __P001 PAGE_READONLY 81 - #define __P010 PAGE_COPY 82 - #define __P011 PAGE_COPY 83 - #define __P100 PAGE_READONLY 84 - #define __P101 PAGE_READONLY 85 - #define __P110 PAGE_COPY 86 - #define __P111 PAGE_COPY 86 + #define __P001 PAGE_READ 87 + #define __P010 PAGE_READ 88 + #define __P011 PAGE_READ 89 + #define __P100 PAGE_READ 90 + #define __P101 PAGE_READ 91 + #define __P110 PAGE_READ 92 + #define __P111 PAGE_READ 87 93 88 94 #define __S000 PAGE_NONE 89 - #define __S001 PAGE_READONLY 90 - #define __S010 PAGE_SHARED 91 - #define __S011 PAGE_SHARED 92 - #define __S100 PAGE_READONLY 93 - #define __S101 PAGE_READONLY 94 - #define __S110 PAGE_SHARED 95 - #define __S111 PAGE_SHARED 95 + #define __S001 PAGE_READ 96 + #define __S010 PAGE_WRITE 97 + #define __S011 PAGE_WRITE 98 + #define __S100 PAGE_READ 99 + #define __S101 PAGE_READ 100 + #define __S110 PAGE_WRITE 101 + #define __S111 PAGE_WRITE 96 102 97 103 extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; 98 104 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))