summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-01-09 10:04:01 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-01-09 10:05:03 +0100
commitfe48400d5beeab7dfaf768dfd1476ab6b9c0101b (patch)
tree27e96c0996a750082d415fccf3898970197ddb8d /testsuites
parentpsxhdrs: Add POSIX API Signature Compliance Tests for errno.h (diff)
downloadrtems-fe48400d5beeab7dfaf768dfd1476ab6b9c0101b.tar.bz2
libtests/stackchk: Fix for 64-bit targets
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/stackchk/blow.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/testsuites/libtests/stackchk/blow.c b/testsuites/libtests/stackchk/blow.c
index 15ce0abfa6..3b8bb7842f 100644
--- a/testsuites/libtests/stackchk/blow.c
+++ b/testsuites/libtests/stackchk/blow.c
@@ -15,40 +15,28 @@
#include "config.h"
#endif
-#include <rtems.h>
#include <rtems/stackchk.h>
-#include <rtems/score/heap.h>
-#include <rtems/score/percpu.h>
-/* forward declarations to avoid warnings */
-void b(void);
-void blow_stack(void);
-
-void b(void)
-{
-}
+#include "system.h"
void blow_stack(void)
{
- volatile uint32_t *low, *high;
- unsigned char *area;
Thread_Control *executing;
+ char *area;
+ volatile uintptr_t *low;
+ volatile uintptr_t *high;
- b();
+ executing = _Thread_Get_executing();
/*
- * Destroy the first and last 16 bytes of our stack... Hope it
+ * Destroy the first and last 4 words of our stack area... Hope it
* does not cause problems :)
*/
- executing = _Thread_Get_executing();
- area = (unsigned char *)executing->Start.Initial_stack.area;
-
- /* Look in the stack checker implementation for this magic offset */
- low = (volatile uint32_t *) \
- (area + sizeof(Heap_Block) - HEAP_BLOCK_HEADER_SIZE);
- high = (volatile uint32_t *)
- (area + executing->Start.Initial_stack.size - 16);
+ area = (char *) executing->Start.Initial_stack.area;
+ low = (uintptr_t *) area;
+ high = (uintptr_t *)
+ (area + executing->Start.Initial_stack.size - 4 * sizeof(*high));
low[0] = 0x11111111;
low[1] = 0x22222222;
@@ -59,5 +47,6 @@ void blow_stack(void)
high[1] = 0x66666666;
high[2] = 0x77777777;
high[3] = 0x88888888;
+
rtems_stack_checker_report_usage();
}