source: rtems/c/src/tests/sptests/sp23/task1.c @ f49aaf18

4.104.114.84.9
Last change on this file since f49aaf18 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 17, 1999 at 5:51:34 PM

Updated copyright notice.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*  Task_1
2 *
3 *  This task verifies that the dual ported RAM directives work
4 *  correctly by converting external addresses to internal addresses and
5 *  internal addresses to external addresses.
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
24rtems_task Task_1(
25  rtems_task_argument argument
26)
27{
28  rtems_id           dpid;
29  void              *to_be_converted;
30  void              *converted;
31  rtems_status_code  status;
32
33  status = rtems_port_ident( Port_name[ 1 ], &dpid );
34  directive_failed( status, "rtems_port_ident" );
35  printf( "TA1 - rtems_port_ident - 0x%08x\n", dpid );
36
37  to_be_converted = &External_port_area[ 0xe ];
38  status = rtems_port_external_to_internal(
39    Port_id[ 1 ],
40    to_be_converted,
41    &converted
42  );
43  directive_failed( status, "rtems_port_external_to_internal" );
44  printf(
45    "TA1 - rtems_port_external_to_internal - %p => %p\n",
46    to_be_converted,
47    converted
48  );
49
50  to_be_converted = &Internal_port_area[ 0xe ];
51  status = rtems_port_internal_to_external(
52    Port_id[ 1 ],
53    to_be_converted,
54    &converted
55  );
56  directive_failed( status, "rtems_port_internal_to_external" );
57  printf(
58    "TA1 - rtems_port_internal_to_external - %p => %p\n",
59    to_be_converted,
60    converted
61  );
62
63  to_be_converted = &Above_port_area[ 0xe ];
64  status = rtems_port_external_to_internal(
65    Port_id[ 1 ],
66    to_be_converted,
67    &converted
68  );
69  directive_failed( status, "rtems_port_external_to_internal" );
70  printf(
71    "TA1 - rtems_port_external_to_internal - %p => %p\n",
72    to_be_converted,
73    converted
74  );
75
76  to_be_converted = &Below_port_area[ 0xe ];
77  status = rtems_port_internal_to_external(
78    Port_id[ 1 ],
79    to_be_converted,
80    &converted
81  );
82  directive_failed( status, "rtems_port_internal_to_external" );
83  printf(
84    "TA1 - rtems_port_internal_to_external - %p => %p\n",
85    to_be_converted,
86    converted
87  );
88
89  status = rtems_port_delete( Port_id[ 1 ] );
90  directive_failed( status, "rtems_port_delete" );
91  puts( "TA1 - rtems_port_delete - DP1" );
92
93  puts( "*** END OF TEST 23 ***" );
94  exit( 0 );
95}
Note: See TracBrowser for help on using the repository browser.