Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
linux
Commits
180cc17d
Commit
180cc17d
authored
21 years ago
by
Linus Torvalds
Browse files
Options
Download
Plain Diff
Merge
bk://linux-scsi.bkbits.net/scsi-for-linus-2.6
into ppc970.osdl.org:/home/torvalds/v2.5/linux
parents
e1efdea5
265395f4
Changes
244
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
346 additions
and
102 deletions
+346
-102
Documentation/DMA-mapping.txt
Documentation/DMA-mapping.txt
+44
-12
arch/alpha/kernel/alpha_ksyms.c
arch/alpha/kernel/alpha_ksyms.c
+0
-3
arch/alpha/kernel/smp.c
arch/alpha/kernel/smp.c
+0
-3
arch/arm/common/sa1111-pcibuf.c
arch/arm/common/sa1111-pcibuf.c
+44
-6
arch/cris/kernel/process.c
arch/cris/kernel/process.c
+0
-2
arch/i386/kernel/setup.c
arch/i386/kernel/setup.c
+7
-0
arch/ia64/lib/swiotlb.c
arch/ia64/lib/swiotlb.c
+36
-8
arch/ia64/sn/io/machvec/pci_dma.c
arch/ia64/sn/io/machvec/pci_dma.c
+45
-11
arch/mips/mm/dma-coherent.c
arch/mips/mm/dma-coherent.c
+41
-8
arch/mips/mm/dma-ip27.c
arch/mips/mm/dma-ip27.c
+41
-8
arch/mips/mm/dma-noncoherent.c
arch/mips/mm/dma-noncoherent.c
+59
-8
arch/parisc/kernel/pci-dma.c
arch/parisc/kernel/pci-dma.c
+29
-7
arch/parisc/kernel/process.c
arch/parisc/kernel/process.c
+0
-1
arch/parisc/kernel/smp.c
arch/parisc/kernel/smp.c
+0
-1
arch/ppc/kernel/misc.S
arch/ppc/kernel/misc.S
+0
-10
arch/ppc/kernel/ppc_ksyms.c
arch/ppc/kernel/ppc_ksyms.c
+0
-6
arch/ppc/kernel/smp.c
arch/ppc/kernel/smp.c
+0
-2
arch/ppc/platforms/chrp_smp.c
arch/ppc/platforms/chrp_smp.c
+0
-2
arch/ppc/platforms/pmac_smp.c
arch/ppc/platforms/pmac_smp.c
+0
-2
arch/ppc64/kernel/pmac_smp.c
arch/ppc64/kernel/pmac_smp.c
+0
-2
No files found.
Documentation/DMA-mapping.txt
View file @
180cc17d
...
...
@@ -283,7 +283,7 @@ There are two types of DMA mappings:
in order to get correct behavior on all platforms.
- Streaming DMA mappings which are usually mapped for one DMA transfer,
unmapped right after it (unless you use pci_dma_sync below) and for which
unmapped right after it (unless you use pci_dma_sync
_*
below) and for which
hardware can optimize for sequential accesses.
This of "streaming" as "asynchronous" or "outside the coherency
...
...
@@ -543,14 +543,30 @@ same bus address space) and you could render the machine unusable by eating
all bus addresses.
If you need to use the same streaming DMA region multiple times and touch
the data in between the DMA transfers, just map it with
pci_map_{single,sg}, and after each DMA transfer call either:
the data in between the DMA transfers, the buffer needs to be synced
properly in order for the cpu and device to see the most uptodate and
correct copy of the DMA buffer.
pci_dma_sync_single(dev, dma_handle, size, direction);
So, firstly, just map it with pci_map_{single,sg}, and after each DMA
transfer call either:
pci_dma_sync_single_for_cpu(dev, dma_handle, size, direction);
or:
pci_dma_sync_sg(dev, sglist, nents, direction);
pci_dma_sync_sg_for_cpu(dev, sglist, nents, direction);
as appropriate.
Then, if you wish to let the device get at the DMA area again,
finish accessing the data with the cpu, and then before actually
giving the buffer to the hardware call either:
pci_dma_sync_single_for_device(dev, dma_handle, size, direction);
or:
pci_dma_sync_sg_for_device(dev, sglist, nents, direction);
as appropriate.
...
...
@@ -590,8 +606,9 @@ to use the pci_dma_sync_*() interfaces.
* the DMA transfer with the CPU first
* so that we see updated contents.
*/
pci_dma_sync_single(cp->pdev, cp->rx_dma, cp->rx_len,
PCI_DMA_FROMDEVICE);
pci_dma_sync_single_for_cpu(cp->pdev, cp->rx_dma,
cp->rx_len,
PCI_DMA_FROMDEVICE);
/* Now it is safe to examine the buffer. */
hp = (struct my_card_header *) cp->rx_buf;
...
...
@@ -601,7 +618,13 @@ to use the pci_dma_sync_*() interfaces.
pass_to_upper_layers(cp->rx_buf);
make_and_setup_new_rx_buf(cp);
} else {
/* Just give the buffer back to the card. */
/* Just sync the buffer and give it back
* to the card.
*/
pci_dma_sync_single_for_device(cp->pdev,
cp->rx_dma,
cp->rx_len,
PCI_DMA_FROMDEVICE);
give_rx_buf_to_card(cp);
}
}
...
...
@@ -709,12 +732,21 @@ interfaces. To reiterate:
When the DMA transfer is complete, invoke:
void pci_dac_dma_sync_single(struct pci_dev *pdev,
dma64_addr_t dma_addr,
size_t len, int direction);
void pci_dac_dma_sync_single
_for_cpu
(struct pci_dev *pdev,
dma64_addr_t dma_addr,
size_t len, int direction);
This must be done before the CPU looks at the buffer again.
This interface behaves identically to pci_dma_sync_{single,sg}().
This interface behaves identically to pci_dma_sync_{single,sg}_for_cpu().
And likewise, if you wish to let the device get back at the buffer after
the cpu has read/written it, invoke:
void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev,
dma64_addr_t dma_addr,
size_t len, int direction);
before letting the device access the DMA area again.
If you need to get back to the PAGE/OFFSET tuple from a dma64_addr_t
the following interfaces are provided:
...
...
This diff is collapsed.
Click to expand it.
arch/alpha/kernel/alpha_ksyms.c
View file @
180cc17d
...
...
@@ -35,9 +35,6 @@
#include <asm/cacheflush.h>
#include <asm/vga.h>
#define __KERNEL_SYSCALLS__
#include <asm/unistd.h>
extern
struct
hwrpb_struct
*
hwrpb
;
extern
void
dump_thread
(
struct
pt_regs
*
,
struct
user
*
);
extern
spinlock_t
rtc_lock
;
...
...
This diff is collapsed.
Click to expand it.
arch/alpha/kernel/smp.c
View file @
180cc17d
...
...
@@ -39,9 +39,6 @@
#include <asm/mmu_context.h>
#include <asm/tlbflush.h>
#define __KERNEL_SYSCALLS__
#include <asm/unistd.h>
#include "proto.h"
#include "irq_impl.h"
...
...
This diff is collapsed.
Click to expand it.
arch/arm/common/sa1111-pcibuf.c
View file @
180cc17d
...
...
@@ -457,8 +457,8 @@ void sa1111_unmap_sg(struct device *dev, struct scatterlist *sg,
local_irq_restore
(
flags
);
}
void
sa1111_dma_sync_single
(
struct
device
*
dev
,
dma_addr_t
dma_addr
,
size_t
size
,
enum
dma_data_direction
dir
)
void
sa1111_dma_sync_single
_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_addr
,
size_t
size
,
enum
dma_data_direction
dir
)
{
unsigned
long
flags
;
...
...
@@ -472,8 +472,44 @@ void sa1111_dma_sync_single(struct device *dev, dma_addr_t dma_addr,
local_irq_restore
(
flags
);
}
void
sa1111_dma_sync_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nents
,
enum
dma_data_direction
dir
)
void
sa1111_dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_addr
,
size_t
size
,
enum
dma_data_direction
dir
)
{
unsigned
long
flags
;
dev_dbg
(
dev
,
"%s(ptr=%08lx,size=%d,dir=%x)
\n
"
,
__func__
,
dma_addr
,
size
,
dir
);
local_irq_save
(
flags
);
sync_single
(
dev
,
dma_addr
,
size
,
dir
);
local_irq_restore
(
flags
);
}
void
sa1111_dma_sync_sg_for_cpu
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nents
,
enum
dma_data_direction
dir
)
{
unsigned
long
flags
;
int
i
;
dev_dbg
(
dev
,
"%s(sg=%p,nents=%d,dir=%x)
\n
"
,
__func__
,
sg
,
nents
,
dir
);
local_irq_save
(
flags
);
for
(
i
=
0
;
i
<
nents
;
i
++
,
sg
++
)
{
dma_addr_t
dma_addr
=
sg
->
dma_address
;
unsigned
int
length
=
sg
->
length
;
sync_single
(
dev
,
dma_addr
,
length
,
dir
);
}
local_irq_restore
(
flags
);
}
void
sa1111_dma_sync_sg_for_device
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nents
,
enum
dma_data_direction
dir
)
{
unsigned
long
flags
;
int
i
;
...
...
@@ -497,8 +533,10 @@ EXPORT_SYMBOL(sa1111_map_single);
EXPORT_SYMBOL
(
sa1111_unmap_single
);
EXPORT_SYMBOL
(
sa1111_map_sg
);
EXPORT_SYMBOL
(
sa1111_unmap_sg
);
EXPORT_SYMBOL
(
sa1111_dma_sync_single
);
EXPORT_SYMBOL
(
sa1111_dma_sync_sg
);
EXPORT_SYMBOL
(
sa1111_dma_sync_single_for_cpu
);
EXPORT_SYMBOL
(
sa1111_dma_sync_single_for_device
);
EXPORT_SYMBOL
(
sa1111_dma_sync_sg_for_cpu
);
EXPORT_SYMBOL
(
sa1111_dma_sync_sg_for_device
);
/* **************************************** */
...
...
This diff is collapsed.
Click to expand it.
arch/cris/kernel/process.c
View file @
180cc17d
...
...
@@ -91,8 +91,6 @@
* This file handles the architecture-dependent parts of process handling..
*/
#define __KERNEL_SYSCALLS__
#include <asm/atomic.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
...
...
This diff is collapsed.
Click to expand it.
arch/i386/kernel/setup.c
View file @
180cc17d
...
...
@@ -832,6 +832,13 @@ static unsigned long __init setup_memory(void)
*/
reserve_bootmem
(
0
,
PAGE_SIZE
);
/* could be an AMD 768MPX chipset. Reserve a page before VGA to prevent
PCI prefetch into it (errata #56). Usually the page is reserved anyways,
unless you have no PS/2 mouse plugged in. */
if
(
boot_cpu_data
.
x86_vendor
==
X86_VENDOR_AMD
&&
boot_cpu_data
.
x86
==
6
)
reserve_bootmem
(
0xa0000
-
4096
,
4096
);
#ifdef CONFIG_SMP
/*
* But first pinch a few for the stack/trampoline stuff
...
...
This diff is collapsed.
Click to expand it.
arch/ia64/lib/swiotlb.c
View file @
180cc17d
...
...
@@ -47,7 +47,7 @@
#define IO_TLB_SHIFT 11
/*
* Used to do a quick range check in swiotlb_unmap_single and swiotlb_sync_single, to see
* Used to do a quick range check in swiotlb_unmap_single and swiotlb_sync_single
_*
, to see
* if the memory was in fact allocated by this API.
*/
static
char
*
io_tlb_start
,
*
io_tlb_end
;
...
...
@@ -381,11 +381,24 @@ swiotlb_unmap_single (struct device *hwdev, dma_addr_t dev_addr, size_t size, in
*
* If you perform a swiotlb_map_single() but wish to interrogate the buffer using the cpu,
* yet do not wish to teardown the PCI dma mapping, you must call this function before
* doing so. At the next point you give the PCI dma address back to the card,
the device
* again owns the buffer
.
* doing so. At the next point you give the PCI dma address back to the card,
you must
*
first perform a swiotlb_dma_sync_for_device, and then the device
again owns the buffer
*/
void
swiotlb_sync_single
(
struct
device
*
hwdev
,
dma_addr_t
dev_addr
,
size_t
size
,
int
dir
)
swiotlb_sync_single_for_cpu
(
struct
device
*
hwdev
,
dma_addr_t
dev_addr
,
size_t
size
,
int
dir
)
{
char
*
dma_addr
=
phys_to_virt
(
dev_addr
);
if
(
dir
==
DMA_NONE
)
BUG
();
if
(
dma_addr
>=
io_tlb_start
&&
dma_addr
<
io_tlb_end
)
sync_single
(
hwdev
,
dma_addr
,
size
,
dir
);
else
if
(
dir
==
DMA_FROM_DEVICE
)
mark_clean
(
dma_addr
,
size
);
}
void
swiotlb_sync_single_for_device
(
struct
device
*
hwdev
,
dma_addr_t
dev_addr
,
size_t
size
,
int
dir
)
{
char
*
dma_addr
=
phys_to_virt
(
dev_addr
);
...
...
@@ -456,11 +469,24 @@ swiotlb_unmap_sg (struct device *hwdev, struct scatterlist *sg, int nelems, int
* Make physical memory consistent for a set of streaming mode DMA translations after a
* transfer.
*
* The same as swiotlb_
dma_
sync_single but for a scatter-gather list, same rules and
* The same as swiotlb_sync_single
_*
but for a scatter-gather list, same rules and
* usage.
*/
void
swiotlb_sync_sg
(
struct
device
*
hwdev
,
struct
scatterlist
*
sg
,
int
nelems
,
int
dir
)
swiotlb_sync_sg_for_cpu
(
struct
device
*
hwdev
,
struct
scatterlist
*
sg
,
int
nelems
,
int
dir
)
{
int
i
;
if
(
dir
==
DMA_NONE
)
BUG
();
for
(
i
=
0
;
i
<
nelems
;
i
++
,
sg
++
)
if
(
sg
->
dma_address
!=
SG_ENT_PHYS_ADDRESS
(
sg
))
sync_single
(
hwdev
,
(
void
*
)
sg
->
dma_address
,
sg
->
dma_length
,
dir
);
}
void
swiotlb_sync_sg_for_device
(
struct
device
*
hwdev
,
struct
scatterlist
*
sg
,
int
nelems
,
int
dir
)
{
int
i
;
...
...
@@ -488,8 +514,10 @@ EXPORT_SYMBOL(swiotlb_map_single);
EXPORT_SYMBOL
(
swiotlb_unmap_single
);
EXPORT_SYMBOL
(
swiotlb_map_sg
);
EXPORT_SYMBOL
(
swiotlb_unmap_sg
);
EXPORT_SYMBOL
(
swiotlb_sync_single
);
EXPORT_SYMBOL
(
swiotlb_sync_sg
);
EXPORT_SYMBOL
(
swiotlb_sync_single_for_cpu
);
EXPORT_SYMBOL
(
swiotlb_sync_single_for_device
);
EXPORT_SYMBOL
(
swiotlb_sync_sg_for_cpu
);
EXPORT_SYMBOL
(
swiotlb_sync_sg_for_device
);
EXPORT_SYMBOL
(
swiotlb_alloc_coherent
);
EXPORT_SYMBOL
(
swiotlb_free_coherent
);
EXPORT_SYMBOL
(
swiotlb_dma_supported
);
This diff is collapsed.
Click to expand it.
arch/ia64/sn/io/machvec/pci_dma.c
View file @
180cc17d
...
...
@@ -437,7 +437,8 @@ sn_pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int
}
/**
* sn_pci_dma_sync_single - make sure all DMAs have completed
* sn_pci_dma_sync_single_* - make sure all DMAs or CPU accesses
* have completed
* @hwdev: device to sync
* @dma_handle: DMA address to sync
* @size: size of region
...
...
@@ -448,14 +449,19 @@ sn_pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int
* anything on our platform.
*/
void
sn_pci_dma_sync_single
(
struct
pci_dev
*
hwdev
,
dma_addr_t
dma_handle
,
size_t
size
,
int
direction
)
sn_pci_dma_sync_single
_for_cpu
(
struct
pci_dev
*
hwdev
,
dma_addr_t
dma_handle
,
size_t
size
,
int
direction
)
{
return
;
}
void
sn_pci_dma_sync_single_for_device
(
struct
pci_dev
*
hwdev
,
dma_addr_t
dma_handle
,
size_t
size
,
int
direction
)
{
return
;
}
/**
* sn_pci_dma_sync_sg - make sure all DMAs have completed
* sn_pci_dma_sync_sg
_*
- make sure all DMAs
or CPU accesses
have completed
* @hwdev: device to sync
* @sg: scatterlist to sync
* @nents: number of entries in the scatterlist
...
...
@@ -466,10 +472,15 @@ sn_pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size
* on our platform.
*/
void
sn_pci_dma_sync_sg
(
struct
pci_dev
*
hwdev
,
struct
scatterlist
*
sg
,
int
nents
,
int
direction
)
sn_pci_dma_sync_sg
_for_cpu
(
struct
pci_dev
*
hwdev
,
struct
scatterlist
*
sg
,
int
nents
,
int
direction
)
{
return
;
}
void
sn_pci_dma_sync_sg_for_device
(
struct
pci_dev
*
hwdev
,
struct
scatterlist
*
sg
,
int
nents
,
int
direction
)
{
return
;
}
/**
...
...
@@ -602,28 +613,51 @@ sn_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
EXPORT_SYMBOL
(
sn_dma_unmap_sg
);
void
sn_dma_sync_single
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
sn_dma_sync_single_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
int
direction
)
{
BUG_ON
(
dev
->
bus
!=
&
pci_bus_type
);
sn_pci_dma_sync_single_for_cpu
(
to_pci_dev
(
dev
),
dma_handle
,
size
,
(
int
)
direction
);
}
EXPORT_SYMBOL
(
sn_dma_sync_single_for_cpu
);
void
sn_dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
int
direction
)
{
BUG_ON
(
dev
->
bus
!=
&
pci_bus_type
);
sn_pci_dma_sync_single
(
to_pci_dev
(
dev
),
dma_handle
,
size
,
(
int
)
direction
);
sn_pci_dma_sync_single_for_device
(
to_pci_dev
(
dev
),
dma_handle
,
size
,
(
int
)
direction
);
}
EXPORT_SYMBOL
(
sn_dma_sync_single_for_device
);
void
sn_dma_sync_sg_for_cpu
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
int
direction
)
{
BUG_ON
(
dev
->
bus
!=
&
pci_bus_type
);
sn_pci_dma_sync_sg_for_cpu
(
to_pci_dev
(
dev
),
sg
,
nelems
,
(
int
)
direction
);
}
EXPORT_SYMBOL
(
sn_dma_sync_s
ingle
);
EXPORT_SYMBOL
(
sn_dma_sync_s
g_for_cpu
);
void
sn_dma_sync_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
sn_dma_sync_sg
_for_device
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
int
direction
)
{
BUG_ON
(
dev
->
bus
!=
&
pci_bus_type
);
sn_pci_dma_sync_sg
(
to_pci_dev
(
dev
),
sg
,
nelems
,
(
int
)
direction
);
sn_pci_dma_sync_sg
_for_device
(
to_pci_dev
(
dev
),
sg
,
nelems
,
(
int
)
direction
);
}
EXPORT_SYMBOL
(
sn_dma_sync_sg
);
EXPORT_SYMBOL
(
sn_dma_sync_sg
_for_device
);
EXPORT_SYMBOL
(
sn_pci_unmap_single
);
EXPORT_SYMBOL
(
sn_pci_map_single
);
EXPORT_SYMBOL
(
sn_pci_dma_sync_single
);
EXPORT_SYMBOL
(
sn_pci_dma_sync_single_for_cpu
);
EXPORT_SYMBOL
(
sn_pci_dma_sync_single_for_device
);
EXPORT_SYMBOL
(
sn_pci_dma_sync_sg_for_cpu
);
EXPORT_SYMBOL
(
sn_pci_dma_sync_sg_for_device
);
EXPORT_SYMBOL
(
sn_pci_map_sg
);
EXPORT_SYMBOL
(
sn_pci_unmap_sg
);
EXPORT_SYMBOL
(
sn_pci_alloc_consistent
);
...
...
This diff is collapsed.
Click to expand it.
arch/mips/mm/dma-coherent.c
View file @
180cc17d
...
...
@@ -119,30 +119,55 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
EXPORT_SYMBOL
(
dma_unmap_sg
);
void
dma_sync_single
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
void
dma_sync_single
_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single
);
EXPORT_SYMBOL
(
dma_sync_single
_for_cpu
);
void
dma_sync_single_range
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
void
dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single_for_device
);
void
dma_sync_single_range_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single_range_for_cpu
);
void
dma_sync_single_range_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single_range
);
EXPORT_SYMBOL
(
dma_sync_single_range
_for_device
);
void
dma_sync_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
void
dma_sync_sg
_for_cpu
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_sg
);
EXPORT_SYMBOL
(
dma_sync_sg_for_cpu
);
void
dma_sync_sg_for_device
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_sg_for_device
);
int
dma_supported
(
struct
device
*
dev
,
u64
mask
)
{
...
...
@@ -204,12 +229,20 @@ unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev,
EXPORT_SYMBOL
(
pci_dac_dma_to_offset
);
void
pci_dac_dma_sync_single
(
struct
pci_dev
*
pdev
,
void
pci_dac_dma_sync_single_for_cpu
(
struct
pci_dev
*
pdev
,
dma64_addr_t
dma_addr
,
size_t
len
,
int
direction
)
{
BUG_ON
(
direction
==
PCI_DMA_NONE
);
}
EXPORT_SYMBOL
(
pci_dac_dma_sync_single_for_cpu
);
void
pci_dac_dma_sync_single_for_device
(
struct
pci_dev
*
pdev
,
dma64_addr_t
dma_addr
,
size_t
len
,
int
direction
)
{
BUG_ON
(
direction
==
PCI_DMA_NONE
);
}
EXPORT_SYMBOL
(
pci_dac_dma_sync_single
);
EXPORT_SYMBOL
(
pci_dac_dma_sync_single
_for_device
);
#endif
/* CONFIG_PCI */
This diff is collapsed.
Click to expand it.
arch/mips/mm/dma-ip27.c
View file @
180cc17d
...
...
@@ -125,30 +125,55 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
EXPORT_SYMBOL
(
dma_unmap_sg
);
void
dma_sync_single
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
void
dma_sync_single
_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single
);
EXPORT_SYMBOL
(
dma_sync_single
_for_cpu
);
void
dma_sync_single_range
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
void
dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single_for_device
);
void
dma_sync_single_range_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single_range_for_cpu
);
void
dma_sync_single_range_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_single_range
);
EXPORT_SYMBOL
(
dma_sync_single_range
_for_device
);
void
dma_sync_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
void
dma_sync_sg
_for_cpu
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_sg
);
EXPORT_SYMBOL
(
dma_sync_sg_for_cpu
);
void
dma_sync_sg_for_device
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
enum
dma_data_direction
direction
)
{
BUG_ON
(
direction
==
DMA_NONE
);
}
EXPORT_SYMBOL
(
dma_sync_sg_for_device
);
int
dma_supported
(
struct
device
*
dev
,
u64
mask
)
{
...
...
@@ -208,10 +233,18 @@ unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev,
EXPORT_SYMBOL
(
pci_dac_dma_to_offset
);
void
pci_dac_dma_sync_single
(
struct
pci_dev
*
pdev
,
void
pci_dac_dma_sync_single_for_cpu
(
struct
pci_dev
*
pdev
,
dma64_addr_t
dma_addr
,
size_t
len
,
int
direction
)
{
BUG_ON
(
direction
==
PCI_DMA_NONE
);
}
EXPORT_SYMBOL
(
pci_dac_dma_sync_single_for_cpu
);
void
pci_dac_dma_sync_single_for_device
(
struct
pci_dev
*
pdev
,
dma64_addr_t
dma_addr
,
size_t
len
,
int
direction
)
{
BUG_ON
(
direction
==
PCI_DMA_NONE
);
}
EXPORT_SYMBOL
(
pci_dac_dma_sync_single
);
EXPORT_SYMBOL
(
pci_dac_dma_sync_single
_for_device
);
This diff is collapsed.
Click to expand it.
arch/mips/mm/dma-noncoherent.c
View file @
180cc17d
...
...
@@ -226,7 +226,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
EXPORT_SYMBOL
(
dma_unmap_sg
);
void
dma_sync_single
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
void
dma_sync_single
_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
direction
)
{
unsigned
long
addr
;
...
...
@@ -237,9 +237,35 @@ void dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size,
__dma_sync
(
addr
,
size
,
direction
);
}
EXPORT_SYMBOL
(
dma_sync_single
);
EXPORT_SYMBOL
(
dma_sync_single
_for_cpu
);
void
dma_sync_single_range
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
void
dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
direction
)
{
unsigned
long
addr
;
BUG_ON
(
direction
==
DMA_NONE
);
addr
=
dma_handle
+
PAGE_OFFSET
;
__dma_sync
(
addr
,
size
,
direction
);
}
EXPORT_SYMBOL
(
dma_sync_single_for_device
);
void
dma_sync_single_range_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
unsigned
long
addr
;
BUG_ON
(
direction
==
DMA_NONE
);
addr
=
dma_handle
+
offset
+
PAGE_OFFSET
;
__dma_sync
(
addr
,
size
,
direction
);
}
EXPORT_SYMBOL
(
dma_sync_single_range_for_cpu
);
void
dma_sync_single_range_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
unsigned
long
addr
;
...
...
@@ -250,9 +276,9 @@ void dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
__dma_sync
(
addr
,
size
,
direction
);
}
EXPORT_SYMBOL
(
dma_sync_single_range
);
EXPORT_SYMBOL
(
dma_sync_single_range
_for_device
);
void
dma_sync_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
void
dma_sync_sg
_for_cpu
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
enum
dma_data_direction
direction
)
{
int
i
;
...
...
@@ -265,7 +291,22 @@ void dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems,
sg
->
length
,
direction
);
}
EXPORT_SYMBOL
(
dma_sync_sg
);
EXPORT_SYMBOL
(
dma_sync_sg_for_cpu
);
void
dma_sync_sg_for_device
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
int
nelems
,
enum
dma_data_direction
direction
)
{
int
i
;
BUG_ON
(
direction
==
DMA_NONE
);
/* Make sure that gcc doesn't leave the empty loop body. */
for
(
i
=
0
;
i
<
nelems
;
i
++
,
sg
++
)
__dma_sync
((
unsigned
long
)
page_address
(
sg
->
page
),
sg
->
length
,
direction
);
}
EXPORT_SYMBOL
(
dma_sync_sg_for_device
);
int
dma_supported
(
struct
device
*
dev
,
u64
mask
)
{
...
...
@@ -329,7 +370,17 @@ unsigned long pci_dac_dma_to_offset(struct pci_dev *pdev,
EXPORT_SYMBOL
(
pci_dac_dma_to_offset
);
void
pci_dac_dma_sync_single
(
struct
pci_dev
*
pdev
,
void
pci_dac_dma_sync_single_for_cpu
(
struct
pci_dev
*
pdev
,
dma64_addr_t
dma_addr
,
size_t
len
,
int
direction
)
{
BUG_ON
(
direction
==
PCI_DMA_NONE
);
dma_cache_wback_inv
(
dma_addr
+
PAGE_OFFSET
,
len
);
}
EXPORT_SYMBOL
(
pci_dac_dma_sync_single_for_cpu
);
void
pci_dac_dma_sync_single_for_device
(
struct
pci_dev
*
pdev
,
dma64_addr_t
dma_addr
,
size_t
len
,
int
direction
)
{
BUG_ON
(
direction
==
PCI_DMA_NONE
);
...
...
@@ -337,6 +388,6 @@ void pci_dac_dma_sync_single(struct pci_dev *pdev,
dma_cache_wback_inv
(
dma_addr
+
PAGE_OFFSET
,
len
);
}
EXPORT_SYMBOL
(
pci_dac_dma_sync_single
);
EXPORT_SYMBOL
(
pci_dac_dma_sync_single
_for_device
);
#endif
/* CONFIG_PCI */
This diff is collapsed.
Click to expand it.
arch/parisc/kernel/pci-dma.c
View file @
180cc17d
...
...
@@ -413,7 +413,7 @@ static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, siz
/*
* For PCI_DMA_FROMDEVICE this flush is not necessary for the
* simple map/unmap case. However, it IS necessary if if
* pci_dma_sync_single has been called and the buffer reused.
* pci_dma_sync_single
_*
has been called and the buffer reused.
*/
flush_kernel_dcache_range
((
unsigned
long
)
phys_to_virt
(
dma_handle
),
size
);
...
...
@@ -453,7 +453,7 @@ static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, in
return
;
}
static
void
pa11_dma_sync_single
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
static
void
pa11_dma_sync_single
_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
if
(
direction
==
DMA_NONE
)
BUG
();
...
...
@@ -461,7 +461,25 @@ static void pa11_dma_sync_single(struct device *dev, dma_addr_t dma_handle, unsi
flush_kernel_dcache_range
((
unsigned
long
)
phys_to_virt
(
dma_handle
)
+
offset
,
size
);
}
static
void
pa11_dma_sync_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sglist
,
int
nents
,
enum
dma_data_direction
direction
)
static
void
pa11_dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
if
(
direction
==
DMA_NONE
)
BUG
();
flush_kernel_dcache_range
((
unsigned
long
)
phys_to_virt
(
dma_handle
)
+
offset
,
size
);
}
static
void
pa11_dma_sync_sg_for_cpu
(
struct
device
*
dev
,
struct
scatterlist
*
sglist
,
int
nents
,
enum
dma_data_direction
direction
)
{
int
i
;
/* once we do combining we'll need to use phys_to_virt(sg_dma_address(sglist)) */
for
(
i
=
0
;
i
<
nents
;
i
++
,
sglist
++
)
flush_kernel_dcache_range
(
sg_virt_addr
(
sglist
),
sglist
->
length
);
}
static
void
pa11_dma_sync_sg_for_device
(
struct
device
*
dev
,
struct
scatterlist
*
sglist
,
int
nents
,
enum
dma_data_direction
direction
)
{
int
i
;
...
...
@@ -480,8 +498,10 @@ struct hppa_dma_ops pcxl_dma_ops = {
.
unmap_single
=
pa11_dma_unmap_single
,
.
map_sg
=
pa11_dma_map_sg
,
.
unmap_sg
=
pa11_dma_unmap_sg
,
.
dma_sync_single
=
pa11_dma_sync_single
,
.
dma_sync_sg
=
pa11_dma_sync_sg
,
.
dma_sync_single_for_cpu
=
pa11_dma_sync_single_for_cpu
,
.
dma_sync_single_for_device
=
pa11_dma_sync_single_for_device
,
.
dma_sync_sg_for_cpu
=
pa11_dma_sync_sg_for_cpu
,
.
dma_sync_sg_for_device
=
pa11_dma_sync_sg_for_device
,
};
static
void
*
fail_alloc_consistent
(
struct
device
*
dev
,
size_t
size
,
...
...
@@ -519,8 +539,10 @@ struct hppa_dma_ops pcx_dma_ops = {
.
unmap_single
=
pa11_dma_unmap_single
,
.
map_sg
=
pa11_dma_map_sg
,
.
unmap_sg
=
pa11_dma_unmap_sg
,
.
dma_sync_single
=
pa11_dma_sync_single
,
.
dma_sync_sg
=
pa11_dma_sync_sg
,
.
dma_sync_single_cpu
=
pa11_dma_sync_single_cpu
,
.
dma_sync_single_device
=
pa11_dma_sync_single_device
,
.
dma_sync_sg_cpu
=
pa11_dma_sync_sg_cpu
,
.
dma_sync_sg_device
=
pa11_dma_sync_sg_device
,
};
...
...
This diff is collapsed.
Click to expand it.
arch/parisc/kernel/process.c
View file @
180cc17d
...
...
@@ -32,7 +32,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define __KERNEL_SYSCALLS__
#include <stdarg.h>
#include <linux/elf.h>
...
...
This diff is collapsed.
Click to expand it.
arch/parisc/kernel/smp.c
View file @
180cc17d
...
...
@@ -16,7 +16,6 @@
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
*/
#define __KERNEL_SYSCALLS__
#undef ENTRY_SYS_CPUS
/* syscall support for iCOD-like functionality */
#include <linux/autoconf.h>
...
...
This diff is collapsed.
Click to expand it.
arch/ppc/kernel/misc.S
View file @
180cc17d
...
...
@@ -1108,17 +1108,7 @@ _GLOBAL(name) \
li
r3
,-
1
; \
blr
#define __NR__exit __NR_exit
SYSCALL
(
setsid
)
SYSCALL
(
open
)
SYSCALL
(
read
)
SYSCALL
(
write
)
SYSCALL
(
lseek
)
SYSCALL
(
close
)
SYSCALL
(
dup
)
SYSCALL
(
execve
)
SYSCALL
(
waitpid
)
/*
Why
isn
't this a) automatic, b) written in '
C
'? */
.
data
...
...
This diff is collapsed.
Click to expand it.
arch/ppc/kernel/ppc_ksyms.c
View file @
180cc17d
...
...
@@ -32,8 +32,6 @@
#include <linux/pmu.h>
#include <asm/prom.h>
#include <asm/system.h>
#define __KERNEL_SYSCALLS__
#include <asm/unistd.h>
#include <asm/pci-bridge.h>
#include <asm/irq.h>
#include <asm/pmac_feature.h>
...
...
@@ -189,10 +187,6 @@ EXPORT_SYMBOL(consistent_sync);
EXPORT_SYMBOL
(
flush_dcache_all
);
#endif
EXPORT_SYMBOL
(
open
);
EXPORT_SYMBOL
(
read
);
EXPORT_SYMBOL
(
lseek
);
EXPORT_SYMBOL
(
close
);
EXPORT_SYMBOL
(
start_thread
);
EXPORT_SYMBOL
(
kernel_thread
);
...
...
This diff is collapsed.
Click to expand it.
arch/ppc/kernel/smp.c
View file @
180cc17d
...
...
@@ -17,8 +17,6 @@
#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
#include <linux/delay.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/cache.h>
...
...
This diff is collapsed.
Click to expand it.
arch/ppc/platforms/chrp_smp.c
View file @
180cc17d
...
...
@@ -16,8 +16,6 @@
#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
#include <linux/delay.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
#include <linux/init.h>
#include <linux/spinlock.h>
...
...
This diff is collapsed.
Click to expand it.
arch/ppc/platforms/pmac_smp.c
View file @
180cc17d
...
...
@@ -29,8 +29,6 @@
#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
#include <linux/delay.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
...
...
This diff is collapsed.
Click to expand it.
arch/ppc64/kernel/pmac_smp.c
View file @
180cc17d
...
...
@@ -29,8 +29,6 @@
#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
#include <linux/delay.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
…
13
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment