OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp15/] [task1.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 158 chris
/*  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.OARcorp.com/rtems/license.html.
16
 *
17 208 chris
 *  $Id: task1.c,v 1.2 2001-09-27 12:02:33 chris Exp $
18 158 chris
 */
19
 
20
#include "system.h"
21
 
22
rtems_task Task_1(
23
  rtems_task_argument argument
24
)
25
{
26
  rtems_id           ptid_1;
27
  rtems_id           ptid_2;
28
  void              *buffer_address_1;
29
  void              *buffer_address_2;
30
  void              *buffer_address_3;
31
  void              *buffer_address_4;
32
  rtems_status_code  status;
33
 
34
  puts_nocr( "TA1 - rtems_partition_ident - partition 1 id = " );
35
  status = rtems_partition_ident(
36
    Partition_name[ 1 ],
37
    RTEMS_SEARCH_ALL_NODES,
38
    &ptid_1
39
  );
40
  directive_failed( status, "rtems_partition_ident of PT1" );
41
  printf( "%08x\n", ptid_1 );
42
 
43
  puts_nocr( "TA1 - rtems_partition_ident - partition 2 id = " );
44
  status = rtems_partition_ident(
45
    Partition_name[ 2 ],
46
    RTEMS_SEARCH_ALL_NODES,
47
    &ptid_2
48
  );
49
  directive_failed( status, "rtems_partition_ident of PT2" );
50
  printf( "%08x\n", ptid_2 );
51
 
52
  puts_nocr(
53
    "TA1 - rtems_partition_get_buffer - buffer 1 from partition 1  - "
54
  );
55
  status = rtems_partition_get_buffer( ptid_1, &buffer_address_1 );
56
  directive_failed( status, "rtems_partition_get_buffer" );
57
  Put_address_from_area_1( buffer_address_1 );
58
  new_line;
59
 
60
  puts_nocr(
61
    "TA1 - rtems_partition_get_buffer - buffer 2 from partition 1  - "
62
  );
63
  status = rtems_partition_get_buffer( ptid_1, &buffer_address_2 );
64
  directive_failed( status, "rtems_partition_get_buffer" );
65
  Put_address_from_area_1( buffer_address_2 );
66
  new_line;
67
 
68
  puts_nocr(
69
    "TA1 - rtems_partition_get_buffer - buffer 1 from partition 2  - "
70
  );
71
  status = rtems_partition_get_buffer( ptid_2, &buffer_address_3 );
72
  directive_failed( status, "rtems_partition_get_buffer" );
73
  Put_address_from_area_2( buffer_address_3 );
74
  new_line;
75
 
76
  puts_nocr(
77
    "TA1 - rtems_partition_get_buffer - buffer 2 from partition 2  - "
78
  );
79
  status = rtems_partition_get_buffer( ptid_2, &buffer_address_4 );
80
  directive_failed( status, "rtems_partition_get_buffer" );
81
  Put_address_from_area_2( buffer_address_4 );
82
  new_line;
83
 
84
  puts_nocr(
85
    "TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - "
86
  );
87
  Put_address_from_area_1( buffer_address_1 );
88
  new_line;
89
  status = rtems_partition_return_buffer( ptid_1, buffer_address_1 );
90
  directive_failed( status, "rtems_partition_return_buffer" );
91
 
92
  puts_nocr(
93
    "TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - "
94
  );
95
  Put_address_from_area_1( buffer_address_2 );
96
  new_line;
97
  status = rtems_partition_return_buffer( ptid_1, buffer_address_2 );
98
  directive_failed( status, "rtems_partition_return_buffer" );
99
 
100
  puts_nocr(
101
    "TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - "
102
  );
103
  Put_address_from_area_2( buffer_address_3 );
104
  new_line;
105
  status = rtems_partition_return_buffer( ptid_2, buffer_address_3 );
106
  directive_failed( status, "rtems_partition_return_buffer" );
107
 
108
  puts_nocr(
109
    "TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - "
110
  );
111
  Put_address_from_area_2( buffer_address_4 );
112
  new_line;
113
  status = rtems_partition_return_buffer( ptid_2, buffer_address_4 );
114
  directive_failed( status, "rtems_partition_return_buffer" );
115
 
116
  puts( "TA1 - rtems_partition_delete - delete partition 1"
117
  );
118
  status = rtems_partition_delete( ptid_1 );
119
  directive_failed( status, "rtems_partition_delete" );
120
 
121
  puts( "TA1 - rtems_partition_delete - delete partition 2"
122
  );
123
  status = rtems_partition_delete( ptid_2 );
124
  directive_failed( status, "rtems_partition_delete" );
125
 
126
  puts( "*** END OF TEST 15 ***" );
127
  exit( 0 );
128
}

powered by: WebSVN 2.1.0

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