summaryrefslogtreecommitdiffstats
path: root/c/src/exec/sapi/src
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/sapi/src')
-rw-r--r--c/src/exec/sapi/src/Makefile.in3
-rw-r--r--c/src/exec/sapi/src/exinit.c8
-rw-r--r--c/src/exec/sapi/src/itronapi.c117
3 files changed, 127 insertions, 1 deletions
diff --git a/c/src/exec/sapi/src/Makefile.in b/c/src/exec/sapi/src/Makefile.in
index 4223fa423b..102c7cd24a 100644
--- a/c/src/exec/sapi/src/Makefile.in
+++ b/c/src/exec/sapi/src/Makefile.in
@@ -13,7 +13,8 @@ PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@
-C_PIECES = debug entrytable extension fatal exinit io posixapi rtemsapi
+C_PIECES = debug entrytable extension fatal exinit io \
+ itronapi posixapi rtemsapi
C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/exec/sapi/src/exinit.c b/c/src/exec/sapi/src/exinit.c
index 43da0a9363..511a0086f5 100644
--- a/c/src/exec/sapi/src/exinit.c
+++ b/c/src/exec/sapi/src/exinit.c
@@ -52,6 +52,10 @@
#ifdef RTEMS_POSIX_API
#include <rtems/posix/posixapi.h>
#endif
+#ifdef RTEMS_ITRON_API
+#include <rtems/itron/itronapi.h>
+#endif
+
/*PAGE
*
@@ -211,6 +215,10 @@ rtems_interrupt_level rtems_initialize_executive_early(
_POSIX_API_Initialize( configuration_table );
#endif
+#ifdef RTEMS_ITRON_API
+ _ITRON_API_Initialize( configuration_table );
+#endif
+
_System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
if ( cpu_table->pretasking_hook )
diff --git a/c/src/exec/sapi/src/itronapi.c b/c/src/exec/sapi/src/itronapi.c
new file mode 100644
index 0000000000..0309967ecf
--- /dev/null
+++ b/c/src/exec/sapi/src/itronapi.c
@@ -0,0 +1,117 @@
+/*
+ * ITRON API Initialization Support
+ *
+ * NOTE:
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <assert.h>
+
+/*
+ * ITRON_API_INIT is defined so all of the ITRON API
+ * data will be included in this object file.
+ */
+
+#define ITRON_API_INIT
+
+#include <rtems/system.h> /* include this before checking RTEMS_ITRON_API */
+#ifdef RTEMS_ITRON_API
+
+#include <itron.h>
+
+#include <sys/types.h>
+#include <rtems/config.h>
+#include <rtems/score/object.h>
+
+#include <rtems/itron/eventflags.h>
+#include <rtems/itron/fmempool.h>
+#include <rtems/itron/mbox.h>
+#include <rtems/itron/msgbuffer.h>
+#include <rtems/itron/port.h>
+#include <rtems/itron/semaphore.h>
+#include <rtems/itron/task.h>
+#include <rtems/itron/vmempool.h>
+
+/*PAGE
+ *
+ * _ITRON_API_Initialize
+ *
+ * XXX
+ */
+
+itron_api_configuration_table _ITRON_Default_configuration = {
+ 0, /* maximum_tasks */
+ 0, /* maximum_semaphores */
+ 0, /* maximum_eventflags */
+ 0, /* maximum_mailboxes */
+ 0, /* maximum_message_buffers */
+ 0, /* maximum_ports */
+ 0, /* maximum_memory_pools */
+ 0, /* maximum_fixed_memory_pools */
+ 0, /* number_of_initialization_tasks */
+ NULL /* User_initialization_tasks_table */
+};
+
+
+void _ITRON_API_Initialize(
+ rtems_configuration_table *configuration_table
+)
+{
+ itron_api_configuration_table *api_configuration;
+
+ /* XXX need to assert here based on size assumptions */
+
+ assert( sizeof(ID) == sizeof(Objects_Id) );
+
+ api_configuration = configuration_table->ITRON_api_configuration;
+ if ( !api_configuration )
+ api_configuration = &_ITRON_Default_configuration;
+
+ _ITRON_Task_Manager_initialization(
+ api_configuration->maximum_tasks,
+ api_configuration->number_of_initialization_tasks,
+ api_configuration->User_initialization_tasks_table
+ );
+
+ _ITRON_Semaphore_Manager_initialization(
+ api_configuration->maximum_semaphores
+ );
+
+ _ITRON_Eventflags_Manager_initialization(
+ api_configuration->maximum_eventflags
+ );
+
+ _ITRON_Fixed_memory_pool_Manager_initialization(
+ api_configuration->maximum_fixed_memory_pools
+ );
+
+ _ITRON_Mailbox_Manager_initialization(
+ api_configuration->maximum_mailboxes
+ );
+
+ _ITRON_Message_buffer_Manager_initialization(
+ api_configuration->maximum_message_buffers
+ );
+
+ _ITRON_Port_Manager_initialization(
+ api_configuration->maximum_ports
+ );
+
+ _ITRON_Variable_memory_pool_Manager_initialization(
+ api_configuration->maximum_memory_pools
+ );
+
+
+}
+
+#endif
+/* end of file */