source: rtems/testsuites/libtests/stackchk/blow.c @ b2f05456

4.104.115
Last change on this file since b2f05456 was 809fb589, checked in by Joel Sherrill <joel.sherrill@…>, on 09/09/09 at 14:59:09

2009-09-09 Christian Mauderer <christian.mauderer@…>

  • heapwalk/init.c, heapwalk/heapwalk.scn, malloctest/init.c, malloctest/malloctest.scn: New test cases.
  • stackchk/blow.c, stackchk/stackchk.scn: Update for heap API changes.
  • Property mode set to 100644
File size: 1.1 KB
Line 
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 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#include <rtems.h>
17
18void b() {}
19
20void blow_stack( void )
21{
22  volatile uint32_t   *low, *high;
23  unsigned char *area;
24
25b();
26  /*
27   *  Destroy the first and last 16 bytes of our stack... Hope it
28   *  does not cause problems :)
29   */
30
31 area = (unsigned char *)_Thread_Executing->Start.Initial_stack.area;
32
33 /* Look in the stack checker implementation for this magic offset */
34 low  = (volatile uint32_t   *) (area + sizeof(Heap_Block) - HEAP_BLOCK_HEADER_SIZE);
35 high = (volatile uint32_t   *)
36            (area + _Thread_Executing->Start.Initial_stack.size - 16);
37
38
39 low[0] = 0x11111111;
40 low[1] = 0x22222222;
41 low[2] = 0x33333333;
42 low[3] = 0x44444444;
43
44 high[0] = 0x55555555;
45 high[1] = 0x66666666;
46 high[2] = 0x77777777;
47 high[3] = 0x88888888;
48
49}
Note: See TracBrowser for help on using the repository browser.