4.104.114.84.95
Last change
on this file since c3e3d07 was
c3e3d07,
checked in by Joel Sherrill <joel.sherrill@…>, on 09/18/96 at 21:07:14
|
address arithmetic changed to be more portable
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[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 | * |
---|
| 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 | |
---|
[3a4ae6c] | 17 | #include <rtems.h> |
---|
[ac7d5ef0] | 18 | |
---|
| 19 | void b() {} |
---|
| 20 | |
---|
| 21 | void blow_stack( void ) |
---|
| 22 | { |
---|
| 23 | volatile unsigned32 *low, *high; |
---|
[c3e3d07] | 24 | unsigned char *area; |
---|
[ac7d5ef0] | 25 | |
---|
| 26 | b(); |
---|
| 27 | /* |
---|
| 28 | * Destroy the first and last 16 bytes of our stack... Hope it |
---|
| 29 | * does not cause problems :) |
---|
| 30 | */ |
---|
| 31 | |
---|
[c3e3d07] | 32 | area = (unsigned char *)_Thread_Executing->Start.Initial_stack.area; |
---|
| 33 | |
---|
| 34 | low = (volatile unsigned32 *) (area + HEAP_OVERHEAD); |
---|
| 35 | high = (volatile unsigned32 *) |
---|
| 36 | (area + _Thread_Executing->Start.Initial_stack.size - 16); |
---|
| 37 | |
---|
[ac7d5ef0] | 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.