Changeset fe48400d in rtems
- Timestamp:
- 01/09/19 09:04:01 (5 years ago)
- Branches:
- 5, master
- Children:
- feddcde0
- Parents:
- e4a19f5
- git-author:
- Sebastian Huber <sebastian.huber@…> (01/09/19 09:04:01)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (01/09/19 09:05:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/libtests/stackchk/blow.c
re4a19f5 rfe48400d 16 16 #endif 17 17 18 #include <rtems.h>19 18 #include <rtems/stackchk.h> 20 #include <rtems/score/heap.h>21 #include <rtems/score/percpu.h>22 19 23 /* forward declarations to avoid warnings */ 24 void b(void); 25 void blow_stack(void); 26 27 void b(void) 28 { 29 } 20 #include "system.h" 30 21 31 22 void blow_stack(void) 32 23 { 33 volatile uint32_t *low, *high;34 unsigned char *area;35 24 Thread_Control *executing; 25 char *area; 26 volatile uintptr_t *low; 27 volatile uintptr_t *high; 36 28 37 b();29 executing = _Thread_Get_executing(); 38 30 39 31 /* 40 * Destroy the first and last 16 bytes of our stack... Hope it32 * Destroy the first and last 4 words of our stack area... Hope it 41 33 * does not cause problems :) 42 34 */ 43 35 44 executing = _Thread_Get_executing(); 45 area = (unsigned char *)executing->Start.Initial_stack.area; 46 47 /* Look in the stack checker implementation for this magic offset */ 48 low = (volatile uint32_t *) \ 49 (area + sizeof(Heap_Block) - HEAP_BLOCK_HEADER_SIZE); 50 high = (volatile uint32_t *) 51 (area + executing->Start.Initial_stack.size - 16); 36 area = (char *) executing->Start.Initial_stack.area; 37 low = (uintptr_t *) area; 38 high = (uintptr_t *) 39 (area + executing->Start.Initial_stack.size - 4 * sizeof(*high)); 52 40 53 41 low[0] = 0x11111111; … … 60 48 high[2] = 0x77777777; 61 49 high[3] = 0x88888888; 50 62 51 rtems_stack_checker_report_usage(); 63 52 }
Note: See TracChangeset
for help on using the changeset viewer.