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, 1990, 1991, 1992, 1993, 1994. |
---|
13 | * On-Line Applications Research Corporation (OAR). |
---|
14 | * All rights assigned to U.S. Government, 1994. |
---|
15 | * |
---|
16 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
17 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
18 | * notice must appear in all copies of this file and its derivatives. |
---|
19 | * |
---|
20 | * $Id$ |
---|
21 | */ |
---|
22 | |
---|
23 | #include "system.h" |
---|
24 | #include "fptest.h" |
---|
25 | #include "inttest.h" |
---|
26 | |
---|
27 | rtems_task First_FP_task( |
---|
28 | rtems_task_argument argument |
---|
29 | ) |
---|
30 | { |
---|
31 | rtems_status_code status; |
---|
32 | rtems_id tid; |
---|
33 | rtems_time_of_day time; |
---|
34 | rtems_unsigned32 task_index; |
---|
35 | INTEGER_DECLARE; |
---|
36 | FP_DECLARE; |
---|
37 | |
---|
38 | status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); |
---|
39 | directive_failed( status, "rtems_task_ident" ); |
---|
40 | |
---|
41 | task_index = task_number( tid ); |
---|
42 | |
---|
43 | INTEGER_LOAD( INTEGER_factors[ task_index ] ); |
---|
44 | FP_LOAD( FP_factors[ task_index ] ); |
---|
45 | |
---|
46 | put_name( Task_name[ task_index ], FALSE ); |
---|
47 | printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] ); |
---|
48 | put_name( Task_name[ task_index ], FALSE ); |
---|
49 | #if ( RTEMS_HAS_HARDWARE_FP == 1 ) |
---|
50 | printf( " - float base = (%g)\n", FP_factors[ task_index ] ); |
---|
51 | #else |
---|
52 | printf( " - float base = (NA)\n" ); |
---|
53 | #endif |
---|
54 | |
---|
55 | if ( argument == 0 ) { |
---|
56 | status = rtems_task_restart( RTEMS_SELF, 1 ); |
---|
57 | directive_failed( status, "rtems_task_restart of RTEMS_SELF" ); |
---|
58 | } else { |
---|
59 | build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); |
---|
60 | status = rtems_clock_set( &time ); |
---|
61 | directive_failed( status, "rtems_clock_set" ); |
---|
62 | |
---|
63 | status = rtems_task_delete( RTEMS_SELF ); |
---|
64 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
65 | } |
---|
66 | } |
---|