diff options
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/page.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/pgtable.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/processor.h | 34 | ||||
-rw-r--r-- | include/asm-sparc64/smp.h | 2 |
4 files changed, 38 insertions, 1 deletions
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 219ea043a14a..b87dbbd64bc9 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -95,6 +95,8 @@ typedef unsigned long pgprot_t; | |||
95 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) | 95 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) |
96 | #define HPAGE_MASK (~(HPAGE_SIZE - 1UL)) | 96 | #define HPAGE_MASK (~(HPAGE_SIZE - 1UL)) |
97 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | 97 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
98 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
99 | #define ARCH_HAS_HUGETLB_PREFAULT_HOOK | ||
98 | #endif | 100 | #endif |
99 | 101 | ||
100 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ | 102 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index ae2cd5b09a7c..1ae00c5087f1 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -286,6 +286,7 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) | |||
286 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_ACCESSED | _PAGE_R)) | 286 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_ACCESSED | _PAGE_R)) |
287 | #define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_WRITE)) | 287 | #define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_WRITE)) |
288 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_MODIFIED | _PAGE_W)) | 288 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_MODIFIED | _PAGE_W)) |
289 | #define pte_mkhuge(pte) (__pte(pte_val(pte) | _PAGE_SZHUGE)) | ||
289 | 290 | ||
290 | /* to find an entry in a page-table-directory. */ | 291 | /* to find an entry in a page-table-directory. */ |
291 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) | 292 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) |
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index bc1445b904ef..d0bee2413560 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h | |||
@@ -192,6 +192,40 @@ extern unsigned long get_wchan(struct task_struct *task); | |||
192 | 192 | ||
193 | #define cpu_relax() barrier() | 193 | #define cpu_relax() barrier() |
194 | 194 | ||
195 | /* Prefetch support. This is tuned for UltraSPARC-III and later. | ||
196 | * UltraSPARC-I will treat these as nops, and UltraSPARC-II has | ||
197 | * a shallower prefetch queue than later chips. | ||
198 | */ | ||
199 | #define ARCH_HAS_PREFETCH | ||
200 | #define ARCH_HAS_PREFETCHW | ||
201 | #define ARCH_HAS_SPINLOCK_PREFETCH | ||
202 | |||
203 | static inline void prefetch(const void *x) | ||
204 | { | ||
205 | /* We do not use the read prefetch mnemonic because that | ||
206 | * prefetches into the prefetch-cache which only is accessible | ||
207 | * by floating point operations in UltraSPARC-III and later. | ||
208 | * By contrast, "#one_write" prefetches into the L2 cache | ||
209 | * in shared state. | ||
210 | */ | ||
211 | __asm__ __volatile__("prefetch [%0], #one_write" | ||
212 | : /* no outputs */ | ||
213 | : "r" (x)); | ||
214 | } | ||
215 | |||
216 | static inline void prefetchw(const void *x) | ||
217 | { | ||
218 | /* The most optimal prefetch to use for writes is | ||
219 | * "#n_writes". This brings the cacheline into the | ||
220 | * L2 cache in "owned" state. | ||
221 | */ | ||
222 | __asm__ __volatile__("prefetch [%0], #n_writes" | ||
223 | : /* no outputs */ | ||
224 | : "r" (x)); | ||
225 | } | ||
226 | |||
227 | #define spin_lock_prefetch(x) prefetchw(x) | ||
228 | |||
195 | #endif /* !(__ASSEMBLY__) */ | 229 | #endif /* !(__ASSEMBLY__) */ |
196 | 230 | ||
197 | #endif /* !(__ASM_SPARC64_PROCESSOR_H) */ | 231 | #endif /* !(__ASM_SPARC64_PROCESSOR_H) */ |
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index 5e3e06d908fe..110a2de89123 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h | |||
@@ -64,7 +64,7 @@ static __inline__ int hard_smp_processor_id(void) | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | #define smp_processor_id() (current_thread_info()->cpu) | 67 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
68 | 68 | ||
69 | #endif /* !(__ASSEMBLY__) */ | 69 | #endif /* !(__ASSEMBLY__) */ |
70 | 70 | ||