diff options
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/agp.h | 10 | ||||
-rw-r--r-- | include/asm-sparc64/iommu.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/page.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/pbm.h | 8 | ||||
-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 | ||||
-rw-r--r-- | include/asm-sparc64/spitfire.h | 3 |
8 files changed, 58 insertions, 4 deletions
diff --git a/include/asm-sparc64/agp.h b/include/asm-sparc64/agp.h index ba05bdf9a211..58f8cb6ae767 100644 --- a/include/asm-sparc64/agp.h +++ b/include/asm-sparc64/agp.h | |||
@@ -8,4 +8,14 @@ | |||
8 | #define flush_agp_mappings() | 8 | #define flush_agp_mappings() |
9 | #define flush_agp_cache() mb() | 9 | #define flush_agp_cache() mb() |
10 | 10 | ||
11 | /* Convert a physical address to an address suitable for the GART. */ | ||
12 | #define phys_to_gart(x) (x) | ||
13 | #define gart_to_phys(x) (x) | ||
14 | |||
15 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | ||
16 | #define alloc_gatt_pages(order) \ | ||
17 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | ||
18 | #define free_gatt_pages(table, order) \ | ||
19 | free_pages((unsigned long)(table), (order)) | ||
20 | |||
11 | #endif | 21 | #endif |
diff --git a/include/asm-sparc64/iommu.h b/include/asm-sparc64/iommu.h index 5fd16e42a045..0de7a3da79cd 100644 --- a/include/asm-sparc64/iommu.h +++ b/include/asm-sparc64/iommu.h | |||
@@ -16,4 +16,6 @@ | |||
16 | #define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */ | 16 | #define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */ |
17 | #define IOPTE_WRITE 0x0000000000000002UL /* Writeable */ | 17 | #define IOPTE_WRITE 0x0000000000000002UL /* Writeable */ |
18 | 18 | ||
19 | #define IOMMU_NUM_CTXS 4096 | ||
20 | |||
19 | #endif /* !(_SPARC_IOMMU_H) */ | 21 | #endif /* !(_SPARC_IOMMU_H) */ |
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/pbm.h b/include/asm-sparc64/pbm.h index 92999631c819..4c15610a2bac 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/iommu.h> | ||
18 | 19 | ||
19 | /* The abstraction used here is that there are PCI controllers, | 20 | /* The abstraction used here is that there are PCI controllers, |
20 | * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules | 21 | * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules |
@@ -40,9 +41,6 @@ struct pci_iommu { | |||
40 | */ | 41 | */ |
41 | spinlock_t lock; | 42 | spinlock_t lock; |
42 | 43 | ||
43 | /* Context allocator. */ | ||
44 | unsigned int iommu_cur_ctx; | ||
45 | |||
46 | /* IOMMU page table, a linear array of ioptes. */ | 44 | /* IOMMU page table, a linear array of ioptes. */ |
47 | iopte_t *page_table; /* The page table itself. */ | 45 | iopte_t *page_table; /* The page table itself. */ |
48 | int page_table_sz_bits; /* log2 of ow many pages does it map? */ | 46 | int page_table_sz_bits; /* log2 of ow many pages does it map? */ |
@@ -87,6 +85,10 @@ struct pci_iommu { | |||
87 | u16 flush; | 85 | u16 flush; |
88 | } alloc_info[PBM_NCLUSTERS]; | 86 | } alloc_info[PBM_NCLUSTERS]; |
89 | 87 | ||
88 | /* CTX allocation. */ | ||
89 | unsigned long ctx_lowest_free; | ||
90 | unsigned long ctx_bitmap[IOMMU_NUM_CTXS / (sizeof(unsigned long) * 8)]; | ||
91 | |||
90 | /* Here a PCI controller driver describes the areas of | 92 | /* Here a PCI controller driver describes the areas of |
91 | * PCI memory space where DMA to/from physical memory | 93 | * PCI memory space where DMA to/from physical memory |
92 | * are addressed. Drivers interrogate the PCI layer | 94 | * are addressed. Drivers interrogate the PCI layer |
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 | ||
diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h index ad78ce64d69e..9d7613eea812 100644 --- a/include/asm-sparc64/spitfire.h +++ b/include/asm-sparc64/spitfire.h | |||
@@ -48,6 +48,9 @@ enum ultra_tlb_layout { | |||
48 | 48 | ||
49 | extern enum ultra_tlb_layout tlb_type; | 49 | extern enum ultra_tlb_layout tlb_type; |
50 | 50 | ||
51 | extern int cheetah_pcache_forced_on; | ||
52 | extern void cheetah_enable_pcache(void); | ||
53 | |||
51 | #define sparc64_highest_locked_tlbent() \ | 54 | #define sparc64_highest_locked_tlbent() \ |
52 | (tlb_type == spitfire ? \ | 55 | (tlb_type == spitfire ? \ |
53 | SPITFIRE_HIGHEST_LOCKED_TLBENT : \ | 56 | SPITFIRE_HIGHEST_LOCKED_TLBENT : \ |