source: rtems/cpukit/sapi/src/itronapi.c @ 37cd592

4.104.114.84.95
Last change on this file since 37cd592 was 0577ec1d, checked in by Joel Sherrill <joel.sherrill@…>, on 07/01/02 at 22:31:29

2002-07-01 Joel Sherrill <joel@…>

  • Mega patch merge to change the format of the object IDs to loosen the dependency between the SCORE and the various APIs. There was considerable work to simplify the object name management and it appears that the name_table field is no longer needed. This patch also includes the addition of the internal mutex which is currently only used to protect some types of allocation and deallocation. This significantly can reduce context switch latency under certain circumstances. In particular, some heap/region operations were O(n) and had dispatching disabled. This should help enormously. With this merge, the patch is not as clean as it should be. In particular, the documentation has not been modified to reflect the new object ID layout, the IDs in the test screens are not updated, and _Objects_Get_information needs to be a real routine not inlined. As part of this patch a lot of MP code for thread/proxy blocking was made conditional and cleaned up.
  • include/confdefs.h, src/exinit.c, src/extension.c, src/itronapi.c, src/posixapi.c, src/rtemsapi.c: Modified as part of above.
  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2 *  ITRON API Initialization Support
3 *
4 *  NOTE:
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#include <assert.h>
17
18/*
19 *  ITRON_API_INIT is defined so all of the ITRON API
20 *  data will be included in this object file.
21 */
22
23#define ITRON_API_INIT
24
25#include <rtems/system.h>    /* include this before checking RTEMS_ITRON_API */
26#ifdef RTEMS_ITRON_API
27
28#include <itron.h>
29
30#include <sys/types.h>
31#include <rtems/config.h>
32#include <rtems/score/object.h>
33
34#include <rtems/itron/eventflags.h>
35#include <rtems/itron/fmempool.h>
36#include <rtems/itron/mbox.h>
37#include <rtems/itron/msgbuffer.h>
38#include <rtems/itron/port.h>
39#include <rtems/itron/semaphore.h>
40#include <rtems/itron/task.h>
41#include <rtems/itron/vmempool.h>
42
43/*PAGE
44 *
45 *  _ITRON_API_Initialize
46 *
47 *  XXX
48 */
49
50itron_api_configuration_table _ITRON_Default_configuration = {
51  0,                             /* maximum_tasks */
52  0,                             /* maximum_semaphores */
53  0,                             /* maximum_eventflags */
54  0,                             /* maximum_mailboxes */
55  0,                             /* maximum_message_buffers */
56  0,                             /* maximum_ports */
57  0,                             /* maximum_memory_pools */
58  0,                             /* maximum_fixed_memory_pools */
59  0,                             /* number_of_initialization_tasks */
60  NULL                           /* User_initialization_tasks_table */
61};
62
63Objects_Information *_ITRON_Objects[ OBJECTS_ITRON_CLASSES_LAST + 1 ];
64
65void _ITRON_API_Initialize(
66  rtems_configuration_table *configuration_table
67)
68{
69  itron_api_configuration_table *api_configuration;
70
71  /* XXX need to assert here based on size assumptions */
72
73  assert( sizeof(ID) == sizeof(Objects_Id) );
74
75  api_configuration = configuration_table->ITRON_api_configuration;
76  if ( !api_configuration )
77    api_configuration = &_ITRON_Default_configuration;
78
79  _Objects_Information_table[OBJECTS_ITRON_API] = _ITRON_Objects;
80   
81  _ITRON_Task_Manager_initialization(
82    api_configuration->maximum_tasks,
83    api_configuration->number_of_initialization_tasks,
84    api_configuration->User_initialization_tasks_table
85  );
86 
87  _ITRON_Semaphore_Manager_initialization(
88    api_configuration->maximum_semaphores
89  );
90
91  _ITRON_Eventflags_Manager_initialization(
92    api_configuration->maximum_eventflags
93  );
94
95  _ITRON_Fixed_memory_pool_Manager_initialization(
96    api_configuration->maximum_fixed_memory_pools
97  );
98
99  _ITRON_Mailbox_Manager_initialization(
100    api_configuration->maximum_mailboxes
101  );
102
103  _ITRON_Message_buffer_Manager_initialization(
104    api_configuration->maximum_message_buffers
105  );
106
107  _ITRON_Port_Manager_initialization(
108    api_configuration->maximum_ports
109  );
110
111  _ITRON_Variable_memory_pool_Manager_initialization(
112    api_configuration->maximum_memory_pools
113  );
114
115
116}
117
118#endif
119/* end of file */
Note: See TracBrowser for help on using the repository browser.