Changeset fe48400d in rtems


Ignore:
Timestamp:
01/09/19 09:04:01 (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
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)
Message:

libtests/stackchk: Fix for 64-bit targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/stackchk/blow.c

    re4a19f5 rfe48400d  
    1616#endif
    1717
    18 #include <rtems.h>
    1918#include <rtems/stackchk.h>
    20 #include <rtems/score/heap.h>
    21 #include <rtems/score/percpu.h>
    2219
    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"
    3021
    3122void blow_stack(void)
    3223{
    33   volatile uint32_t   *low, *high;
    34   unsigned char *area;
    3524  Thread_Control *executing;
     25  char *area;
     26  volatile uintptr_t *low;
     27  volatile uintptr_t *high;
    3628
    37   b();
     29  executing = _Thread_Get_executing();
    3830
    3931  /*
    40    *  Destroy the first and last 16 bytes of our stack... Hope it
     32   *  Destroy the first and last 4 words of our stack area... Hope it
    4133   *  does not cause problems :)
    4234   */
    4335
    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));
    5240
    5341  low[0] = 0x11111111;
     
    6048  high[2] = 0x77777777;
    6149  high[3] = 0x88888888;
     50
    6251  rtems_stack_checker_report_usage();
    6352}
Note: See TracChangeset for help on using the changeset viewer.