OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp19/] [first.c] - Blame information for rev 30

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

Line No. Rev Author Line
1 30 unneback
/*  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: first.c,v 1.2 2001-09-27 12:02:34 chris Exp $
20
 */
21
 
22
#include "system.h"
23
#include "fptest.h"
24
#include "inttest.h"
25
 
26
rtems_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
}

powered by: WebSVN 2.1.0

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