Files
rtems/cpukit/sapi/src/posixapi.c
Joel Sherrill aac75d3b9b 2008-12-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* itron/include/rtems/itron/itronapi.h, libmisc/capture/capture.c,
	libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c,
	libmisc/monitor/mon-itask.c, libmisc/monitor/mon-mpci.c,
	posix/include/rtems/posix/config.h,
	posix/include/rtems/posix/posixapi.h,
	rtems/include/rtems/rtems/config.h,
	rtems/include/rtems/rtems/rtemsapi.h, rtems/src/taskinitusers.c,
	sapi/include/confdefs.h, sapi/include/rtems/config.h,
	sapi/include/rtems/init.h, sapi/src/exinit.c, sapi/src/itronapi.c,
	sapi/src/posixapi.c, sapi/src/rtemsapi.c, score/src/isr.c,
	score/src/thread.c, score/src/threadcreateidle.c,
	score/src/threadstackallocate.c, score/src/threadstackfree.c,
	score/src/wkspace.c: Eliminate pointers to API configuration tables
	in the main configuration table. Reference the main configuration
	table and the API configuration tables directly using the confdefs.h
	version rather than obtaining a pointer to it. This eliminated some
	variables, a potential fatal error, some unnecessary default
	configuration structures. Overall, about a 4.5% reduction in the code
	size for minimum and hello on the SPARC.
2008-12-15 19:21:01 +00:00

108 lines
2.6 KiB
C

/*
* RTEMS API Initialization Support
*
* NOTE:
*
* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
/*
* POSIX_API_INIT is defined so all of the POSIX API
* data will be included in this object file.
*/
#define POSIX_API_INIT
#include <rtems/system.h> /* include this before checking RTEMS_POSIX_API */
#ifdef RTEMS_POSIX_API
#include <sys/types.h>
#include <mqueue.h>
#include <rtems/config.h>
#include <rtems/score/object.h>
#include <rtems/posix/barrier.h>
#include <rtems/posix/cond.h>
#include <rtems/posix/config.h>
#include <rtems/posix/key.h>
#include <rtems/posix/mqueue.h>
#include <rtems/posix/mutex.h>
#include <rtems/posix/posixapi.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/psignal.h>
#include <rtems/posix/pthread.h>
#include <rtems/posix/rwlock.h>
#include <rtems/posix/timer.h>
#include <rtems/posix/semaphore.h>
#include <rtems/posix/spinlock.h>
#include <rtems/posix/time.h>
/*PAGE
*
* _POSIX_API_Initialize
*
* XXX
*/
Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ];
void _POSIX_API_Initialize(void)
{
const posix_api_configuration_table *api;
/* XXX need to assert here based on size assumptions */
assert( sizeof(pthread_t) == sizeof(Objects_Id) );
/*
* Install our API Object Management Table and initialize the
* various managers.
*/
api = &Configuration_POSIX_API;
_Objects_Information_table[OBJECTS_POSIX_API] = _POSIX_Objects;
_POSIX_signals_Manager_Initialization( api->maximum_queued_signals );
_POSIX_Threads_Manager_initialization(
api->maximum_threads,
api->number_of_initialization_threads,
api->User_initialization_threads_table
);
_POSIX_Condition_variables_Manager_initialization(
api->maximum_condition_variables
);
_POSIX_Key_Manager_initialization( api->maximum_keys );
_POSIX_Mutex_Manager_initialization( api->maximum_mutexes );
_POSIX_Message_queue_Manager_initialization( api->maximum_message_queues );
_POSIX_Semaphore_Manager_initialization( api->maximum_semaphores );
_POSIX_Timer_Manager_initialization( api->maximum_timers );
_POSIX_Barrier_Manager_initialization( api->maximum_barriers );
_POSIX_RWLock_Manager_initialization( api->maximum_rwlocks );
_POSIX_Spinlock_Manager_initialization(api->maximum_spinlocks);
}
#endif
/* end of file */