1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2011. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.org/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #ifdef HAVE_CONFIG_H |
---|
11 | #include "config.h" |
---|
12 | #endif |
---|
13 | |
---|
14 | #include "system.h" |
---|
15 | #include "fptest.h" |
---|
16 | #include "inttest.h" |
---|
17 | |
---|
18 | rtems_task First_FP_task( |
---|
19 | rtems_task_argument argument |
---|
20 | ) |
---|
21 | { |
---|
22 | rtems_status_code status; |
---|
23 | rtems_id tid; |
---|
24 | rtems_time_of_day time; |
---|
25 | uint32_t task_index; |
---|
26 | INTEGER_DECLARE; |
---|
27 | FP_DECLARE; |
---|
28 | |
---|
29 | status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); |
---|
30 | directive_failed( status, "rtems_task_ident" ); |
---|
31 | |
---|
32 | task_index = task_number( tid ); |
---|
33 | |
---|
34 | INTEGER_LOAD( INTEGER_factors[ task_index ] ); |
---|
35 | FP_LOAD( FP_factors[ task_index ] ); |
---|
36 | |
---|
37 | put_name( Task_name[ task_index ], FALSE ); |
---|
38 | printf( |
---|
39 | " - integer base = (0x%" PRIx32 ")\n", |
---|
40 | INTEGER_factors[ task_index ] |
---|
41 | ); |
---|
42 | put_name( Task_name[ task_index ], FALSE ); |
---|
43 | #if ( RTEMS_HAS_HARDWARE_FP == 1 ) |
---|
44 | printf( " - float base = (%g)\n", FP_factors[ task_index ] ); |
---|
45 | #else |
---|
46 | printf( " - float base = (NA)\n" ); |
---|
47 | #endif |
---|
48 | |
---|
49 | if ( argument == 0 ) { |
---|
50 | status = rtems_task_restart( RTEMS_SELF, 1 ); |
---|
51 | directive_failed( status, "rtems_task_restart of RTEMS_SELF" ); |
---|
52 | } else { |
---|
53 | build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); |
---|
54 | status = rtems_clock_set( &time ); |
---|
55 | directive_failed( status, "rtems_clock_set" ); |
---|
56 | |
---|
57 | status = rtems_task_delete( RTEMS_SELF ); |
---|
58 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
59 | } |
---|
60 | } |
---|