aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-24 04:22:21 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-24 04:22:21 -0400
commit66643de455c27973ac31ad6de9f859d399916842 (patch)
tree7ebed7f051879007d4b11d6aaa9e65a1bcb0b08f /include/asm-sparc64
parent2c23d62abb820e19c54012520f08a198c2233a85 (diff)
parent387e2b0439026aa738a9edca15a57e5c0bcb4dfc (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: include/asm-powerpc/unistd.h include/asm-sparc/unistd.h include/asm-sparc64/unistd.h Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/dma-mapping.h141
-rw-r--r--include/asm-sparc64/pci.h4
-rw-r--r--include/asm-sparc64/unistd.h8
3 files changed, 147 insertions, 6 deletions
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index c902a96d1d48..3c2b5bc8650b 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -3,7 +3,146 @@
3 3
4 4
5#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
6#include <asm-generic/dma-mapping.h> 6
7/* we implement the API below in terms of the existing PCI one,
8 * so include it */
9#include <linux/pci.h>
10/* need struct page definitions */
11#include <linux/mm.h>
12
13static inline int
14dma_supported(struct device *dev, u64 mask)
15{
16 BUG_ON(dev->bus != &pci_bus_type);
17
18 return pci_dma_supported(to_pci_dev(dev), mask);
19}
20
21static inline int
22dma_set_mask(struct device *dev, u64 dma_mask)
23{
24 BUG_ON(dev->bus != &pci_bus_type);
25
26 return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
27}
28
29static inline void *
30dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
31 gfp_t flag)
32{
33 BUG_ON(dev->bus != &pci_bus_type);
34
35 return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag);
36}
37
38static inline void
39dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
40 dma_addr_t dma_handle)
41{
42 BUG_ON(dev->bus != &pci_bus_type);
43
44 pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle);
45}
46
47static inline dma_addr_t
48dma_map_single(struct device *dev, void *cpu_addr, size_t size,
49 enum dma_data_direction direction)
50{
51 BUG_ON(dev->bus != &pci_bus_type);
52
53 return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction);
54}
55
56static inline void
57dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
58 enum dma_data_direction direction)
59{
60 BUG_ON(dev->bus != &pci_bus_type);
61
62 pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction);
63}
64
65static inline dma_addr_t
66dma_map_page(struct device *dev, struct page *page,
67 unsigned long offset, size_t size,
68 enum dma_data_direction direction)
69{
70 BUG_ON(dev->bus != &pci_bus_type);
71
72 return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction);
73}
74
75static inline void
76dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
77 enum dma_data_direction direction)
78{
79 BUG_ON(dev->bus != &pci_bus_type);
80
81 pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction);
82}
83
84static inline int
85dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
86 enum dma_data_direction direction)
87{
88 BUG_ON(dev->bus != &pci_bus_type);
89
90 return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction);
91}
92
93static inline void
94dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
95 enum dma_data_direction direction)
96{
97 BUG_ON(dev->bus != &pci_bus_type);
98
99 pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction);
100}
101
102static inline void
103dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
104 enum dma_data_direction direction)
105{
106 BUG_ON(dev->bus != &pci_bus_type);
107
108 pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle,
109 size, (int)direction);
110}
111
112static inline void
113dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
114 enum dma_data_direction direction)
115{
116 BUG_ON(dev->bus != &pci_bus_type);
117
118 pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle,
119 size, (int)direction);
120}
121
122static inline void
123dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
124 enum dma_data_direction direction)
125{
126 BUG_ON(dev->bus != &pci_bus_type);
127
128 pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction);
129}
130
131static inline void
132dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
133 enum dma_data_direction direction)
134{
135 BUG_ON(dev->bus != &pci_bus_type);
136
137 pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction);
138}
139
140static inline int
141dma_mapping_error(dma_addr_t dma_addr)
142{
143 return pci_dma_mapping_error(dma_addr);
144}
145
7#else 146#else
8 147
9struct device; 148struct 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)
42struct pci_dev; 42struct pci_dev;
43 43
44struct pci_iommu_ops { 44struct 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 */
60static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) 60static 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/unistd.h b/include/asm-sparc64/unistd.h
index a73b7ce1a042..badc73fdcb97 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -318,12 +318,14 @@
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#ifdef __KERNEL__ 324#ifdef __KERNEL__
323/* WARNING: You MAY NOT add syscall numbers larger than 299, since 325/* WARNING: You MAY NOT add syscall numbers larger than 301, since
324 * all of the syscall tables in the Sparc kernel are 326 * all of the syscall tables in the Sparc kernel are
325 * sized to have 299 entries (starting at zero). Therefore 327 * sized to have 301 entries (starting at zero). Therefore
326 * find a free slot in the 0-299 range. 328 * find a free slot in the 0-301 range.
327 */ 329 */
328 330
329#define _syscall0(type,name) \ 331#define _syscall0(type,name) \