diff options
author | Mark Nelson <markn@au1.ibm.com> | 2008-07-04 15:05:45 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-09 02:30:44 -0400 |
commit | 3a4c6f0b1540811110a59112b4c83f55c229728c (patch) | |
tree | 6d2cc36af1100103ceb649a6fbdf8b2a9b526947 /include/asm-powerpc/dma-mapping.h | |
parent | 7e5f8105030038de94b44a74cd7b64dd000830fc (diff) |
powerpc: move device_to_mask() to dma-mapping.h
Move device_to_mask() to dma-mapping.h because we need to use it from
outside dma_64.c in a later patch.
Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/asm-powerpc/dma-mapping.h')
-rw-r--r-- | include/asm-powerpc/dma-mapping.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h index de1395023cb1..74c549780987 100644 --- a/include/asm-powerpc/dma-mapping.h +++ b/include/asm-powerpc/dma-mapping.h | |||
@@ -45,6 +45,15 @@ extern void __dma_sync_page(struct page *page, unsigned long offset, | |||
45 | #endif /* ! CONFIG_NOT_COHERENT_CACHE */ | 45 | #endif /* ! CONFIG_NOT_COHERENT_CACHE */ |
46 | 46 | ||
47 | #ifdef CONFIG_PPC64 | 47 | #ifdef CONFIG_PPC64 |
48 | |||
49 | static inline unsigned long device_to_mask(struct device *dev) | ||
50 | { | ||
51 | if (dev->dma_mask && *dev->dma_mask) | ||
52 | return *dev->dma_mask; | ||
53 | /* Assume devices without mask can take 32 bit addresses */ | ||
54 | return 0xfffffffful; | ||
55 | } | ||
56 | |||
48 | /* | 57 | /* |
49 | * DMA operations are abstracted for G5 vs. i/pSeries, PCI vs. VIO | 58 | * DMA operations are abstracted for G5 vs. i/pSeries, PCI vs. VIO |
50 | */ | 59 | */ |