source: rtems/testsuites/libtests/stackchk/blow.c @ 2abdd87

4.104.114.84.9
Last change on this file since 2abdd87 was 2abdd87, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:53:27 PM

2003-09-04 Joel Sherrill <joel@…>

  • cpuuse/init.c, cpuuse/system.h, cpuuse/task1.c, cpuuse/task2.c, cpuuse/task3.c, cpuuse/tswitch.c, malloctest/init.c, malloctest/system.h, malloctest/task1.c, monitor/init.c, monitor/system.h, putenvtest/init.c, rtems++/Init.cc, rtems++/System.h, rtems++/Task1.cc, rtems++/Task2.cc, rtems++/Task3.cc, rtems++/rtems++.doc, rtmonuse/getall.c, rtmonuse/init.c, rtmonuse/system.h, rtmonuse/task1.c, stackchk/blow.c, stackchk/init.c, stackchk/system.h, stackchk/task1.c: URL for license changed.
  • Property mode set to 100644
File size: 1.0 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 unsigned32 *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 low  = (volatile unsigned32 *) (area + HEAP_OVERHEAD);
34 high = (volatile unsigned32 *)
35            (area + _Thread_Executing->Start.Initial_stack.size - 16);
36
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.