aboutsummaryrefslogtreecommitdiff
path: root/include/ppcp7
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2015-11-25 20:58:19 +0100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2015-12-01 17:02:04 +1100
commit2ef6d1e52d5b6f3a8198c1c39a55eeff2981b282 (patch)
tree6b6ad92775b881f28a6ce7e42f39b5289c8fec87 /include/ppcp7
parentf0d251a0775572ebce8566c16e4482455b9efd84 (diff)
downloadSLOF-2ef6d1e52d5b6f3a8198c1c39a55eeff2981b282.zip
SLOF-2ef6d1e52d5b6f3a8198c1c39a55eeff2981b282.tar.gz
SLOF-2ef6d1e52d5b6f3a8198c1c39a55eeff2981b282.tar.bz2
Move the code for rfill into a separate function
The code from the FAST_RFILL macro uses a local array as a temporary buffer - which gets allocated in the stack frame of the engine() function. Since engine() can be called recursively, this can cause stack overflows. So let's move the rfill code into a separate function to avoid these problems. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'include/ppcp7')
-rw-r--r--include/ppcp7/cache.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/include/ppcp7/cache.h b/include/ppcp7/cache.h
index 27975f0..3c02bb1 100644
--- a/include/ppcp7/cache.h
+++ b/include/ppcp7/cache.h
@@ -124,17 +124,8 @@ static inline void ci_rmove(void *dst, void *src, unsigned long esize,
#define FAST_MRMOVE(s, d, size) _FASTRMOVE(s, d, size)
-#define FAST_RFILL(dst, size, pat) do { \
- type_u buf[64]; \
- char *d = (char *)(dst); \
- memset(buf, pat, size < sizeof(buf) ? size : sizeof(buf)); \
- while (size > sizeof(buf)) { \
- FAST_MRMOVE(buf, d, sizeof(buf)); \
- d += sizeof(buf); \
- size -= sizeof(buf); \
- } \
- FAST_MRMOVE(buf, d, size); \
- } while(0)
+extern void fast_rfill(char *dst, long size, char pat);
+#define FAST_RFILL(dst, size, pat) fast_rfill(dst, size, pat)
static inline uint16_t bswap16_load(uint64_t addr)
{