aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/asm/page.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/include/asm/page.h')
-rw-r--r--arch/tile/include/asm/page.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/tile/include/asm/page.h b/arch/tile/include/asm/page.h
index 3eb53525bf9d..db93518fac03 100644
--- a/arch/tile/include/asm/page.h
+++ b/arch/tile/include/asm/page.h
@@ -16,7 +16,8 @@
16#define _ASM_TILE_PAGE_H 16#define _ASM_TILE_PAGE_H
17 17
18#include <linux/const.h> 18#include <linux/const.h>
19#include <hv/pagesize.h> 19#include <hv/hypervisor.h>
20#include <arch/chip.h>
20 21
21/* PAGE_SHIFT and HPAGE_SHIFT determine the page sizes. */ 22/* PAGE_SHIFT and HPAGE_SHIFT determine the page sizes. */
22#define PAGE_SHIFT HV_LOG2_PAGE_SIZE_SMALL 23#define PAGE_SHIFT HV_LOG2_PAGE_SIZE_SMALL
@@ -28,8 +29,6 @@
28#define PAGE_MASK (~(PAGE_SIZE - 1)) 29#define PAGE_MASK (~(PAGE_SIZE - 1))
29#define HPAGE_MASK (~(HPAGE_SIZE - 1)) 30#define HPAGE_MASK (~(HPAGE_SIZE - 1))
30 31
31#ifdef __KERNEL__
32
33/* 32/*
34 * If the Kconfig doesn't specify, set a maximum zone order that 33 * If the Kconfig doesn't specify, set a maximum zone order that
35 * is enough so that we can create huge pages from small pages given 34 * is enough so that we can create huge pages from small pages given
@@ -39,9 +38,6 @@
39#define CONFIG_FORCE_MAX_ZONEORDER (HPAGE_SHIFT - PAGE_SHIFT + 1) 38#define CONFIG_FORCE_MAX_ZONEORDER (HPAGE_SHIFT - PAGE_SHIFT + 1)
40#endif 39#endif
41 40
42#include <hv/hypervisor.h>
43#include <arch/chip.h>
44
45#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
46 42
47#include <linux/types.h> 43#include <linux/types.h>
@@ -91,6 +87,10 @@ typedef struct page *pgtable_t;
91/* Must be a macro since it is used to create constants. */ 87/* Must be a macro since it is used to create constants. */
92#define __pgprot(val) hv_pte(val) 88#define __pgprot(val) hv_pte(val)
93 89
90/* Rarely-used initializers, typically with a "zero" value. */
91#define __pte(x) hv_pte(x)
92#define __pgd(x) hv_pte(x)
93
94static inline u64 pgprot_val(pgprot_t pgprot) 94static inline u64 pgprot_val(pgprot_t pgprot)
95{ 95{
96 return hv_pte_val(pgprot); 96 return hv_pte_val(pgprot);
@@ -110,6 +110,8 @@ static inline u64 pgd_val(pgd_t pgd)
110 110
111typedef HV_PTE pmd_t; 111typedef HV_PTE pmd_t;
112 112
113#define __pmd(x) hv_pte(x)
114
113static inline u64 pmd_val(pmd_t pmd) 115static inline u64 pmd_val(pmd_t pmd)
114{ 116{
115 return hv_pte_val(pmd); 117 return hv_pte_val(pmd);
@@ -318,7 +320,7 @@ static inline int pfn_valid(unsigned long pfn)
318 320
319/* Provide as macros since these require some other headers included. */ 321/* Provide as macros since these require some other headers included. */
320#define page_to_pa(page) ((phys_addr_t)(page_to_pfn(page)) << PAGE_SHIFT) 322#define page_to_pa(page) ((phys_addr_t)(page_to_pfn(page)) << PAGE_SHIFT)
321#define virt_to_page(kaddr) pfn_to_page(kaddr_to_pfn(kaddr)) 323#define virt_to_page(kaddr) pfn_to_page(kaddr_to_pfn((void *)(kaddr)))
322#define page_to_virt(page) pfn_to_kaddr(page_to_pfn(page)) 324#define page_to_virt(page) pfn_to_kaddr(page_to_pfn(page))
323 325
324struct mm_struct; 326struct mm_struct;
@@ -331,6 +333,4 @@ extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
331 333
332#include <asm-generic/memory_model.h> 334#include <asm-generic/memory_model.h>
333 335
334#endif /* __KERNEL__ */
335
336#endif /* _ASM_TILE_PAGE_H */ 336#endif /* _ASM_TILE_PAGE_H */