Go to the documentation of this file.
11 #include <linux/const.h>
14 #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
15 #define PAGE_MASK (~(PAGE_SIZE-1))
19 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
20 #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
21 #define clear_user_page(addr, vaddr, page) \
22 do { clear_page(addr); \
23 sparc_flush_page_to_ram(page); \
25 #define copy_user_page(to, from, vaddr, page) \
26 do { copy_page(to, from); \
27 sparc_flush_page_to_ram(page); \
42 #define SPARC_PHYS_BANKS 32
50 #ifdef STRICT_MM_TYPECHECKS
54 typedef struct {
unsigned long pte; }
pte_t;
55 typedef struct {
unsigned long iopte; }
iopte_t;
56 typedef struct {
unsigned long pmdv[16]; }
pmd_t;
57 typedef struct {
unsigned long pgd; }
pgd_t;
58 typedef struct {
unsigned long ctxd; }
ctxd_t;
60 typedef struct {
unsigned long iopgprot; }
iopgprot_t;
62 #define pte_val(x) ((x).pte)
63 #define iopte_val(x) ((x).iopte)
64 #define pmd_val(x) ((x).pmdv[0])
65 #define pgd_val(x) ((x).pgd)
66 #define ctxd_val(x) ((x).ctxd)
67 #define pgprot_val(x) ((x).pgprot)
68 #define iopgprot_val(x) ((x).iopgprot)
70 #define __pte(x) ((pte_t) { (x) } )
71 #define __iopte(x) ((iopte_t) { (x) } )
73 #define __pgd(x) ((pgd_t) { (x) } )
74 #define __ctxd(x) ((ctxd_t) { (x) } )
75 #define __pgprot(x) ((pgprot_t) { (x) } )
76 #define __iopgprot(x) ((iopgprot_t) { (x) } )
84 typedef struct {
unsigned long pmdv[16]; }
pmd_t;
90 #define pte_val(x) (x)
91 #define iopte_val(x) (x)
92 #define pmd_val(x) ((x).pmdv[0])
93 #define pgd_val(x) (x)
94 #define ctxd_val(x) (x)
95 #define pgprot_val(x) (x)
96 #define iopgprot_val(x) (x)
99 #define __iopte(x) (x)
102 #define __ctxd(x) (x)
103 #define __pgprot(x) (x)
104 #define __iopgprot(x) (x)
110 #define TASK_UNMAPPED_BASE 0x50000000
114 #define __pgprot(x) (x)
118 #define PAGE_OFFSET 0xf0000000
123 #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + phys_base)
124 #define __va(x) ((void *)((unsigned long) (x) - phys_base + PAGE_OFFSET))
126 #define virt_to_phys __pa
127 #define phys_to_virt __va
129 #define ARCH_PFN_OFFSET (pfn_base)
130 #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
132 #define pfn_valid(pfn) (((pfn) >= (pfn_base)) && (((pfn)-(pfn_base)) < max_mapnr))
133 #define virt_addr_valid(kaddr) ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT) < max_mapnr)
135 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
136 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)