source: rtems/testsuites/sptests/sp15/task1.c @ 99de42c

5
Last change on this file since 99de42c was 6c0301d, checked in by Sebastian Huber <sebastian.huber@…>, on 03/25/14 at 07:06:21

tests/sptests: Use <rtems/test.h>

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*  Task_1
2 *
3 *  This routine serves as a test task.  It tests the partition manager.
4 *
5 *  Input parameters:
6 *    argument - task argument
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#ifdef HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include "system.h"
23
24rtems_task Task_1(
25  rtems_task_argument argument
26)
27{
28  rtems_id           ptid_1;
29  rtems_id           ptid_2;
30  void              *buffer_address_1;
31  void              *buffer_address_2;
32  void              *buffer_address_3;
33  void              *buffer_address_4;
34  rtems_status_code  status;
35
36  puts_nocr( "TA1 - rtems_partition_ident - partition 1 id = " );
37  status = rtems_partition_ident(
38    Partition_name[ 1 ],
39    RTEMS_SEARCH_ALL_NODES,
40    &ptid_1
41  );
42  directive_failed( status, "rtems_partition_ident of PT1" );
43  printf( "%08" PRIxrtems_id "\n", ptid_1 );
44
45  puts_nocr( "TA1 - rtems_partition_ident - partition 2 id = " );
46  status = rtems_partition_ident(
47    Partition_name[ 2 ],
48    RTEMS_SEARCH_ALL_NODES,
49    &ptid_2
50  );
51  directive_failed( status, "rtems_partition_ident of PT2" );
52  printf( "%08" PRIxrtems_id "\n", ptid_2 );
53
54  puts_nocr(
55    "TA1 - rtems_partition_get_buffer - buffer 1 from partition 1  - "
56  );
57  status = rtems_partition_get_buffer( ptid_1, &buffer_address_1 );
58  directive_failed( status, "rtems_partition_get_buffer" );
59  Put_address_from_area_1( buffer_address_1 );
60  new_line;
61
62  puts_nocr(
63    "TA1 - rtems_partition_get_buffer - buffer 2 from partition 1  - "
64  );
65  status = rtems_partition_get_buffer( ptid_1, &buffer_address_2 );
66  directive_failed( status, "rtems_partition_get_buffer" );
67  Put_address_from_area_1( buffer_address_2 );
68  new_line;
69
70  puts_nocr(
71    "TA1 - rtems_partition_get_buffer - buffer 1 from partition 2  - "
72  );
73  status = rtems_partition_get_buffer( ptid_2, &buffer_address_3 );
74  directive_failed( status, "rtems_partition_get_buffer" );
75  Put_address_from_area_2( buffer_address_3 );
76  new_line;
77
78  puts_nocr(
79    "TA1 - rtems_partition_get_buffer - buffer 2 from partition 2  - "
80  );
81  status = rtems_partition_get_buffer( ptid_2, &buffer_address_4 );
82  directive_failed( status, "rtems_partition_get_buffer" );
83  Put_address_from_area_2( buffer_address_4 );
84  new_line;
85
86  puts_nocr(
87    "TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - "
88  );
89  Put_address_from_area_1( buffer_address_1 );
90  new_line;
91  status = rtems_partition_return_buffer( ptid_1, buffer_address_1 );
92  directive_failed( status, "rtems_partition_return_buffer" );
93
94  puts_nocr(
95    "TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - "
96  );
97  Put_address_from_area_1( buffer_address_2 );
98  new_line;
99  status = rtems_partition_return_buffer( ptid_1, buffer_address_2 );
100  directive_failed( status, "rtems_partition_return_buffer" );
101
102  puts_nocr(
103    "TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - "
104  );
105  Put_address_from_area_2( buffer_address_3 );
106  new_line;
107  status = rtems_partition_return_buffer( ptid_2, buffer_address_3 );
108  directive_failed( status, "rtems_partition_return_buffer" );
109
110  puts_nocr(
111    "TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - "
112  );
113  Put_address_from_area_2( buffer_address_4 );
114  new_line;
115  status = rtems_partition_return_buffer( ptid_2, buffer_address_4 );
116  directive_failed( status, "rtems_partition_return_buffer" );
117
118  puts( "TA1 - rtems_partition_delete - delete partition 1"
119  );
120  status = rtems_partition_delete( ptid_1 );
121  directive_failed( status, "rtems_partition_delete" );
122
123  puts( "TA1 - rtems_partition_delete - delete partition 2"
124  );
125  status = rtems_partition_delete( ptid_2 );
126  directive_failed( status, "rtems_partition_delete" );
127
128  TEST_END();
129  rtems_test_exit( 0 );
130}
Note: See TracBrowser for help on using the repository browser.