source: rtems/testsuites/libtests/stackchk/task1.c @ 809fb589

4.104.11
Last change on this file since 809fb589 was de7adaf, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 12, 2009 at 8:50:26 PM

2009-08-12 Joel Sherrill <joel.sherrill@…>

  • malloctest/task1.c, stackchk/task1.c: Eliminate test routines TICKS_PER_SECOND and get_ticks_per_second() in favor of new rtems_clock_get_ticks_per_second().
  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[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 *
[de7adaf]6 *  COPYRIGHT (c) 1989-2009.
[ac7d5ef0]7 *  On-Line Applications Research Corporation (OAR).
8 *
[98e4ebf]9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
[2abdd87]11 *  http://www.rtems.com/license/LICENSE.
[ac7d5ef0]12 *
13 *  $Id$
14 */
15
[3a4ae6c]16#include "system.h"
[ac7d5ef0]17
18rtems_task Task_1_through_3(
19  rtems_task_argument argument
20)
21{
22  rtems_id          tid;
23  rtems_time_of_day time;
24  rtems_status_code status;
25
26  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
27  directive_failed( status, "rtems_task_ident" );
28
29  while( FOREVER ) {
[cd49fdc]30    status = rtems_clock_get_tod( &time );
31    directive_failed( status, "rtems_clock_get_tod" );
[ac7d5ef0]32
33    if ( time.second >= 15 && tid == Task_id[ 1 ] ) {
34       blow_stack();
35    }
36
37    put_name( Task_name[ task_number( tid ) ], FALSE );
[cd49fdc]38    print_time( " - rtems_clock_get_tod - ", &time, "\n" );
[ac7d5ef0]39
[de7adaf]40    status = rtems_task_wake_after(
41      task_number( tid ) * 5 * rtems_clock_get_ticks_per_second() );
[ac7d5ef0]42    directive_failed( status, "rtems_task_wake_after" );
43  }
44}
Note: See TracBrowser for help on using the repository browser.