OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [libtests/] [stackchk/] [blow.c] - Blame information for rev 562

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: blow.c,v 1.2 2001-09-27 12:02:13 chris Exp $
14
 */
15
 
16
#include <rtems.h>
17
 
18
void b() {}
19
 
20
void blow_stack( void )
21
{
22
  volatile unsigned32 *low, *high;
23
  unsigned char *area;
24
 
25
b();
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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.