Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a4b35e1f
Commit
a4b35e1f
authored
Aug 24, 2003
by
Deepak Saxena
Committed by
Russell King
Aug 24, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM PATCH] 1620/1: dma_map_single/unmap_single support for ARM
Patch from Deepak Saxena
parent
860b2b0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
10 deletions
+50
-10
include/asm-arm/dma-mapping.h
include/asm-arm/dma-mapping.h
+37
-10
include/asm-arm/pci.h
include/asm-arm/pci.h
+13
-0
No files found.
include/asm-arm/dma-mapping.h
View file @
a4b35e1f
...
@@ -128,6 +128,28 @@ dma_map_single(struct device *dev, void *cpu_addr, size_t size,
...
@@ -128,6 +128,28 @@ dma_map_single(struct device *dev, void *cpu_addr, size_t size,
return
__virt_to_bus
((
unsigned
long
)
cpu_addr
);
return
__virt_to_bus
((
unsigned
long
)
cpu_addr
);
}
}
/**
* dma_map_page - map a portion of a page for streaming DMA
* @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
* @page: page that buffer resides in
* @offset: offset into page for start of buffer
* @size: size of buffer to map
* @dir: DMA transfer direction
*
* Ensure that any data held in the cache is appropriately discarded
* or written back.
*
* The device owns this memory once this call has completed. The CPU
* can regain ownership by calling dma_unmap_page() or dma_sync_single().
*/
static
inline
dma_addr_t
dma_map_page
(
struct
device
*
dev
,
struct
page
*
page
,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
dir
)
{
return
dma_map_single
(
dev
,
page_address
(
page
)
+
offset
,
size
,
(
int
)
dir
);
}
/**
/**
* dma_unmap_single - unmap a single buffer previously mapped
* dma_unmap_single - unmap a single buffer previously mapped
* @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
* @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
...
@@ -152,21 +174,26 @@ dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size,
...
@@ -152,21 +174,26 @@ dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size,
/* nothing to do */
/* nothing to do */
}
}
#if 0
/**
static inline dma_addr_t
* dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
dma_map_page(struct device *dev, struct page *page, unsigned long off,
* @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
size_t size, enum dma_data_direction dir)
* @handle: DMA address of buffer
{
* @size: size of buffer to map
/* fixme */
* @dir: DMA transfer direction
}
*
* Unmap a single streaming mode DMA translation. The handle and size
* must match what was provided in the previous dma_map_single() call.
* All other usages are undefined.
*
* After this call, reads by the CPU to the buffer are guaranteed to see
* whatever the device wrote there.
*/
static
inline
void
static
inline
void
dma_unmap_page
(
struct
device
*
dev
,
dma_addr_t
handle
,
size_t
size
,
dma_unmap_page
(
struct
device
*
dev
,
dma_addr_t
handle
,
size_t
size
,
enum
dma_data_direction
dir
)
enum
dma_data_direction
dir
)
{
{
/* fixme */
dma_unmap_single
(
dev
,
handle
,
size
,
(
int
)
dir
);
}
}
#endif
/**
/**
* dma_map_sg - map a set of SG buffers for streaming mode DMA
* dma_map_sg - map a set of SG buffers for streaming mode DMA
...
...
include/asm-arm/pci.h
View file @
a4b35e1f
...
@@ -96,6 +96,19 @@ pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dir)
...
@@ -96,6 +96,19 @@ pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dir)
return
dma_unmap_sg
(
hwdev
?
&
hwdev
->
dev
:
NULL
,
sg
,
nents
,
dir
);
return
dma_unmap_sg
(
hwdev
?
&
hwdev
->
dev
:
NULL
,
sg
,
nents
,
dir
);
}
}
static
inline
dma_addr_t
pci_map_page
(
struct
pci_dev
*
hwdev
,
struct
page
*
page
,
unsigned
long
offset
,
size_t
size
,
int
dir
)
{
return
pci_map_single
(
hwdev
,
page_address
(
page
)
+
offset
,
size
,
dir
);
}
static
inline
void
pci_unmap_page
(
struct
pci_dev
*
hwdev
,
dma_addr_t
handle
,
size_t
size
,
int
dir
)
{
return
pci_unmap_single
(
hwdev
,
handle
,
size
,
dir
);
}
static
inline
void
static
inline
void
pci_dma_sync_single
(
struct
pci_dev
*
hwdev
,
dma_addr_t
handle
,
size_t
size
,
int
dir
)
pci_dma_sync_single
(
struct
pci_dev
*
hwdev
,
dma_addr_t
handle
,
size_t
size
,
int
dir
)
{
{
...
...
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