source: rtems/testsuites/sptests/sp19/first.c @ 8fbdf07

4.104.114.84.95
Last change on this file since 8fbdf07 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*  First_FP_task
2 *
3 *  This routine serves as a floating point test task.  It verifies the
4 *  basic task switching capabilities of the executive when floating
5 *  point is configured.
6 *
7 *  Input parameters:
8 *    argument - task argument
9 *
10 *  Output parameters:  NONE
11 *
12 *  COPYRIGHT (c) 1989-1999.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.OARcorp.com/rtems/license.html.
18 *
19 *  $Id$
20 */
21
22#include "system.h"
23#include "fptest.h"
24#include "inttest.h"
25
26rtems_task First_FP_task(
27  rtems_task_argument argument
28)
29{
30  rtems_status_code status;
31  rtems_id          tid;
32  rtems_time_of_day time;
33  rtems_unsigned32  task_index;
34  INTEGER_DECLARE;
35  FP_DECLARE;
36
37  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
38  directive_failed( status, "rtems_task_ident" );
39
40  task_index = task_number( tid );
41
42  INTEGER_LOAD( INTEGER_factors[ task_index ] );
43  FP_LOAD( FP_factors[ task_index ] );
44
45  put_name( Task_name[ task_index ], FALSE );
46  printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] );
47  put_name( Task_name[ task_index ], FALSE );
48#if ( RTEMS_HAS_HARDWARE_FP == 1 )
49  printf( " - float base = (%g)\n", FP_factors[ task_index ] );
50#else
51  printf( " - float base = (NA)\n" );
52#endif
53
54  if ( argument == 0 ) {
55    status = rtems_task_restart( RTEMS_SELF, 1 );
56    directive_failed( status, "rtems_task_restart of RTEMS_SELF" );
57  } else {
58    build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
59    status = rtems_clock_set( &time );
60    directive_failed( status, "rtems_clock_set" );
61
62    status = rtems_task_delete( RTEMS_SELF );
63    directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
64  }
65}
Note: See TracBrowser for help on using the repository browser.