source: rtems/testsuites/libtests/stackchk/blow.c @ 8de136b

4.104.115
Last change on this file since 8de136b was 8de136b, checked in by Joel Sherrill <joel.sherrill@…>, on 08/26/09 at 12:01:21

2009-08-19 Sebastian Huber <Sebastian.Huber@…>

  • heapwalk/init.c, stackchk/blow.c: Update for heap API changes.
  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[ac7d5ef0]1/*  task1.c
2 *
3 *  This set of three tasks do some simple task switching for about
4 *  15 seconds and then call a routine to "blow the stack".
5 *
[08311cc3]6 *  COPYRIGHT (c) 1989-1999.
[ac7d5ef0]7 *  On-Line Applications Research Corporation (OAR).
8 *
[98e4ebf5]9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
[2abdd87]11 *  http://www.rtems.com/license/LICENSE.
[ac7d5ef0]12 *
13 *  $Id$
14 */
15
[3a4ae6c]16#include <rtems.h>
[ac7d5ef0]17
18void b() {}
19
20void blow_stack( void )
21{
[9919946a]22  volatile uint32_t   *low, *high;
[c3e3d07]23  unsigned char *area;
[ac7d5ef0]24
25b();
26  /*
27   *  Destroy the first and last 16 bytes of our stack... Hope it
28   *  does not cause problems :)
29   */
30
[c3e3d07]31 area = (unsigned char *)_Thread_Executing->Start.Initial_stack.area;
32
[8de136b]33 low  = (volatile uint32_t   *) (area + HEAP_LAST_BLOCK_OVERHEAD);
[9919946a]34 high = (volatile uint32_t   *)
[c3e3d07]35            (area + _Thread_Executing->Start.Initial_stack.size - 16);
36
[ac7d5ef0]37
38 low[0] = 0x11111111;
39 low[1] = 0x22222222;
40 low[2] = 0x33333333;
41 low[3] = 0x44444444;
42
43 high[0] = 0x55555555;
44 high[1] = 0x66666666;
45 high[2] = 0x77777777;
46 high[3] = 0x88888888;
47
48}
Note: See TracBrowser for help on using the repository browser.