Changeset 3a4ae6c in rtems for cpukit/sapi/src
- Timestamp:
- 09/11/95 19:35:39 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- ced11f99
- Parents:
- 5072b07
- Location:
- cpukit/sapi/src
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/sapi/src/exinit.c
r5072b07 r3a4ae6c 22 22 #include <rtems/system.h> 23 23 #include <rtems/config.h> 24 #include <rtems/copyrt.h>25 #include <rtems/clock.h>26 #include <rtems/tasks.h>27 24 #include <rtems/debug.h> 28 #include <rtems/dpmem.h>29 #include <rtems/event.h>30 25 #include <rtems/extension.h> 31 26 #include <rtems/fatal.h> 32 #include <rtems/heap.h>33 27 #include <rtems/init.h> 34 #include <rtems/intthrd.h>35 #include <rtems/isr.h>36 #include <rtems/intr.h>37 28 #include <rtems/io.h> 38 #include <rtems/message.h>39 #include <rtems/mp.h>40 #include <rtems/mpci.h>41 #include <rtems/part.h>42 #include <rtems/priority.h>43 #include <rtems/ratemon.h>44 #include <rtems/region.h>45 #include <rtems/sem.h>46 #include <rtems/signal.h>47 29 #include <rtems/sysstate.h> 48 #include <rtems/thread.h> 49 #include <rtems/timer.h> 50 #include <rtems/tod.h> 51 #include <rtems/userext.h> 52 #include <rtems/watchdog.h> 53 #include <rtems/wkspace.h> 54 30 31 #include <rtems/core/copyrt.h> 32 #include <rtems/core/heap.h> 33 #include <rtems/core/interr.h> 34 #include <rtems/core/intthrd.h> 35 #include <rtems/core/isr.h> 36 #include <rtems/core/mpci.h> 37 #include <rtems/core/priority.h> 38 #include <rtems/core/thread.h> 39 #include <rtems/core/tod.h> 40 #include <rtems/core/userext.h> 41 #include <rtems/core/watchdog.h> 42 #include <rtems/core/wkspace.h> 43 44 #include <rtems/directives.h> 55 45 #include <rtems/sptables.h> 46 47 #include <rtems/rtems/rtemsapi.h> 56 48 57 49 /*PAGE … … 104 96 _ISR_Disable( bsp_level ); 105 97 106 _System_state_Set( SYSTEM_STATE_BEFORE_INITIALIZATION ); 98 if ( cpu_table == NULL ) 99 _Internal_error_Occurred( 100 INTERNAL_ERROR_CORE, 101 TRUE, 102 INTERNAL_ERROR_NO_CONFIGURATION_TABLE 103 ); 104 105 /* 106 * Initialize the system state based on whether this is an MP system. 107 */ 108 109 multiprocessing_table = configuration_table->User_multiprocessing_table; 110 111 _System_state_Handler_initialization( 112 (multiprocessing_table) ? TRUE : FALSE 113 ); 114 115 /* 116 * Provided just for user convenience. 117 */ 118 119 _Configuration_Table = configuration_table; 120 _Configuration_MP_table = multiprocessing_table; 121 122 /* 123 * Internally we view single processor systems as a very restricted 124 * multiprocessor system. 125 */ 126 127 if ( multiprocessing_table == NULL ) 128 multiprocessing_table = 129 (void *)&_Initialization_Default_multiprocessing_table; 130 131 if ( cpu_table == NULL ) 132 _Internal_error_Occurred( 133 INTERNAL_ERROR_CORE, 134 TRUE, 135 INTERNAL_ERROR_NO_CPU_TABLE 136 ); 107 137 108 138 _CPU_Initialize( cpu_table, _Thread_Dispatch ); … … 114 144 115 145 _Debug_Manager_initialization(); 116 117 multiprocessing_table = configuration_table->User_multiprocessing_table;118 if ( multiprocessing_table == NULL )119 multiprocessing_table =120 (void *) &_Configuration_Default_multiprocessing_table;121 122 _Configuration_Handler_initialization(123 configuration_table,124 multiprocessing_table,125 multiprocessing_table->User_mpci_table126 );127 128 _Attributes_Handler_initialization();129 146 130 147 _Thread_Dispatch_initialization(); … … 143 160 _Objects_Handler_initialization( 144 161 multiprocessing_table->node, 162 multiprocessing_table->maximum_nodes, 145 163 multiprocessing_table->maximum_global_objects 146 164 ); … … 154 172 _Thread_Handler_initialization( 155 173 configuration_table->ticks_per_timeslice, 174 configuration_table->maximum_extensions, 156 175 multiprocessing_table->maximum_proxies 157 176 ); 158 177 159 _MPCI_Handler_initialization(); 178 _MPCI_Handler_initialization( 179 multiprocessing_table->User_mpci_table 180 ); 181 182 _Internal_threads_Initialization(); 160 183 161 184 /* MANAGERS */ 162 163 _Interrupt_Manager_initialization();164 165 _Multiprocessing_Manager_initialization();166 167 _RTEMS_tasks_Manager_initialization( configuration_table->maximum_tasks );168 169 _Timer_Manager_initialization( configuration_table->maximum_timers );170 185 171 186 _Extension_Manager_initialization( configuration_table->maximum_extensions ); … … 173 188 _IO_Manager_initialization( 174 189 configuration_table->Device_driver_table, 175 configuration_table->number_of_device_drivers 176 ); 177 178 _Event_Manager_initialization(); 179 180 _Message_queue_Manager_initialization( 181 configuration_table->maximum_message_queues 182 ); 183 184 _Semaphore_Manager_initialization( 185 configuration_table->maximum_semaphores 186 ); 187 188 _Partition_Manager_initialization( 189 configuration_table->maximum_partitions 190 ); 191 192 _Region_Manager_initialization( configuration_table->maximum_regions ); 193 194 _Dual_ported_memory_Manager_initialization( 195 configuration_table->maximum_ports 196 ); 197 198 _Rate_monotonic_Manager_initialization( 199 configuration_table->maximum_periods 200 ); 201 202 _Internal_threads_Initialization(); 190 configuration_table->number_of_device_drivers, 191 configuration_table->maximum_devices 192 ); 193 194 _RTEMS_API_Initialize( configuration_table ); 203 195 204 196 if ( cpu_table->pretasking_hook ) 205 197 (*cpu_table->pretasking_hook)(); 198 199 _Internal_threads_Start(); 206 200 207 201 _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING ); -
cpukit/sapi/src/extension.c
r5072b07 r3a4ae6c 15 15 16 16 #include <rtems/system.h> 17 #include <rtems/ support.h>18 #include <rtems/ object.h>19 #include <rtems/ thread.h>17 #include <rtems/rtems/support.h> 18 #include <rtems/core/object.h> 19 #include <rtems/core/thread.h> 20 20 #include <rtems/extension.h> 21 21 … … 66 66 67 67 rtems_status_code rtems_extension_create( 68 rtems_name 68 rtems_name name, 69 69 rtems_extensions_table *extension_table, 70 Objects_Id 70 Objects_Id *id 71 71 ) 72 72 { … … 74 74 75 75 if ( !rtems_is_name_valid( name ) ) 76 return ( RTEMS_INVALID_NAME );76 return RTEMS_INVALID_NAME; 77 77 78 78 _Thread_Disable_dispatch(); /* to prevent deletion */ … … 82 82 if ( !the_extension ) { 83 83 _Thread_Enable_dispatch(); 84 return ( RTEMS_TOO_MANY );84 return RTEMS_TOO_MANY; 85 85 } 86 86 … … 91 91 *id = the_extension->Object.id; 92 92 _Thread_Enable_dispatch(); 93 return ( RTEMS_SUCCESSFUL );93 return RTEMS_SUCCESSFUL; 94 94 } 95 95 … … 116 116 ) 117 117 { 118 return _Objects_Name_to_id( 118 Objects_Name_to_id_errors status; 119 120 status = _Objects_Name_to_id( 119 121 &_Extension_Information, 120 122 &name, 121 RTEMS_SEARCH_LOCAL_NODE,123 OBJECTS_SEARCH_LOCAL_NODE, 122 124 id 123 125 ); 126 127 return _Status_Object_name_errors_to_status[ status ]; 124 128 } 125 129 … … 149 153 case OBJECTS_ERROR: 150 154 case OBJECTS_REMOTE: /* should never return this */ 151 return ( RTEMS_INVALID_ID );155 return RTEMS_INVALID_ID; 152 156 case OBJECTS_LOCAL: 153 157 _User_extensions_Remove_set( &the_extension->Extension ); … … 155 159 _Extension_Free( the_extension ); 156 160 _Thread_Enable_dispatch(); 157 return ( RTEMS_SUCCESSFUL );161 return RTEMS_SUCCESSFUL; 158 162 } 159 163 160 return ( RTEMS_INTERNAL_ERROR ); /* unreached - only to remove warnings */164 return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */ 161 165 } -
cpukit/sapi/src/fatal.c
r5072b07 r3a4ae6c 14 14 15 15 #include <rtems/system.h> 16 #include <rtems/config.h>17 16 #include <rtems/fatal.h> 18 #include <rtems/sysstate.h> 19 #include <rtems/userext.h> 17 #include <rtems/core/interr.h> 20 18 21 19 /*PAGE … … 23 21 * rtems_fatal_error_occurred 24 22 * 25 * This directive will invoke the fatal error handler supplied by the user 26 * followed by the the default one provided by the executive. The default 27 * error handler assumes no hardware is present to help inform the user 28 * of the problem. Halt stores the error code in a known register, 29 * disables interrupts, and halts the CPU. If the CPU does not have a 30 * halt instruction, it will loop to itself. 23 * This directive will invoke the internal fatal error handler. 31 24 * 32 25 * Input parameters: 33 26 * the_error - fatal error status code 34 27 * 35 * Output parameters: 36 * the_error - on stack 37 * status register - on stack 38 * 39 * NOTE: The the_error is not necessarily a directive status code. 28 * Output parameters: NONE 40 29 */ 41 30 … … 44 33 ) 45 34 { 46 47 _User_extensions_Fatal( the_error ); 48 49 _System_state_Set( SYSTEM_STATE_FAILED ); 50 51 _CPU_Fatal_halt( the_error ); 35 _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, FALSE, the_error ); 52 36 53 37 /* will not return from this routine */ -
cpukit/sapi/src/io.c
r5072b07 r3a4ae6c 15 15 16 16 #include <rtems/system.h> 17 #include <rtems/config.h>18 17 #include <rtems/io.h> 19 #include <rtems/isr.h> 20 #include <rtems/thread.h> 21 #include <rtems/intr.h> 18 #include <rtems/core/isr.h> 19 #include <rtems/core/thread.h> 22 20 23 21 #include <string.h> … … 39 37 40 38 for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 41 (void) rtems_io_initialize( major, 0, _Configuration_Table);39 (void) rtems_io_initialize( major, 0, NULL); 42 40 } 43 41 … … 61 59 rtems_driver_name_t *np; 62 60 unsigned32 level; 61 unsigned32 index; 63 62 64 63 /* find an empty slot */ 65 for (np = rtems_driver_name_table; np < &rtems_driver_name_table[RTEMS_MAX_DRIVER_NAMES]; np++) 64 for( index=0, np = _IO_Driver_name_table ; 65 index < _IO_Number_of_devices ; 66 index++, np++ ) 66 67 { 67 rtems_interrupt_disable(level); 68 69 _ISR_Disable(level); 68 70 if (np->device_name == 0) 69 71 { … … 72 74 np->major = major; 73 75 np->minor = minor; 74 rtems_interrupt_enable(level);76 _ISR_Enable(level); 75 77 76 78 return RTEMS_SUCCESSFUL; 77 79 } 78 rtems_interrupt_enable(level);80 _ISR_Enable(level); 79 81 } 80 82 … … 94 96 95 97 rtems_status_code rtems_io_lookup_name( 96 const char *pathname,98 const char *pathname, 97 99 rtems_driver_name_t **rnp 98 100 ) 99 101 { 100 102 rtems_driver_name_t *np; 101 102 for (np = rtems_driver_name_table; np < &rtems_driver_name_table[RTEMS_MAX_DRIVER_NAMES]; np++) 103 unsigned32 index; 104 105 for( index=0, np = _IO_Driver_name_table ; 106 index < _IO_Number_of_devices ; 107 index++, np++ ) 103 108 if (np->device_name) 104 109 if (strncmp(np->device_name, pathname, np->device_name_length) == 0)
Note: See TracChangeset
for help on using the changeset viewer.