summaryrefslogtreecommitdiff
path: root/lib_blackfin/bf533_string.c
diff options
context:
space:
mode:
authorAubrey Li <aubrey.adi@gmail.com>2007-04-05 18:34:06 +0800
committerAubrey Li <aubrey.adi@gmail.com>2007-04-05 18:34:06 +0800
commitc0707ce65677650b5ceab0500ee50ae5168afef2 (patch)
tree73f290081e8d3d624caba69091d6b99918a217a1 /lib_blackfin/bf533_string.c
parent7b7e30aa64bb6657a1bfd32fdbdbfeb561e6a48d (diff)
downloadu-boot-imx-c0707ce65677650b5ceab0500ee50ae5168afef2.zip
u-boot-imx-c0707ce65677650b5ceab0500ee50ae5168afef2.tar.gz
u-boot-imx-c0707ce65677650b5ceab0500ee50ae5168afef2.tar.bz2
[Blackfin][PATCH] Kill off a bunch of common local prototypes
Diffstat (limited to 'lib_blackfin/bf533_string.c')
-rw-r--r--lib_blackfin/bf533_string.c83
1 files changed, 39 insertions, 44 deletions
diff --git a/lib_blackfin/bf533_string.c b/lib_blackfin/bf533_string.c
index 4bc4e3c..1553f1b 100644
--- a/lib_blackfin/bf533_string.c
+++ b/lib_blackfin/bf533_string.c
@@ -30,12 +30,7 @@
#include <config.h>
#include <asm/blackfin.h>
#include <asm/io.h>
-
-extern void blackfin_icache_flush_range(const void *, const void *);
-extern void blackfin_dcache_flush_range(const void *, const void *);
-extern void *memcpy_ASM(void *dest, const void *src, size_t count);
-
-void *dma_memcpy(void *, const void *, size_t);
+#include "cache.h"
char *strcpy(char *dest, const char *src)
{
@@ -117,44 +112,7 @@ int strncmp(const char *cs, const char *ct, size_t count)
return __res1;
}
-/*
- * memcpy - Copy one area of memory to another
- * @dest: Where to copy to
- * @src: Where to copy from
- * @count: The size of the area.
- *
- * You should not use this function to access IO space, use memcpy_toio()
- * or memcpy_fromio() instead.
- */
-void *memcpy(void *dest, const void *src, size_t count)
-{
- char *tmp = (char *)dest, *s = (char *)src;
-
- /* L1_ISRAM can only be accessed via dma */
- if ((tmp >= (char *)L1_ISRAM) && (tmp < (char *)L1_ISRAM_END)) {
- /* L1 is the destination */
- dma_memcpy(dest, src, count);
-
- if (icache_status()) {
- blackfin_icache_flush_range(src, src + count);
- }
- } else if ((s >= (char *)L1_ISRAM) && (s < (char *)L1_ISRAM_END)) {
- /* L1 is the source */
- dma_memcpy(dest, src, count);
-
- if (icache_status()) {
- blackfin_icache_flush_range(dest, dest + count);
- }
- if (dcache_status()) {
- blackfin_dcache_flush_range(dest, dest + count);
- }
- } else {
- memcpy_ASM(dest, src, count);
- }
- return dest;
-}
-
-void *dma_memcpy(void *dest, const void *src, size_t count)
+static void *dma_memcpy(void *dest, const void *src, size_t count)
{
*pMDMA_D0_IRQ_STATUS = DMA_DONE | DMA_ERR;
@@ -188,3 +146,40 @@ void *dma_memcpy(void *dest, const void *src, size_t count)
src += count;
return dest;
}
+
+/*
+ * memcpy - Copy one area of memory to another
+ * @dest: Where to copy to
+ * @src: Where to copy from
+ * @count: The size of the area.
+ *
+ * You should not use this function to access IO space, use memcpy_toio()
+ * or memcpy_fromio() instead.
+ */
+extern void *memcpy_ASM(void *dest, const void *src, size_t count);
+void *memcpy(void *dest, const void *src, size_t count)
+{
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ if (dcache_status()) {
+ blackfin_dcache_flush_range(src, src+count);
+ }
+ /* L1_ISRAM can only be accessed via dma */
+ if ((tmp >= (char *)L1_ISRAM) && (tmp < (char *)L1_ISRAM_END)) {
+ /* L1 is the destination */
+ dma_memcpy(dest,src,count);
+ } else if ((s >= (char *)L1_ISRAM) && (s < (char *)L1_ISRAM_END)) {
+ /* L1 is the source */
+ dma_memcpy(dest,src,count);
+
+ if (icache_status()) {
+ blackfin_icache_flush_range(dest, dest+count);
+ }
+ if (dcache_status()) {
+ blackfin_dcache_invalidate_range(dest, dest+count);
+ }
+ } else {
+ memcpy_ASM(dest,src,count);
+ }
+ return dest;
+}