diff options
Diffstat (limited to 'c/src/exec/sapi/src')
-rw-r--r-- | c/src/exec/sapi/src/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/exec/sapi/src/Makefile.am | 28 | ||||
-rw-r--r-- | c/src/exec/sapi/src/debug.c | 61 | ||||
-rw-r--r-- | c/src/exec/sapi/src/exinit.c | 328 | ||||
-rw-r--r-- | c/src/exec/sapi/src/extension.c | 51 | ||||
-rw-r--r-- | c/src/exec/sapi/src/extensioncreate.c | 65 | ||||
-rw-r--r-- | c/src/exec/sapi/src/extensiondelete.c | 56 | ||||
-rw-r--r-- | c/src/exec/sapi/src/extensionident.c | 53 | ||||
-rw-r--r-- | c/src/exec/sapi/src/fatal.c | 37 | ||||
-rw-r--r-- | c/src/exec/sapi/src/io.c | 460 | ||||
-rw-r--r-- | c/src/exec/sapi/src/itronapi.c | 119 | ||||
-rw-r--r-- | c/src/exec/sapi/src/posixapi.c | 115 | ||||
-rw-r--r-- | c/src/exec/sapi/src/rtemsapi.c | 97 |
13 files changed, 0 insertions, 1472 deletions
diff --git a/c/src/exec/sapi/src/.cvsignore b/c/src/exec/sapi/src/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/exec/sapi/src/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/exec/sapi/src/Makefile.am b/c/src/exec/sapi/src/Makefile.am deleted file mode 100644 index a2fc897c85..0000000000 --- a/c/src/exec/sapi/src/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -## -## $Id$ -## - - -EXTENSION_FILES = extension.c extensioncreate.c extensiondelete.c \ - extensionident.c -C_FILES = debug.c $(EXTENSION_FILES) fatal.c exinit.c io.c \ - itronapi.c posixapi.c rtemsapi.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o) - -OBJS = $(C_O_FILES) - -include $(top_srcdir)/automake/multilib.am -include $(top_srcdir)/automake/compile.am -include $(top_srcdir)/automake/lib.am - -# -# Add local stuff here using += -# - -AM_CPPFLAGS += -D__RTEMS_INSIDE__ - -all-local: ${ARCH} ${OBJS} - -EXTRA_DIST = $(C_FILES) - -include $(top_srcdir)/automake/local.am diff --git a/c/src/exec/sapi/src/debug.c b/c/src/exec/sapi/src/debug.c deleted file mode 100644 index e58a7219c2..0000000000 --- a/c/src/exec/sapi/src/debug.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Debug Manager - * - * COPYRIGHT (c) 1989-1999. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems/system.h> -#include <rtems/debug.h> - -/*PAGE - * - * _Debug_Manager_initialization - */ - -void _Debug_Manager_initialization( void ) -{ - rtems_debug_disable( RTEMS_DEBUG_ALL_MASK ); -} - -/*PAGE - * - * rtems_debug_enable - */ - -void rtems_debug_enable ( - rtems_debug_control to_be_enabled -) -{ - _Debug_Level |= to_be_enabled; -} - -/*PAGE - * - * rtems_debug_disable - */ - -void rtems_debug_disable ( - rtems_debug_control to_be_disabled -) -{ - _Debug_Level &= ~to_be_disabled; -} - -/*PAGE - * - * _Debug_Is_enabled - */ - -boolean _Debug_Is_enabled( - rtems_debug_control level -) -{ - return (_Debug_Level & level); -} diff --git a/c/src/exec/sapi/src/exinit.c b/c/src/exec/sapi/src/exinit.c deleted file mode 100644 index 8206e174c2..0000000000 --- a/c/src/exec/sapi/src/exinit.c +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Initialization Manager - * - * COPYRIGHT (c) 1989-1999. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* - * SCORE_INIT and SAPI_INIT are defined so all of the super core and - * super API data will be included in this object file. - */ - -#define SAPI_INIT -#define SCORE_INIT - -#include <rtems/system.h> -#include <rtems/config.h> -#include <rtems/debug.h> -#include <rtems/extension.h> -#include <rtems/fatal.h> -#include <rtems/init.h> -#include <rtems/io.h> -#include <rtems/score/sysstate.h> - -#include <rtems/score/apiext.h> -#include <rtems/score/apimutex.h> -#include <rtems/score/copyrt.h> -#include <rtems/score/heap.h> -#include <rtems/score/interr.h> -#include <rtems/score/isr.h> -#if defined(RTEMS_MULTIPROCESSING) -#include <rtems/score/mpci.h> -#endif -#include <rtems/score/priority.h> -#include <rtems/score/thread.h> -#include <rtems/score/tod.h> -#include <rtems/score/userext.h> -#include <rtems/score/watchdog.h> -#include <rtems/score/wkspace.h> - -#include <rtems/sptables.h> - - -#include <rtems/rtems/rtemsapi.h> -#ifdef RTEMS_POSIX_API -#include <rtems/posix/posixapi.h> -#endif -#ifdef RTEMS_ITRON_API -#include <rtems/itron/itronapi.h> -#endif - -Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; - -/*PAGE - * - * rtems_initialize_executive - * - * This directive initializes all the kernels data structures - * to the states necessary for the kernel to begin execution. All - * include files that contain global variable definitions should be - * included in this file. The system threads and initialization threads - * are created and started by this routine. This routine then - * initiates multithreading. - * - * Input parameters: - * configuration_table - pointer to the user's configuration table - * cpu_table - pointer to the user's CPU configuration table - * - * Output parameters: NONE - */ - -void rtems_initialize_executive( - rtems_configuration_table *configuration_table, - rtems_cpu_table *cpu_table -) -{ - rtems_interrupt_level bsp_level; - - bsp_level = rtems_initialize_executive_early(configuration_table, cpu_table); - rtems_initialize_executive_late( bsp_level ); -} - -rtems_interrupt_level rtems_initialize_executive_early( - rtems_configuration_table *configuration_table, - rtems_cpu_table *cpu_table -) -{ - rtems_interrupt_level bsp_level; - rtems_multiprocessing_table *multiprocessing_table; - - /* - * Dispatching and interrupts are disabled until the end of the - * initialization sequence. This prevents an inadvertent context - * switch before the executive is initialized. - */ - - _ISR_Disable( bsp_level ); - - if ( configuration_table == NULL ) - _Internal_error_Occurred( - INTERNAL_ERROR_CORE, - TRUE, - INTERNAL_ERROR_NO_CONFIGURATION_TABLE - ); - - /* - * Initialize the system state based on whether this is an MP system. - */ - -#if defined(RTEMS_MULTIPROCESSING) - multiprocessing_table = configuration_table->User_multiprocessing_table; - - _System_state_Handler_initialization( - (multiprocessing_table) ? TRUE : FALSE - ); -#else - multiprocessing_table = NULL; - - _System_state_Handler_initialization( FALSE ); -#endif - - /* - * Provided just for user convenience. - */ - - _Configuration_Table = configuration_table; - _Configuration_MP_table = multiprocessing_table; - - /* - * Internally we view single processor systems as a very restricted - * multiprocessor system. - */ - - if ( multiprocessing_table == NULL ) - multiprocessing_table = - (void *)&_Initialization_Default_multiprocessing_table; - - if ( cpu_table == NULL ) - _Internal_error_Occurred( - INTERNAL_ERROR_CORE, - TRUE, - INTERNAL_ERROR_NO_CPU_TABLE - ); - - _CPU_Initialize( cpu_table, _Thread_Dispatch ); - - /* - * Do this as early as possible to insure no debugging output - * is even attempted to be printed. - */ - - _Debug_Manager_initialization(); - - _API_extensions_Initialization(); - - _Thread_Dispatch_initialization(); - - _Workspace_Handler_initialization( - (void *)configuration_table->work_space_start, - configuration_table->work_space_size - ); - - _User_extensions_Handler_initialization( - configuration_table->number_of_initial_extensions, - configuration_table->User_extension_table - ); - - _ISR_Handler_initialization(); - - _Objects_Handler_initialization( - multiprocessing_table->node, - multiprocessing_table->maximum_nodes, - multiprocessing_table->maximum_global_objects - ); - - _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; - - _Priority_Handler_initialization(); - - _Watchdog_Handler_initialization(); - - _TOD_Handler_initialization( configuration_table->microseconds_per_tick ); - - _Thread_Handler_initialization( - configuration_table->ticks_per_timeslice, - configuration_table->maximum_extensions, - multiprocessing_table->maximum_proxies - ); - -#if defined(RTEMS_MULTIPROCESSING) - _MPCI_Handler_initialization( - multiprocessing_table->User_mpci_table, - RTEMS_TIMEOUT - ); -#endif - -/* MANAGERS */ - - _RTEMS_API_Initialize( configuration_table ); - - _Extension_Manager_initialization( configuration_table->maximum_extensions ); - - _IO_Manager_initialization( - configuration_table->Device_driver_table, - configuration_table->number_of_device_drivers, - configuration_table->maximum_drivers, - configuration_table->maximum_devices - ); - -#ifdef RTEMS_POSIX_API - _POSIX_API_Initialize( configuration_table ); -#endif - -#ifdef RTEMS_ITRON_API - _ITRON_API_Initialize( configuration_table ); -#endif - - _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING ); - - /* - * No threads should be created before this point!!! - * _Thread_Executing and _Thread_Heir are not set. - * - * At this point all API extensions are in place. After the call to - * _Thread_Create_idle() _Thread_Executing and _Thread_Heir will be set. - */ - - _Thread_Create_idle(); - - - /* - * Scheduling can properly occur now as long as we avoid dispatching. - */ - - if ( cpu_table->pretasking_hook ) - (*cpu_table->pretasking_hook)(); - -#if defined(RTEMS_MULTIPROCESSING) - _MPCI_Create_server(); -#endif - - /* - * Run the API and BSPs predriver hook. - */ - - _API_extensions_Run_predriver(); - - if ( _CPU_Table.predriver_hook ) - (*_CPU_Table.predriver_hook)(); - - /* - * Initialize all the device drivers and initialize the MPCI layer. - * - * NOTE: The MPCI may be build upon a device driver. - */ - - _IO_Initialize_all_drivers(); - -#if defined(RTEMS_MULTIPROCESSING) - if ( _System_state_Is_multiprocessing ) { - _MPCI_Initialization(); - _MPCI_Internal_packets_Send_process_packet( - MPCI_PACKETS_SYSTEM_VERIFY - ); - } -#endif - - /* - * Run the APIs and BSPs postdriver hooks. - * - * The API extensions are supposed to create user initialization tasks. - */ - - _API_extensions_Run_postdriver(); - - if ( _CPU_Table.postdriver_hook ) - (*_CPU_Table.postdriver_hook)(); - - return bsp_level; -} - -void rtems_initialize_executive_late( - rtems_interrupt_level bsp_level -) -{ - - _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING ); - - _Thread_Start_multitasking(); - - /* - * Restore the interrupt level to what the BSP had. Technically, - * this is unnecessary since the BSP should have all interrupts - * disabled when rtems_initialize_executive is invoked. But this keeps - * the ISR Disable/Enable calls paired. - */ - - _ISR_Enable( bsp_level ); -} - -/*PAGE - * - * rtems_shutdown_executive - * - * This kernel routine shutdowns the executive. It halts multitasking - * and returns control to the application execution "thread" which - * initialially invoked the rtems_initialize_executive directive. - * - * Input parameters: NONE - * - * Output parameters: NONE - */ - -void rtems_shutdown_executive( - unsigned32 result -) -{ - if ( _System_state_Current != SYSTEM_STATE_SHUTDOWN ) { - _System_state_Set( SYSTEM_STATE_SHUTDOWN ); - _Thread_Stop_multitasking(); - } -} diff --git a/c/src/exec/sapi/src/extension.c b/c/src/exec/sapi/src/extension.c deleted file mode 100644 index d0bac7a4b4..0000000000 --- a/c/src/exec/sapi/src/extension.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Extension Manager - * - * - * COPYRIGHT (c) 1989-2002. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems/system.h> -#include <rtems/rtems/support.h> -#include <rtems/score/object.h> -#include <rtems/score/thread.h> -#include <rtems/extension.h> - -/*PAGE - * - * _Extension_Manager_initialization - * - * This routine initializes all extension manager related data structures. - * - * Input parameters: - * maximum_extensions - number of extensions to initialize - * - * Output parameters: NONE - */ - -void _Extension_Manager_initialization( - unsigned32 maximum_extensions -) -{ - _Objects_Initialize_information( - &_Extension_Information, - OBJECTS_CLASSIC_API, /* object API */ - OBJECTS_RTEMS_EXTENSIONS, - maximum_extensions, - sizeof( Extension_Control ), - FALSE, /* TRUE if the name is a string */ - RTEMS_MAXIMUM_NAME_LENGTH /* maximum length of an object name */ -#if defined(RTEMS_MULTIPROCESSING) - , - FALSE, /* TRUE if this is a global object class */ - NULL /* Proxy extraction support callout */ -#endif - ); -} diff --git a/c/src/exec/sapi/src/extensioncreate.c b/c/src/exec/sapi/src/extensioncreate.c deleted file mode 100644 index d6dad318d3..0000000000 --- a/c/src/exec/sapi/src/extensioncreate.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Extension Manager -- rtems_extension_create - * - * - * COPYRIGHT (c) 1989-2002. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems/system.h> -#include <rtems/rtems/support.h> -#include <rtems/score/object.h> -#include <rtems/score/thread.h> -#include <rtems/extension.h> - -/*PAGE - * - * rtems_extension_create - * - * This directive creates a extension and performs some initialization. - * - * Input parameters: - * name - extension name - * extension_table - pointer to extension set information - * id - pointer to extension id - * - * Output parameters: - * id - extension id - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -rtems_status_code rtems_extension_create( - rtems_name name, - rtems_extensions_table *extension_table, - Objects_Id *id -) -{ - Extension_Control *the_extension; - - if ( !rtems_is_name_valid( name ) ) - return RTEMS_INVALID_NAME; - - _Thread_Disable_dispatch(); /* to prevent deletion */ - - the_extension = _Extension_Allocate(); - - if ( !the_extension ) { - _Thread_Enable_dispatch(); - return RTEMS_TOO_MANY; - } - - _User_extensions_Add_set( &the_extension->Extension, extension_table ); - - _Objects_Open( &_Extension_Information, &the_extension->Object, &name ); - - *id = the_extension->Object.id; - _Thread_Enable_dispatch(); - return RTEMS_SUCCESSFUL; -} diff --git a/c/src/exec/sapi/src/extensiondelete.c b/c/src/exec/sapi/src/extensiondelete.c deleted file mode 100644 index 9c06d25f88..0000000000 --- a/c/src/exec/sapi/src/extensiondelete.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Extension Manager -- rtems_extension_delete - * - * - * COPYRIGHT (c) 1989-2002. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems/system.h> -#include <rtems/rtems/support.h> -#include <rtems/score/object.h> -#include <rtems/score/thread.h> -#include <rtems/extension.h> - -/*PAGE - * - * rtems_extension_delete - * - * This directive allows a thread to delete a extension. - * - * Input parameters: - * id - extension id - * - * Output parameters: - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -rtems_status_code rtems_extension_delete( - Objects_Id id -) -{ - Extension_Control *the_extension; - Objects_Locations location; - - the_extension = _Extension_Get( id, &location ); - switch ( location ) { - case OBJECTS_ERROR: - case OBJECTS_REMOTE: /* should never return this */ - return RTEMS_INVALID_ID; - case OBJECTS_LOCAL: - _User_extensions_Remove_set( &the_extension->Extension ); - _Objects_Close( &_Extension_Information, &the_extension->Object ); - _Extension_Free( the_extension ); - _Thread_Enable_dispatch(); - return RTEMS_SUCCESSFUL; - } - - return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */ -} diff --git a/c/src/exec/sapi/src/extensionident.c b/c/src/exec/sapi/src/extensionident.c deleted file mode 100644 index cc7b105832..0000000000 --- a/c/src/exec/sapi/src/extensionident.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Extension Manager -- rtems_extension_ident - * - * - * COPYRIGHT (c) 1989-2002. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems/system.h> -#include <rtems/rtems/support.h> -#include <rtems/score/object.h> -#include <rtems/score/thread.h> -#include <rtems/extension.h> - -/*PAGE - * - * rtems_extension_ident - * - * This directive returns the system ID associated with - * the extension name. - * - * Input parameters: - * name - user defined message queue name - * id - pointer to extension id - * - * Output parameters: - * *id - message queue id - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -rtems_status_code rtems_extension_ident( - rtems_name name, - Objects_Id *id -) -{ - Objects_Name_to_id_errors status; - - status = _Objects_Name_to_id( - &_Extension_Information, - &name, - OBJECTS_SEARCH_LOCAL_NODE, - id - ); - - return _Status_Object_name_errors_to_status[ status ]; -} diff --git a/c/src/exec/sapi/src/fatal.c b/c/src/exec/sapi/src/fatal.c deleted file mode 100644 index 8a0e3cedf0..0000000000 --- a/c/src/exec/sapi/src/fatal.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Fatal Error Manager - * - * COPYRIGHT (c) 1989-1999. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems/system.h> -#include <rtems/fatal.h> -#include <rtems/score/interr.h> - -/*PAGE - * - * rtems_fatal_error_occurred - * - * This directive will invoke the internal fatal error handler. - * - * Input parameters: - * the_error - fatal error status code - * - * Output parameters: NONE - */ - -void volatile rtems_fatal_error_occurred( - unsigned32 the_error -) -{ - _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, FALSE, the_error ); - -/* will not return from this routine */ -} diff --git a/c/src/exec/sapi/src/io.c b/c/src/exec/sapi/src/io.c deleted file mode 100644 index 8d98253393..0000000000 --- a/c/src/exec/sapi/src/io.c +++ /dev/null @@ -1,460 +0,0 @@ -/* - * Input/Output Manager - * - * - * COPYRIGHT (c) 1989-1999. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems/system.h> -#include <rtems/io.h> -#include <rtems/score/isr.h> -#include <rtems/score/thread.h> -#include <rtems/score/wkspace.h> - -#include <string.h> - -/*PAGE - * - * _IO_Manager_initialization - * - * The IO manager has been extended to support runtime driver - * registration. The driver table is now allocated in the - * workspace. - * - */ - -void _IO_Manager_initialization( - rtems_driver_address_table *driver_table, - unsigned32 drivers_in_table, - unsigned32 number_of_drivers, - unsigned32 number_of_devices -) -{ - void *tmp; - unsigned32 index; - rtems_driver_name_t *np; - - if ( number_of_drivers < drivers_in_table ) - number_of_drivers = drivers_in_table; - - tmp = _Workspace_Allocate_or_fatal_error( - sizeof( rtems_driver_address_table ) * ( number_of_drivers ) - ); - - _IO_Driver_address_table = (rtems_driver_address_table *) tmp; - - memset( - _IO_Driver_address_table, 0, - sizeof( rtems_driver_address_table ) * ( number_of_drivers ) - ); - - if ( drivers_in_table ) - for ( index = 0 ; index < drivers_in_table ; index++ ) - _IO_Driver_address_table[index] = driver_table[index]; - - _IO_Number_of_drivers = number_of_drivers; - _IO_Number_of_devices = number_of_devices; - - tmp = _Workspace_Allocate_or_fatal_error( - sizeof( rtems_driver_name_t ) * ( number_of_devices + 1 ) - ); - - _IO_Driver_name_table = (rtems_driver_name_t *) tmp; - - for( index=0, np = _IO_Driver_name_table ; - index < _IO_Number_of_devices ; - index++, np++ ) { - np->device_name = 0; - np->device_name_length = 0; - np->major = 0; - np->minor = 0; - } -} - -/*PAGE - * - * _IO_Initialize_all_drivers - * - * This routine initializes all device drivers - * - * Input Paramters: NONE - * - * Output Parameters: NONE - */ - -void _IO_Initialize_all_drivers( void ) -{ - rtems_device_major_number major; - - for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) - (void) rtems_io_initialize( major, 0, NULL); -} - -/*PAGE - * - * rtems_io_register_driver - * - * Register a driver into the device driver table. - * - * Input Paramters: - * major - device major number (0 means allocate - * a number) - * driver_table - driver callout function table - * registered_major - the major number which is registered - * - * Output Parameters: - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -rtems_status_code rtems_io_register_driver( - rtems_device_major_number major, - rtems_driver_address_table *driver_table, - rtems_device_major_number *registered_major -) -{ - *registered_major = 0; - - /* - * Test for initialise/open being present to indicate the driver slot is - * in use. - */ - - if ( major >= _IO_Number_of_drivers ) - return RTEMS_INVALID_NUMBER; - - if ( major == 0 ) - { - for ( major = _IO_Number_of_drivers - 1 ; major ; major-- ) - if ( _IO_Driver_address_table[major].initialization_entry == 0 && - _IO_Driver_address_table[major].open_entry == 0 ) - break; - - if (( major == 0 ) && - ( _IO_Driver_address_table[major].initialization_entry == 0 && - _IO_Driver_address_table[major].open_entry == 0 )) - return RTEMS_TOO_MANY; - } - - if ( _IO_Driver_address_table[major].initialization_entry == 0 && - _IO_Driver_address_table[major].open_entry == 0 ) - { - _IO_Driver_address_table[major] = *driver_table; - *registered_major = major; - - rtems_io_initialize( major, 0, NULL); - - return RTEMS_SUCCESSFUL; - } - - return RTEMS_RESOURCE_IN_USE; -} - -/*PAGE - * - * rtems_io_unregister_driver - * - * Unregister a driver from the device driver table. - * - * Input Paramters: - * major - device major number - * - * Output Parameters: - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -rtems_status_code rtems_io_unregister_driver( - rtems_device_major_number major -) -{ - if ( major < _IO_Number_of_drivers ) - { - memset( - &_IO_Driver_address_table[major], - 0, - sizeof( rtems_driver_address_table ) - ); - return RTEMS_SUCCESSFUL; - } - return RTEMS_UNSATISFIED; -} - -/*PAGE - * - * rtems_io_register_name - * - * Associate a name with a driver - * - * Input Paramters: - * device_name - pointer to name string to associate with device - * major - device major number to receive name - * minor - device minor number to receive name - * - * Output Parameters: - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -#if 0 -rtems_status_code rtems_io_register_name( - char *device_name, - rtems_device_major_number major, - rtems_device_minor_number minor - ) -{ - rtems_driver_name_t *np; - unsigned32 level; - unsigned32 index; - - /* find an empty slot */ - for( index=0, np = _IO_Driver_name_table ; - index < _IO_Number_of_devices ; - index++, np++ ) - { - - _ISR_Disable(level); - if (np->device_name == 0) - { - np->device_name = device_name; - np->device_name_length = strlen(device_name); - np->major = major; - np->minor = minor; - _ISR_Enable(level); - - return RTEMS_SUCCESSFUL; - } - _ISR_Enable(level); - } - - return RTEMS_TOO_MANY; -} -#endif - -/*PAGE - * - * rtems_io_lookup_name - * - * Find what driver "owns" this name - * - * Input Paramters: - * name - name to lookup the associated device - * - * Output Parameters: - * device_info - device associate with name - * RTEMS_SUCCESSFUL - if successful - * error code - if unsuccessful - */ - -#if 0 -rtems_status_code rtems_io_lookup_name( - const char *name, - rtems_driver_name_t **device_info -) -{ - rtems_driver_name_t *np; - unsigned32 index; - - for( index=0, np = _IO_Driver_name_table ; - index < _IO_Number_of_devices ; - index++, np++ ) - if (np->device_name) - if (strncmp(np->device_name, name, np->device_name_length) == 0) - { - *device_info = np; - return RTEMS_SUCCESSFUL; - } - - *device_info = 0; - return RTEMS_UNSATISFIED; -} -#endif - - -/*PAGE - * - * rtems_io_initialize - * - * This routine is the initialization directive of the IO manager. - * - * Input Paramters: - * major - device driver number - * minor - device number - * argument - pointer to argument(s) - * - * Output Parameters: - * returns - return code - */ - -rtems_status_code rtems_io_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *argument -) -{ - rtems_device_driver_entry callout; - - if ( major >= _IO_Number_of_drivers ) - return RTEMS_INVALID_NUMBER; - - callout = _IO_Driver_address_table[major].initialization_entry; - return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; -} - -/*PAGE - * - * rtems_io_open - * - * This routine is the open directive of the IO manager. - * - * Input Paramters: - * major - device driver number - * minor - device number - * argument - pointer to argument(s) - * - * Output Parameters: - * returns - return code - */ - -rtems_status_code rtems_io_open( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *argument -) -{ - rtems_device_driver_entry callout; - - if ( major >= _IO_Number_of_drivers ) - return RTEMS_INVALID_NUMBER; - - callout = _IO_Driver_address_table[major].open_entry; - return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; -} - -/*PAGE - * - * rtems_io_close - * - * This routine is the close directive of the IO manager. - * - * Input Paramters: - * major - device driver number - * minor - device number - * argument - pointer to argument(s) - * - * Output Parameters: - * returns - return code - */ - -rtems_status_code rtems_io_close( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *argument -) -{ - rtems_device_driver_entry callout; - - if ( major >= _IO_Number_of_drivers ) - return RTEMS_INVALID_NUMBER; - - callout = _IO_Driver_address_table[major].close_entry; - return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; -} - -/*PAGE - * - * rtems_io_read - * - * This routine is the read directive of the IO manager. - * - * Input Paramters: - * major - device driver number - * minor - device number - * argument - pointer to argument(s) - * - * Output Parameters: - * returns - return code - */ - -rtems_status_code rtems_io_read( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *argument -) -{ - rtems_device_driver_entry callout; - - if ( major >= _IO_Number_of_drivers ) - return RTEMS_INVALID_NUMBER; - - callout = _IO_Driver_address_table[major].read_entry; - return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; -} - -/*PAGE - * - * rtems_io_write - * - * This routine is the write directive of the IO manager. - * - * Input Paramters: - * major - device driver number - * minor - device number - * argument - pointer to argument(s) - * - * Output Parameters: - * returns - return code - */ - -rtems_status_code rtems_io_write( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *argument -) -{ - rtems_device_driver_entry callout; - - if ( major >= _IO_Number_of_drivers ) - return RTEMS_INVALID_NUMBER; - - callout = _IO_Driver_address_table[major].write_entry; - return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; -} - -/*PAGE - * - * rtems_io_control - * - * This routine is the control directive of the IO manager. - * - * Input Paramters: - * major - device driver number - * minor - device number - * argument - pointer to argument(s) - * - * Output Parameters: - * returns - return code - */ - -rtems_status_code rtems_io_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *argument -) -{ - rtems_device_driver_entry callout; - - if ( major >= _IO_Number_of_drivers ) - return RTEMS_INVALID_NUMBER; - - callout = _IO_Driver_address_table[major].control_entry; - return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; -} - diff --git a/c/src/exec/sapi/src/itronapi.c b/c/src/exec/sapi/src/itronapi.c deleted file mode 100644 index f2d45e08e9..0000000000 --- a/c/src/exec/sapi/src/itronapi.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * ITRON API Initialization Support - * - * NOTE: - * - * COPYRIGHT (c) 1989-1999. - * 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.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 */ -}; - -Objects_Information *_ITRON_Objects[ OBJECTS_ITRON_CLASSES_LAST + 1 ]; - -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; - - _Objects_Information_table[OBJECTS_ITRON_API] = _ITRON_Objects; - - _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 */ diff --git a/c/src/exec/sapi/src/posixapi.c b/c/src/exec/sapi/src/posixapi.c deleted file mode 100644 index 1776dc23f4..0000000000 --- a/c/src/exec/sapi/src/posixapi.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * RTEMS API Initialization Support - * - * NOTE: - * - * COPYRIGHT (c) 1989-1999. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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/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/priority.h> -#include <rtems/posix/psignal.h> -#include <rtems/posix/pthread.h> -#include <rtems/posix/ptimer.h> -#include <rtems/posix/semaphore.h> -#include <rtems/posix/time.h> - -/*PAGE - * - * _POSIX_API_Initialize - * - * XXX - */ - -posix_api_configuration_table _POSIX_Default_configuration = { - 0, /* maximum_threads */ - 0, /* maximum_mutexes */ - 0, /* maximum_condition_variables */ - 0, /* maximum_keys */ - 0, /* maximum_timers */ - 0, /* maximum_queued_signals */ - 0, /* number_of_initialization_threads */ - 0, /* maximum_message_queues */ - 0, /* maximum_semaphores */ - NULL /* User_initialization_threads_table */ -}; - -Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ]; - - -void _POSIX_API_Initialize( - rtems_configuration_table *configuration_table -) -{ - posix_api_configuration_table *api_configuration; - - /* XXX need to assert here based on size assumptions */ - - assert( sizeof(pthread_t) == sizeof(Objects_Id) ); - - api_configuration = configuration_table->POSIX_api_configuration; - if ( !api_configuration ) - api_configuration = &_POSIX_Default_configuration; - - _Objects_Information_table[OBJECTS_POSIX_API] = _POSIX_Objects; - - _POSIX_signals_Manager_Initialization( - api_configuration->maximum_queued_signals - ); - - _POSIX_Threads_Manager_initialization( - api_configuration->maximum_threads, - api_configuration->number_of_initialization_threads, - api_configuration->User_initialization_threads_table - ); - - _POSIX_Condition_variables_Manager_initialization( - api_configuration->maximum_condition_variables - ); - - _POSIX_Key_Manager_initialization( api_configuration->maximum_keys ); - - _POSIX_Mutex_Manager_initialization( - api_configuration->maximum_mutexes - ); - - _POSIX_Message_queue_Manager_initialization( - api_configuration->maximum_message_queues - ); - - _POSIX_Semaphore_Manager_initialization( - api_configuration->maximum_semaphores - ); - - _POSIX_Timer_Manager_initialization ( api_configuration->maximum_timers ); -} - -#endif -/* end of file */ diff --git a/c/src/exec/sapi/src/rtemsapi.c b/c/src/exec/sapi/src/rtemsapi.c deleted file mode 100644 index 9530112945..0000000000 --- a/c/src/exec/sapi/src/rtemsapi.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * POSIX API Initialization Support - * - * NOTE: - * - * COPYRIGHT (c) 1989-1999. - * 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.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* - * RTEMS_API_INIT is defined so all of the RTEMS API - * data will be included in this object file. - */ - -#define RTEMS_API_INIT - -#include <rtems/system.h> -#include <rtems/rtems/status.h> -#include <rtems/rtems/rtemsapi.h> - -#include <rtems/rtems/intr.h> -#include <rtems/rtems/clock.h> -#include <rtems/rtems/tasks.h> -#include <rtems/rtems/dpmem.h> -#include <rtems/rtems/event.h> -#include <rtems/rtems/message.h> -#if defined(RTEMS_MULTIPROCESSING) -#include <rtems/rtems/mp.h> -#endif -#include <rtems/rtems/part.h> -#include <rtems/rtems/ratemon.h> -#include <rtems/rtems/region.h> -#include <rtems/rtems/sem.h> -#include <rtems/rtems/signal.h> -#include <rtems/rtems/timer.h> - -Objects_Information *_RTEMS_Objects[ OBJECTS_RTEMS_CLASSES_LAST + 1 ]; - -/*PAGE - * - * _RTEMS_API_Initialize - * - * XXX - */ - -void _RTEMS_API_Initialize( - rtems_configuration_table *configuration_table -) -{ - rtems_api_configuration_table *api_configuration; - - api_configuration = configuration_table->RTEMS_api_configuration; - - _Objects_Information_table[OBJECTS_CLASSIC_API] = _RTEMS_Objects; - - _Attributes_Handler_initialization(); - - _Interrupt_Manager_initialization(); - -#if defined(RTEMS_MULTIPROCESSING) - _Multiprocessing_Manager_initialization(); -#endif - - _RTEMS_tasks_Manager_initialization( - api_configuration->maximum_tasks, - api_configuration->number_of_initialization_tasks, - api_configuration->User_initialization_tasks_table - ); - - _Timer_Manager_initialization( api_configuration->maximum_timers ); - - _Signal_Manager_initialization(); - - _Event_Manager_initialization(); - - _Message_queue_Manager_initialization( - api_configuration->maximum_message_queues - ); - - _Semaphore_Manager_initialization( api_configuration->maximum_semaphores ); - - _Partition_Manager_initialization( api_configuration->maximum_partitions ); - - _Region_Manager_initialization( api_configuration->maximum_regions ); - - _Dual_ported_memory_Manager_initialization( api_configuration->maximum_ports); - - _Rate_monotonic_Manager_initialization( api_configuration->maximum_periods ); -} - -/* end of file */ |