--- zzzz-none-000/linux-3.10.107/arch/mips/include/asm/page.h 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/arch/mips/include/asm/page.h 2021-11-10 11:53:54.000000000 +0000 @@ -33,6 +33,9 @@ #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) +/* this is used for calculation of real page sizes and should be the same */ +#define BASIC_PAGE_SHIFT 12 + #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT #define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3) #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) @@ -70,13 +73,16 @@ struct page; +#include + static inline void clear_user_page(void *addr, unsigned long vaddr, - struct page *page) + struct page *page __maybe_unused) { extern void (*flush_data_cache_page)(unsigned long addr); clear_page(addr); - if (pages_do_alias((unsigned long) addr, vaddr & PAGE_MASK)) + if (cpu_has_vtag_dcache || (cpu_has_dc_aliases && + pages_do_alias((unsigned long) addr, vaddr & PAGE_MASK))) flush_data_cache_page((unsigned long)addr); } @@ -165,7 +171,9 @@ * https://patchwork.linux-mips.org/patch/1541/ */ -#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) +#ifndef __pa_symbol +#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) +#endif #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) @@ -176,7 +184,11 @@ /* avoid include hell */ extern unsigned long max_mapnr; - return pfn >= ARCH_PFN_OFFSET && pfn < max_mapnr; + return +#if ARCH_PFN_OFFSET > 0 + pfn >= ARCH_PFN_OFFSET && +#endif + pfn < max_mapnr; } #elif defined(CONFIG_SPARSEMEM) @@ -202,13 +214,13 @@ #define virt_addr_valid(kaddr) \ __virt_addr_valid((const volatile void *) (kaddr)) -#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) +#define VM_STACK_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \ - PHYS_OFFSET) -#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \ - PHYS_OFFSET) +#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) +#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) #include #include