diff options
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/dma-mapping.h | 141 | ||||
-rw-r--r-- | include/asm-sparc64/pci.h | 4 | ||||
-rw-r--r-- | include/asm-sparc64/pgtable.h | 17 | ||||
-rw-r--r-- | include/asm-sparc64/tlbflush.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/unistd.h | 16 |
5 files changed, 168 insertions, 12 deletions
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index c7d5804ba76d..a8d39f23d43b 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -4,7 +4,146 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | #ifdef CONFIG_PCI | 6 | #ifdef CONFIG_PCI |
7 | #include <asm-generic/dma-mapping.h> | 7 | |
8 | /* we implement the API below in terms of the existing PCI one, | ||
9 | * so include it */ | ||
10 | #include <linux/pci.h> | ||
11 | /* need struct page definitions */ | ||
12 | #include <linux/mm.h> | ||
13 | |||
14 | static inline int | ||
15 | dma_supported(struct device *dev, u64 mask) | ||
16 | { | ||
17 | BUG_ON(dev->bus != &pci_bus_type); | ||
18 | |||
19 | return pci_dma_supported(to_pci_dev(dev), mask); | ||
20 | } | ||
21 | |||
22 | static inline int | ||
23 | dma_set_mask(struct device *dev, u64 dma_mask) | ||
24 | { | ||
25 | BUG_ON(dev->bus != &pci_bus_type); | ||
26 | |||
27 | return pci_set_dma_mask(to_pci_dev(dev), dma_mask); | ||
28 | } | ||
29 | |||
30 | static inline void * | ||
31 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | ||
32 | gfp_t flag) | ||
33 | { | ||
34 | BUG_ON(dev->bus != &pci_bus_type); | ||
35 | |||
36 | return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag); | ||
37 | } | ||
38 | |||
39 | static inline void | ||
40 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | ||
41 | dma_addr_t dma_handle) | ||
42 | { | ||
43 | BUG_ON(dev->bus != &pci_bus_type); | ||
44 | |||
45 | pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); | ||
46 | } | ||
47 | |||
48 | static inline dma_addr_t | ||
49 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, | ||
50 | enum dma_data_direction direction) | ||
51 | { | ||
52 | BUG_ON(dev->bus != &pci_bus_type); | ||
53 | |||
54 | return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); | ||
55 | } | ||
56 | |||
57 | static inline void | ||
58 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
59 | enum dma_data_direction direction) | ||
60 | { | ||
61 | BUG_ON(dev->bus != &pci_bus_type); | ||
62 | |||
63 | pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); | ||
64 | } | ||
65 | |||
66 | static inline dma_addr_t | ||
67 | dma_map_page(struct device *dev, struct page *page, | ||
68 | unsigned long offset, size_t size, | ||
69 | enum dma_data_direction direction) | ||
70 | { | ||
71 | BUG_ON(dev->bus != &pci_bus_type); | ||
72 | |||
73 | return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); | ||
74 | } | ||
75 | |||
76 | static inline void | ||
77 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | ||
78 | enum dma_data_direction direction) | ||
79 | { | ||
80 | BUG_ON(dev->bus != &pci_bus_type); | ||
81 | |||
82 | pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); | ||
83 | } | ||
84 | |||
85 | static inline int | ||
86 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
87 | enum dma_data_direction direction) | ||
88 | { | ||
89 | BUG_ON(dev->bus != &pci_bus_type); | ||
90 | |||
91 | return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); | ||
92 | } | ||
93 | |||
94 | static inline void | ||
95 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, | ||
96 | enum dma_data_direction direction) | ||
97 | { | ||
98 | BUG_ON(dev->bus != &pci_bus_type); | ||
99 | |||
100 | pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); | ||
101 | } | ||
102 | |||
103 | static inline void | ||
104 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
105 | enum dma_data_direction direction) | ||
106 | { | ||
107 | BUG_ON(dev->bus != &pci_bus_type); | ||
108 | |||
109 | pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, | ||
110 | size, (int)direction); | ||
111 | } | ||
112 | |||
113 | static inline void | ||
114 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
115 | enum dma_data_direction direction) | ||
116 | { | ||
117 | BUG_ON(dev->bus != &pci_bus_type); | ||
118 | |||
119 | pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, | ||
120 | size, (int)direction); | ||
121 | } | ||
122 | |||
123 | static inline void | ||
124 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, | ||
125 | enum dma_data_direction direction) | ||
126 | { | ||
127 | BUG_ON(dev->bus != &pci_bus_type); | ||
128 | |||
129 | pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); | ||
130 | } | ||
131 | |||
132 | static inline void | ||
133 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, | ||
134 | enum dma_data_direction direction) | ||
135 | { | ||
136 | BUG_ON(dev->bus != &pci_bus_type); | ||
137 | |||
138 | pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); | ||
139 | } | ||
140 | |||
141 | static inline int | ||
142 | dma_mapping_error(dma_addr_t dma_addr) | ||
143 | { | ||
144 | return pci_dma_mapping_error(dma_addr); | ||
145 | } | ||
146 | |||
8 | #else | 147 | #else |
9 | 148 | ||
10 | struct device; | 149 | struct device; |
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 7c5a589ea437..e1ea67bc32f2 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h | |||
@@ -42,7 +42,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
42 | struct pci_dev; | 42 | struct pci_dev; |
43 | 43 | ||
44 | struct pci_iommu_ops { | 44 | struct pci_iommu_ops { |
45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *); | 45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *, gfp_t); |
46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); | 46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); |
47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); | 47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); |
48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); | 48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); |
@@ -59,7 +59,7 @@ extern struct pci_iommu_ops *pci_iommu_ops; | |||
59 | */ | 59 | */ |
60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) | 60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) |
61 | { | 61 | { |
62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle); | 62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle, GFP_ATOMIC); |
63 | } | 63 | } |
64 | 64 | ||
65 | /* Free and unmap a consistent DMA buffer. | 65 | /* Free and unmap a consistent DMA buffer. |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index c44e7466534e..cd464f469a2c 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -689,6 +689,23 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p | |||
689 | #define pte_clear(mm,addr,ptep) \ | 689 | #define pte_clear(mm,addr,ptep) \ |
690 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) | 690 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) |
691 | 691 | ||
692 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
693 | #define __HAVE_ARCH_MOVE_PTE | ||
694 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
695 | ({ \ | ||
696 | pte_t newpte = (pte); \ | ||
697 | if (tlb_type != hypervisor && pte_present(pte)) { \ | ||
698 | unsigned long this_pfn = pte_pfn(pte); \ | ||
699 | \ | ||
700 | if (pfn_valid(this_pfn) && \ | ||
701 | (((old_addr) ^ (new_addr)) & (1 << 13))) \ | ||
702 | flush_dcache_page_all(current->mm, \ | ||
703 | pfn_to_page(this_pfn)); \ | ||
704 | } \ | ||
705 | newpte; \ | ||
706 | }) | ||
707 | #endif | ||
708 | |||
692 | extern pgd_t swapper_pg_dir[2048]; | 709 | extern pgd_t swapper_pg_dir[2048]; |
693 | extern pmd_t swapper_low_pmd_dir[2048]; | 710 | extern pmd_t swapper_low_pmd_dir[2048]; |
694 | 711 | ||
diff --git a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h index 9ad5d9c51d42..e3a7c453b500 100644 --- a/include/asm-sparc64/tlbflush.h +++ b/include/asm-sparc64/tlbflush.h | |||
@@ -22,8 +22,6 @@ extern void flush_tlb_pending(void); | |||
22 | /* Local cpu only. */ | 22 | /* Local cpu only. */ |
23 | extern void __flush_tlb_all(void); | 23 | extern void __flush_tlb_all(void); |
24 | 24 | ||
25 | extern void __flush_tlb_page(unsigned long context, unsigned long page, unsigned long r); | ||
26 | |||
27 | extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); | 25 | extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); |
28 | 26 | ||
29 | #ifndef CONFIG_SMP | 27 | #ifndef CONFIG_SMP |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index d0544b4f47b7..998ef4ab0e06 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #define __NR_capset 22 /* Linux Specific */ | 41 | #define __NR_capset 22 /* Linux Specific */ |
42 | #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ | 42 | #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ |
43 | #define __NR_getuid 24 /* Common */ | 43 | #define __NR_getuid 24 /* Common */ |
44 | /* #define __NR_time alias 25 ENOSYS under SunOS */ | 44 | #define __NR_vmsplice 25 /* ENOSYS under SunOS */ |
45 | #define __NR_ptrace 26 /* Common */ | 45 | #define __NR_ptrace 26 /* Common */ |
46 | #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ | 46 | #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ |
47 | #define __NR_sigaltstack 28 /* Common */ | 47 | #define __NR_sigaltstack 28 /* Common */ |
@@ -250,7 +250,7 @@ | |||
250 | #ifdef __KERNEL__ | 250 | #ifdef __KERNEL__ |
251 | #define __NR_time 231 /* Linux sparc32 */ | 251 | #define __NR_time 231 /* Linux sparc32 */ |
252 | #endif | 252 | #endif |
253 | #define __NR_sys_splice 232 /* Linux Specific */ | 253 | #define __NR_splice 232 /* Linux Specific */ |
254 | #define __NR_stime 233 /* Linux Specific */ | 254 | #define __NR_stime 233 /* Linux Specific */ |
255 | #define __NR_statfs64 234 /* Linux Specific */ | 255 | #define __NR_statfs64 234 /* Linux Specific */ |
256 | #define __NR_fstatfs64 235 /* Linux Specific */ | 256 | #define __NR_fstatfs64 235 /* Linux Specific */ |
@@ -273,7 +273,7 @@ | |||
273 | #define __NR_getsid 252 | 273 | #define __NR_getsid 252 |
274 | #define __NR_fdatasync 253 | 274 | #define __NR_fdatasync 253 |
275 | #define __NR_nfsservctl 254 | 275 | #define __NR_nfsservctl 254 |
276 | #define __NR_sys_sync_file_range 255 | 276 | #define __NR_sync_file_range 255 |
277 | #define __NR_clock_settime 256 | 277 | #define __NR_clock_settime 256 |
278 | #define __NR_clock_gettime 257 | 278 | #define __NR_clock_gettime 257 |
279 | #define __NR_clock_getres 258 | 279 | #define __NR_clock_getres 258 |
@@ -298,7 +298,7 @@ | |||
298 | #define __NR_mq_notify 277 | 298 | #define __NR_mq_notify 277 |
299 | #define __NR_mq_getsetattr 278 | 299 | #define __NR_mq_getsetattr 278 |
300 | #define __NR_waitid 279 | 300 | #define __NR_waitid 279 |
301 | /*#define __NR_sys_setaltroot 280 available (was setaltroot) */ | 301 | #define __NR_tee 280 |
302 | #define __NR_add_key 281 | 302 | #define __NR_add_key 281 |
303 | #define __NR_request_key 282 | 303 | #define __NR_request_key 282 |
304 | #define __NR_keyctl 283 | 304 | #define __NR_keyctl 283 |
@@ -318,11 +318,13 @@ | |||
318 | #define __NR_pselect6 297 | 318 | #define __NR_pselect6 297 |
319 | #define __NR_ppoll 298 | 319 | #define __NR_ppoll 298 |
320 | #define __NR_unshare 299 | 320 | #define __NR_unshare 299 |
321 | #define __NR_set_robust_list 300 | ||
322 | #define __NR_get_robust_list 301 | ||
321 | 323 | ||
322 | /* WARNING: You MAY NOT add syscall numbers larger than 299, since | 324 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since |
323 | * all of the syscall tables in the Sparc kernel are | 325 | * all of the syscall tables in the Sparc kernel are |
324 | * sized to have 299 entries (starting at zero). Therefore | 326 | * sized to have 301 entries (starting at zero). Therefore |
325 | * find a free slot in the 0-299 range. | 327 | * find a free slot in the 0-301 range. |
326 | */ | 328 | */ |
327 | 329 | ||
328 | #define _syscall0(type,name) \ | 330 | #define _syscall0(type,name) \ |