4.104.114.84.95
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, 1990, 1991, 1992, 1993, 1994. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * All rights assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
11 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
12 | * notice must appear in all copies of this file and its derivatives. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #include <rtems/system.h> |
---|
18 | #include <rtems/heap.h> |
---|
19 | #include <rtems/thread.h> |
---|
20 | |
---|
21 | void b() {} |
---|
22 | |
---|
23 | void blow_stack( void ) |
---|
24 | { |
---|
25 | volatile unsigned32 *low, *high; |
---|
26 | |
---|
27 | b(); |
---|
28 | /* |
---|
29 | * Destroy the first and last 16 bytes of our stack... Hope it |
---|
30 | * does not cause problems :) |
---|
31 | */ |
---|
32 | |
---|
33 | low = _Thread_Executing->Start.Initial_stack.area + HEAP_OVERHEAD; |
---|
34 | high = _Thread_Executing->Start.Initial_stack.area + |
---|
35 | _Thread_Executing->Start.Initial_stack.size - 16; |
---|
36 | |
---|
37 | low[0] = 0x11111111; |
---|
38 | low[1] = 0x22222222; |
---|
39 | low[2] = 0x33333333; |
---|
40 | low[3] = 0x44444444; |
---|
41 | |
---|
42 | high[0] = 0x55555555; |
---|
43 | high[1] = 0x66666666; |
---|
44 | high[2] = 0x77777777; |
---|
45 | high[3] = 0x88888888; |
---|
46 | |
---|
47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.