diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/asm/memcpy.c | 4 | ||||
-rw-r--r-- | firmware/asm/memmove.c | 4 | ||||
-rw-r--r-- | firmware/asm/memset.c | 4 | ||||
-rw-r--r-- | firmware/asm/memset16.c | 4 | ||||
-rw-r--r-- | firmware/asm/strlen.c | 4 | ||||
-rw-r--r-- | firmware/libc/memchr.c | 4 | ||||
-rw-r--r-- | firmware/libc/memcmp.c | 4 | ||||
-rw-r--r-- | firmware/libc/strchr.c | 4 | ||||
-rw-r--r-- | firmware/libc/strcmp.c | 4 | ||||
-rw-r--r-- | firmware/libc/strcpy.c | 4 | ||||
-rw-r--r-- | firmware/libc/strncmp.c | 4 |
11 files changed, 22 insertions, 22 deletions
diff --git a/firmware/asm/memcpy.c b/firmware/asm/memcpy.c index c5456ab41f..df78eea883 100644 --- a/firmware/asm/memcpy.c +++ b/firmware/asm/memcpy.c | |||
@@ -37,7 +37,7 @@ QUICKREF | |||
37 | #include <string.h> | 37 | #include <string.h> |
38 | 38 | ||
39 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ | 39 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ |
40 | #define UNALIGNED(X, Y) \ | 40 | #define ROCKBOX_UNALIGNED(X, Y) \ |
41 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) | 41 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) |
42 | 42 | ||
43 | /* How many bytes are copied each iteration of the 4X unrolled loop. */ | 43 | /* How many bytes are copied each iteration of the 4X unrolled loop. */ |
@@ -82,7 +82,7 @@ _DEFUN (memcpy, (dst0, src0, len0), | |||
82 | 82 | ||
83 | /* If the size is small, or either SRC or DST is unaligned, | 83 | /* If the size is small, or either SRC or DST is unaligned, |
84 | then punt into the byte copy loop. This should be rare. */ | 84 | then punt into the byte copy loop. This should be rare. */ |
85 | if (!TOO_SMALL(len) && !UNALIGNED (src, dst)) | 85 | if (!TOO_SMALL(len) && !ROCKBOX_UNALIGNED (src, dst)) |
86 | { | 86 | { |
87 | aligned_dst = (long*)dst; | 87 | aligned_dst = (long*)dst; |
88 | aligned_src = (long*)src; | 88 | aligned_src = (long*)src; |
diff --git a/firmware/asm/memmove.c b/firmware/asm/memmove.c index 5f423964bb..5c2adf20a7 100644 --- a/firmware/asm/memmove.c +++ b/firmware/asm/memmove.c | |||
@@ -40,7 +40,7 @@ QUICKREF | |||
40 | #include <string.h> | 40 | #include <string.h> |
41 | 41 | ||
42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ | 42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ |
43 | #define UNALIGNED(X, Y) \ | 43 | #define ROCKBOX_UNALIGNED(X, Y) \ |
44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) | 44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) |
45 | 45 | ||
46 | /* How many bytes are copied each iteration of the 4X unrolled loop. */ | 46 | /* How many bytes are copied each iteration of the 4X unrolled loop. */ |
@@ -109,7 +109,7 @@ _DEFUN (memmove, (dst_void, src_void, length), | |||
109 | /* Use optimizing algorithm for a non-destructive copy to closely | 109 | /* Use optimizing algorithm for a non-destructive copy to closely |
110 | match memcpy. If the size is small or either SRC or DST is unaligned, | 110 | match memcpy. If the size is small or either SRC or DST is unaligned, |
111 | then punt into the byte copy loop. This should be rare. */ | 111 | then punt into the byte copy loop. This should be rare. */ |
112 | if (!TOO_SMALL(len) && !UNALIGNED (src, dst)) | 112 | if (!TOO_SMALL(len) && !ROCKBOX_UNALIGNED (src, dst)) |
113 | { | 113 | { |
114 | aligned_dst = (long*)dst; | 114 | aligned_dst = (long*)dst; |
115 | aligned_src = (long*)src; | 115 | aligned_src = (long*)src; |
diff --git a/firmware/asm/memset.c b/firmware/asm/memset.c index 7b8d2137e8..967a973c5d 100644 --- a/firmware/asm/memset.c +++ b/firmware/asm/memset.c | |||
@@ -37,7 +37,7 @@ QUICKREF | |||
37 | #include "_ansi.h" | 37 | #include "_ansi.h" |
38 | 38 | ||
39 | #define LBLOCKSIZE (sizeof(long)) | 39 | #define LBLOCKSIZE (sizeof(long)) |
40 | #define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) | 40 | #define ROCKBOX_UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) |
41 | #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) | 41 | #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) |
42 | 42 | ||
43 | _PTR | 43 | _PTR |
@@ -61,7 +61,7 @@ _DEFUN (memset, (m, c, n), | |||
61 | unsigned long buffer; | 61 | unsigned long buffer; |
62 | unsigned long *aligned_addr; | 62 | unsigned long *aligned_addr; |
63 | 63 | ||
64 | if (!TOO_SMALL (n) && !UNALIGNED (m)) | 64 | if (!TOO_SMALL (n) && !ROCKBOX_UNALIGNED (m)) |
65 | { | 65 | { |
66 | /* If we get this far, we know that n is large and m is word-aligned. */ | 66 | /* If we get this far, we know that n is large and m is word-aligned. */ |
67 | 67 | ||
diff --git a/firmware/asm/memset16.c b/firmware/asm/memset16.c index 7e31df0cdd..db71d86fcc 100644 --- a/firmware/asm/memset16.c +++ b/firmware/asm/memset16.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "string-extra.h" /* memset16() */ | 22 | #include "string-extra.h" /* memset16() */ |
23 | 23 | ||
24 | #define LBLOCKSIZE (sizeof(long)/2) | 24 | #define LBLOCKSIZE (sizeof(long)/2) |
25 | #define UNALIGNED(X) ((long)X & (sizeof(long) - 1)) | 25 | #define ROCKBOX_UNALIGNED(X) ((long)X & (sizeof(long) - 1)) |
26 | #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) | 26 | #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) |
27 | 27 | ||
28 | void memset16(void *dst, int val, size_t len) | 28 | void memset16(void *dst, int val, size_t len) |
@@ -38,7 +38,7 @@ void memset16(void *dst, int val, size_t len) | |||
38 | unsigned long buffer; | 38 | unsigned long buffer; |
39 | unsigned long *aligned_addr; | 39 | unsigned long *aligned_addr; |
40 | 40 | ||
41 | if (!TOO_SMALL(len) && !UNALIGNED(dst)) | 41 | if (!TOO_SMALL(len) && !ROCKBOX_UNALIGNED(dst)) |
42 | { | 42 | { |
43 | aligned_addr = (unsigned long *)dst; | 43 | aligned_addr = (unsigned long *)dst; |
44 | 44 | ||
diff --git a/firmware/asm/strlen.c b/firmware/asm/strlen.c index 649df6764b..d5326584b5 100644 --- a/firmware/asm/strlen.c +++ b/firmware/asm/strlen.c | |||
@@ -37,7 +37,7 @@ QUICKREF | |||
37 | #include <limits.h> | 37 | #include <limits.h> |
38 | 38 | ||
39 | #define LBLOCKSIZE (sizeof (long)) | 39 | #define LBLOCKSIZE (sizeof (long)) |
40 | #define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) | 40 | #define ROCKBOX_UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) |
41 | 41 | ||
42 | #if LONG_MAX == 2147483647L | 42 | #if LONG_MAX == 2147483647L |
43 | #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) | 43 | #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) |
@@ -73,7 +73,7 @@ _DEFUN (strlen, (str), | |||
73 | _CONST char *start = str; | 73 | _CONST char *start = str; |
74 | unsigned long *aligned_addr; | 74 | unsigned long *aligned_addr; |
75 | 75 | ||
76 | if (!UNALIGNED (str)) | 76 | if (!ROCKBOX_UNALIGNED (str)) |
77 | { | 77 | { |
78 | /* If the string is word-aligned, we can check for the presence of | 78 | /* If the string is word-aligned, we can check for the presence of |
79 | a null in each word-sized block. */ | 79 | a null in each word-sized block. */ |
diff --git a/firmware/libc/memchr.c b/firmware/libc/memchr.c index 8b6b4d69d9..bd99cfbc4d 100644 --- a/firmware/libc/memchr.c +++ b/firmware/libc/memchr.c | |||
@@ -38,7 +38,7 @@ QUICKREF | |||
38 | #include "_ansi.h" /* for _DEFUN */ | 38 | #include "_ansi.h" /* for _DEFUN */ |
39 | 39 | ||
40 | /* Nonzero if X is not aligned on a "long" boundary. */ | 40 | /* Nonzero if X is not aligned on a "long" boundary. */ |
41 | #define UNALIGNED(X) ((long)X & (sizeof (long) - 1)) | 41 | #define ROCKBOX_UNALIGNED(X) ((long)X & (sizeof (long) - 1)) |
42 | 42 | ||
43 | /* How many bytes are loaded each iteration of the word copy loop. */ | 43 | /* How many bytes are loaded each iteration of the word copy loop. */ |
44 | #define LBLOCKSIZE (sizeof (long)) | 44 | #define LBLOCKSIZE (sizeof (long)) |
@@ -82,7 +82,7 @@ _DEFUN (memchr, (s1, i, n), | |||
82 | unsigned long mask,j; | 82 | unsigned long mask,j; |
83 | unsigned long *aligned_addr; | 83 | unsigned long *aligned_addr; |
84 | 84 | ||
85 | if (!UNALIGNED (s)) | 85 | if (!ROCKBOX_UNALIGNED (s)) |
86 | { | 86 | { |
87 | mask = 0; | 87 | mask = 0; |
88 | for (j = 0; j < LBLOCKSIZE; j++) | 88 | for (j = 0; j < LBLOCKSIZE; j++) |
diff --git a/firmware/libc/memcmp.c b/firmware/libc/memcmp.c index c2fa1bf6b7..e2894bb05a 100644 --- a/firmware/libc/memcmp.c +++ b/firmware/libc/memcmp.c | |||
@@ -40,7 +40,7 @@ QUICKREF | |||
40 | #include "_ansi.h" /* for _DEFUN */ | 40 | #include "_ansi.h" /* for _DEFUN */ |
41 | 41 | ||
42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ | 42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ |
43 | #define UNALIGNED(X, Y) \ | 43 | #define ROCKBOX_UNALIGNED(X, Y) \ |
44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) | 44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) |
45 | 45 | ||
46 | /* How many bytes are copied each iteration of the word copy loop. */ | 46 | /* How many bytes are copied each iteration of the word copy loop. */ |
@@ -78,7 +78,7 @@ _DEFUN (memcmp, (m1, m2, n), | |||
78 | /* If the size is too small, or either pointer is unaligned, | 78 | /* If the size is too small, or either pointer is unaligned, |
79 | then we punt to the byte compare loop. Hopefully this will | 79 | then we punt to the byte compare loop. Hopefully this will |
80 | not turn up in inner loops. */ | 80 | not turn up in inner loops. */ |
81 | if (!TOO_SMALL(n) && !UNALIGNED(s1,s2)) | 81 | if (!TOO_SMALL(n) && !ROCKBOX_UNALIGNED(s1,s2)) |
82 | { | 82 | { |
83 | /* Otherwise, load and compare the blocks of memory one | 83 | /* Otherwise, load and compare the blocks of memory one |
84 | word at a time. */ | 84 | word at a time. */ |
diff --git a/firmware/libc/strchr.c b/firmware/libc/strchr.c index ada6e2d098..425d4a2f7a 100644 --- a/firmware/libc/strchr.c +++ b/firmware/libc/strchr.c | |||
@@ -38,7 +38,7 @@ QUICKREF | |||
38 | #include "_ansi.h" /* for _DEFUN */ | 38 | #include "_ansi.h" /* for _DEFUN */ |
39 | 39 | ||
40 | /* Nonzero if X is not aligned on a "long" boundary. */ | 40 | /* Nonzero if X is not aligned on a "long" boundary. */ |
41 | #define UNALIGNED(X) ((long)X & (sizeof (long) - 1)) | 41 | #define ROCKBOX_UNALIGNED(X) ((long)X & (sizeof (long) - 1)) |
42 | 42 | ||
43 | /* How many bytes are loaded each iteration of the word copy loop. */ | 43 | /* How many bytes are loaded each iteration of the word copy loop. */ |
44 | #define LBLOCKSIZE (sizeof (long)) | 44 | #define LBLOCKSIZE (sizeof (long)) |
@@ -83,7 +83,7 @@ _DEFUN (strchr, (s1, i), | |||
83 | unsigned long mask,j; | 83 | unsigned long mask,j; |
84 | unsigned long *aligned_addr; | 84 | unsigned long *aligned_addr; |
85 | 85 | ||
86 | if (!UNALIGNED (s)) | 86 | if (!ROCKBOX_UNALIGNED (s)) |
87 | { | 87 | { |
88 | mask = 0; | 88 | mask = 0; |
89 | for (j = 0; j < LBLOCKSIZE; j++) | 89 | for (j = 0; j < LBLOCKSIZE; j++) |
diff --git a/firmware/libc/strcmp.c b/firmware/libc/strcmp.c index d540fae7dd..c1487dab74 100644 --- a/firmware/libc/strcmp.c +++ b/firmware/libc/strcmp.c | |||
@@ -40,7 +40,7 @@ QUICKREF | |||
40 | #include "_ansi.h" /* for _DEFUN */ | 40 | #include "_ansi.h" /* for _DEFUN */ |
41 | 41 | ||
42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ | 42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ |
43 | #define UNALIGNED(X, Y) \ | 43 | #define ROCKBOX_UNALIGNED(X, Y) \ |
44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) | 44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) |
45 | 45 | ||
46 | /* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ | 46 | /* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ |
@@ -76,7 +76,7 @@ _DEFUN (strcmp, (s1, s2), | |||
76 | unsigned long *a2; | 76 | unsigned long *a2; |
77 | 77 | ||
78 | /* If s1 or s2 are unaligned, then compare bytes. */ | 78 | /* If s1 or s2 are unaligned, then compare bytes. */ |
79 | if (!UNALIGNED (s1, s2)) | 79 | if (!ROCKBOX_UNALIGNED (s1, s2)) |
80 | { | 80 | { |
81 | /* If s1 and s2 are word-aligned, compare them a word at a time. */ | 81 | /* If s1 and s2 are word-aligned, compare them a word at a time. */ |
82 | a1 = (unsigned long*)s1; | 82 | a1 = (unsigned long*)s1; |
diff --git a/firmware/libc/strcpy.c b/firmware/libc/strcpy.c index 035e2bda9e..166a74967d 100644 --- a/firmware/libc/strcpy.c +++ b/firmware/libc/strcpy.c | |||
@@ -40,7 +40,7 @@ QUICKREF | |||
40 | /*SUPPRESS 530*/ | 40 | /*SUPPRESS 530*/ |
41 | 41 | ||
42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ | 42 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ |
43 | #define UNALIGNED(X, Y) \ | 43 | #define ROCKBOX_UNALIGNED(X, Y) \ |
44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) | 44 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) |
45 | 45 | ||
46 | #if LONG_MAX == 2147483647L | 46 | #if LONG_MAX == 2147483647L |
@@ -77,7 +77,7 @@ _DEFUN (strcpy, (dst0, src0), | |||
77 | _CONST long *aligned_src; | 77 | _CONST long *aligned_src; |
78 | 78 | ||
79 | /* If SRC or DEST is unaligned, then copy bytes. */ | 79 | /* If SRC or DEST is unaligned, then copy bytes. */ |
80 | if (!UNALIGNED (src, dst)) | 80 | if (!ROCKBOX_UNALIGNED (src, dst)) |
81 | { | 81 | { |
82 | aligned_dst = (long*)dst; | 82 | aligned_dst = (long*)dst; |
83 | aligned_src = (long*)src; | 83 | aligned_src = (long*)src; |
diff --git a/firmware/libc/strncmp.c b/firmware/libc/strncmp.c index 315fae810a..83e8d5b457 100644 --- a/firmware/libc/strncmp.c +++ b/firmware/libc/strncmp.c | |||
@@ -41,7 +41,7 @@ QUICKREF | |||
41 | #include "_ansi.h" /* for _DEFUN */ | 41 | #include "_ansi.h" /* for _DEFUN */ |
42 | 42 | ||
43 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ | 43 | /* Nonzero if either X or Y is not aligned on a "long" boundary. */ |
44 | #define UNALIGNED(X, Y) \ | 44 | #define ROCKBOX_UNALIGNED(X, Y) \ |
45 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) | 45 | (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) |
46 | 46 | ||
47 | /* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ | 47 | /* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ |
@@ -86,7 +86,7 @@ _DEFUN (strncmp, (s1, s2, n), | |||
86 | return 0; | 86 | return 0; |
87 | 87 | ||
88 | /* If s1 or s2 are unaligned, then compare bytes. */ | 88 | /* If s1 or s2 are unaligned, then compare bytes. */ |
89 | if (!UNALIGNED (s1, s2)) | 89 | if (!ROCKBOX_UNALIGNED (s1, s2)) |
90 | { | 90 | { |
91 | /* If s1 and s2 are word-aligned, compare them a word at a time. */ | 91 | /* If s1 and s2 are word-aligned, compare them a word at a time. */ |
92 | a1 = (unsigned long*)s1; | 92 | a1 = (unsigned long*)s1; |