diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/nios2/include/asm/page.h | 15 | ||||
-rw-r--r-- | arch/nios2/kernel/setup.c | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/arch/nios2/include/asm/page.h b/arch/nios2/include/asm/page.h index c1683f51ad0f..f1fbdc47bdaf 100644 --- a/arch/nios2/include/asm/page.h +++ b/arch/nios2/include/asm/page.h @@ -76,8 +76,6 @@ extern unsigned long memory_size; extern struct page *mem_map; -#endif /* !__ASSEMBLY__ */ - # define __pa(x) \ ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) # define __va(x) \ @@ -87,8 +85,15 @@ extern struct page *mem_map; ((void *)(((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) # define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) -# define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && \ - (pfn) < max_mapnr) + +static inline bool pfn_valid(unsigned long pfn) +{ + /* avoid <linux/mm.h> include hell */ + extern unsigned long max_mapnr; + unsigned long pfn_offset = ARCH_PFN_OFFSET; + + return pfn >= pfn_offset && pfn < max_mapnr; +} # define virt_to_page(vaddr) pfn_to_page(PFN_DOWN(virt_to_phys(vaddr))) # define virt_addr_valid(vaddr) pfn_valid(PFN_DOWN(virt_to_phys(vaddr))) @@ -106,4 +111,6 @@ extern struct page *mem_map; #include <asm-generic/getorder.h> +#endif /* !__ASSEMBLY__ */ + #endif /* _ASM_NIOS2_PAGE_H */ diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c index a4ff86d58d5c..a3fa80d1aacc 100644 --- a/arch/nios2/kernel/setup.c +++ b/arch/nios2/kernel/setup.c @@ -18,6 +18,7 @@ #include <linux/bootmem.h> #include <linux/initrd.h> #include <linux/of_fdt.h> +#include <linux/screen_info.h> #include <asm/mmu_context.h> #include <asm/sections.h> @@ -36,6 +37,10 @@ static struct pt_regs fake_regs = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +#ifdef CONFIG_VT +struct screen_info screen_info; +#endif + /* Copy a short hook instruction sequence to the exception address */ static inline void copy_exception_handler(unsigned int addr) { |