Changeset adf98bd in rtems
- Timestamp:
- 02/21/96 14:44:11 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 8cbbe312
- Parents:
- 75f09e5
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/headers/mpci.h
r75f09e5 radf98bd 29 29 #include <rtems/score/watchdog.h> 30 30 #include <rtems/score/coresem.h> 31 32 /* 33 * The following constants define the stack size requirements for 34 * the system threads. 35 */ 36 37 #define MPCI_RECEIVE_SERVER_STACK_SIZE \ 38 ( STACK_MINIMUM_SIZE + \ 39 CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \ 40 _CPU_Table.extra_mpci_receive_server_stack \ 41 ) 31 42 32 43 /* … … 93 104 94 105 /* 106 * The following enumerated type defines the list of 107 * internal MP operations. 108 */ 109 110 typedef enum { 111 MPCI_PACKETS_SYSTEM_VERIFY = 0 112 } MPCI_Internal_Remote_operations; 113 114 /* 115 * The following data structure defines the packet used to perform 116 * remote event operations. 117 */ 118 119 typedef struct { 120 MP_packet_Prefix Prefix; 121 MPCI_Internal_Remote_operations operation; 122 unsigned32 maximum_nodes; 123 unsigned32 maximum_global_objects; 124 } MPCI_Internal_packet; 125 126 /* 95 127 * This is the core semaphore which the MPCI Receive Server blocks on. 96 128 */ … … 136 168 unsigned32 timeout_status 137 169 ); 170 171 /* 172 * _MPCI_Create_server 173 * 174 * DESCRIPTION: 175 * 176 * This routine creates the packet receive server used in MP systems. 177 */ 178 179 void _MPCI_Create_server( void ); 138 180 139 181 /* … … 260 302 */ 261 303 262 void _MPCI_Receive_server( void ); 304 Thread _MPCI_Receive_server( 305 unsigned32 ignored 306 ); 263 307 264 308 /*PAGE … … 272 316 273 317 void _MPCI_Announce ( void ); 318 319 /* 320 * _MPCI_Internal_packets_Send_process_packet 321 * 322 * DESCRIPTION: 323 * 324 * This routine performs a remote procedure call so that a 325 * process operation can be performed on another node. 326 */ 327 328 void _MPCI_Internal_packets_Send_process_packet ( 329 MPCI_Internal_Remote_operations operation 330 ); 331 332 /* 333 * _MPCI_Internal_packets_Send_request_packet 334 * 335 * DESCRIPTION: 336 * 337 * This routine performs a remote procedure call so that a 338 * directive operation can be initiated on another node. 339 * 340 * This routine is not needed since there are no request 341 * packets to be sent by this manager. 342 */ 343 344 /* 345 * _MPCI_Internal_packets_Send_response_packet 346 * 347 * DESCRIPTION: 348 * 349 * This routine performs a remote procedure call so that a 350 * directive can be performed on another node. 351 * 352 * This routine is not needed since there are no response 353 * packets to be sent by this manager. 354 */ 355 356 /* 357 * 358 * _MPCI_Internal_packets_Process_packet 359 * 360 * DESCRIPTION: 361 * 362 * This routine performs the actions specific to this package for 363 * the request from another node. 364 */ 365 366 void _MPCI_Internal_packets_Process_packet ( 367 MP_packet_Prefix *the_packet_prefix 368 ); 369 370 /* 371 * _MPCI_Internal_packets_Send_object_was_deleted 372 * 373 * DESCRIPTION: 374 * 375 * This routine is invoked indirectly by the thread queue 376 * when a proxy has been removed from the thread queue and 377 * the remote node must be informed of this. 378 * 379 * This routine is not needed since there are no objects 380 * deleted by this manager. 381 */ 382 383 /* 384 * _MPCI_Internal_packets_Send_extract_proxy 385 * 386 * DESCRIPTION: 387 * 388 * This routine is invoked when a task is deleted and it 389 * has a proxy which must be removed from a thread queue and 390 * the remote node must be informed of this. 391 * 392 * This routine is not needed since there are no objects 393 * deleted by this manager. 394 */ 395 396 /* 397 * _MPCI_Internal_packets_Get_packet 398 * 399 * DESCRIPTION: 400 * 401 * This routine is used to obtain a internal threads mp packet. 402 */ 403 404 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ); 274 405 275 406 #ifdef __cplusplus -
c/src/exec/score/headers/mppkt.h
r75f09e5 radf98bd 39 39 40 40 typedef enum { 41 MP_PACKET_ INTERNAL_THREADS= 0,41 MP_PACKET_MPCI_INTERNAL = 0, 42 42 MP_PACKET_TASKS = 1, 43 43 MP_PACKET_MESSAGE_QUEUE = 2, … … 49 49 } MP_packet_Classes; 50 50 51 #define MP_PACKET_CLASSES_FIRST MP_PACKET_ INTERNAL_THREADS51 #define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL 52 52 #define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL 53 53 -
c/src/exec/score/headers/object.h
r75f09e5 radf98bd 101 101 #define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS 102 102 #define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES 103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_ INTERNAL_THREADS103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_MPCI_PACKETS 104 104 #define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS 105 105 -
c/src/exec/score/headers/sysstate.h
r75f09e5 radf98bd 32 32 SYSTEM_STATE_BEFORE_INITIALIZATION, /* start -> end of 1st init part */ 33 33 SYSTEM_STATE_BEFORE_MULTITASKING, /* end of 1st -> beginning of 2nd */ 34 SYSTEM_STATE_BEGIN_MULTITASKING, /* beginning of 2nd -> end of SYSI*/34 SYSTEM_STATE_BEGIN_MULTITASKING, /* just before multitasking starts */ 35 35 SYSTEM_STATE_UP, /* normal operation */ 36 36 SYSTEM_STATE_FAILED /* fatal error occurred */ -
c/src/exec/score/headers/thread.h
r75f09e5 radf98bd 162 162 163 163 /* 164 * The following constants define the stack size requirements for 165 * the idle thread. 166 */ 167 168 169 #define THREAD_IDLE_STACK_SIZE STACK_MINIMUM_SIZE 170 171 /* 172 * The following defines the information control block used to 173 * manage this class of objects. 174 */ 175 176 EXTERN Objects_Information _Thread_Internal_information; 177 178 /* 179 * The following define the thread control pointers used to access 180 * and manipulate the idle thread. 181 */ 182 183 EXTERN Thread_Control *_Thread_Idle; 184 185 /* 164 186 * The following context area contains the context of the "thread" 165 187 * which invoked the start multitasking routine. This context is … … 237 259 unsigned32 maximum_proxies 238 260 ); 261 262 /* 263 * _Thread_Create_idle 264 * 265 * DESCRIPTION: 266 * 267 * This routine creates the idle thread. 268 * 269 * WARNING!! No thread should be created before this one. 270 */ 271 272 void _Thread_Create_idle( void ); 239 273 240 274 /* … … 757 791 ); 758 792 793 /* 794 * _Thread_Internal_allocate 795 * 796 * DESCRIPTION: 797 * 798 * This routine allocates an internal thread. 799 */ 800 801 STATIC INLINE Thread_Control *_Thread_Internal_allocate( void ); 802 803 /* 804 * _Thread_Internal_free 805 * 806 * DESCRIPTION: 807 * 808 * This routine frees an internal thread. 809 */ 810 811 STATIC INLINE void _Thread_Internal_free ( 812 Thread_Control *the_task 813 ); 814 815 /* 816 * _Thread_Idle_body 817 * 818 * DESCRIPTION: 819 * 820 * This routine is the body of the system idle thread. 821 */ 822 823 #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) 824 Thread _Thread_Idle_body( 825 unsigned32 ignored 826 ); 827 #endif 828 759 829 #include <rtems/score/thread.inl> 760 830 #include <rtems/score/threadmp.h> -
c/src/exec/score/include/rtems/score/mpci.h
r75f09e5 radf98bd 29 29 #include <rtems/score/watchdog.h> 30 30 #include <rtems/score/coresem.h> 31 32 /* 33 * The following constants define the stack size requirements for 34 * the system threads. 35 */ 36 37 #define MPCI_RECEIVE_SERVER_STACK_SIZE \ 38 ( STACK_MINIMUM_SIZE + \ 39 CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \ 40 _CPU_Table.extra_mpci_receive_server_stack \ 41 ) 31 42 32 43 /* … … 93 104 94 105 /* 106 * The following enumerated type defines the list of 107 * internal MP operations. 108 */ 109 110 typedef enum { 111 MPCI_PACKETS_SYSTEM_VERIFY = 0 112 } MPCI_Internal_Remote_operations; 113 114 /* 115 * The following data structure defines the packet used to perform 116 * remote event operations. 117 */ 118 119 typedef struct { 120 MP_packet_Prefix Prefix; 121 MPCI_Internal_Remote_operations operation; 122 unsigned32 maximum_nodes; 123 unsigned32 maximum_global_objects; 124 } MPCI_Internal_packet; 125 126 /* 95 127 * This is the core semaphore which the MPCI Receive Server blocks on. 96 128 */ … … 136 168 unsigned32 timeout_status 137 169 ); 170 171 /* 172 * _MPCI_Create_server 173 * 174 * DESCRIPTION: 175 * 176 * This routine creates the packet receive server used in MP systems. 177 */ 178 179 void _MPCI_Create_server( void ); 138 180 139 181 /* … … 260 302 */ 261 303 262 void _MPCI_Receive_server( void ); 304 Thread _MPCI_Receive_server( 305 unsigned32 ignored 306 ); 263 307 264 308 /*PAGE … … 272 316 273 317 void _MPCI_Announce ( void ); 318 319 /* 320 * _MPCI_Internal_packets_Send_process_packet 321 * 322 * DESCRIPTION: 323 * 324 * This routine performs a remote procedure call so that a 325 * process operation can be performed on another node. 326 */ 327 328 void _MPCI_Internal_packets_Send_process_packet ( 329 MPCI_Internal_Remote_operations operation 330 ); 331 332 /* 333 * _MPCI_Internal_packets_Send_request_packet 334 * 335 * DESCRIPTION: 336 * 337 * This routine performs a remote procedure call so that a 338 * directive operation can be initiated on another node. 339 * 340 * This routine is not needed since there are no request 341 * packets to be sent by this manager. 342 */ 343 344 /* 345 * _MPCI_Internal_packets_Send_response_packet 346 * 347 * DESCRIPTION: 348 * 349 * This routine performs a remote procedure call so that a 350 * directive can be performed on another node. 351 * 352 * This routine is not needed since there are no response 353 * packets to be sent by this manager. 354 */ 355 356 /* 357 * 358 * _MPCI_Internal_packets_Process_packet 359 * 360 * DESCRIPTION: 361 * 362 * This routine performs the actions specific to this package for 363 * the request from another node. 364 */ 365 366 void _MPCI_Internal_packets_Process_packet ( 367 MP_packet_Prefix *the_packet_prefix 368 ); 369 370 /* 371 * _MPCI_Internal_packets_Send_object_was_deleted 372 * 373 * DESCRIPTION: 374 * 375 * This routine is invoked indirectly by the thread queue 376 * when a proxy has been removed from the thread queue and 377 * the remote node must be informed of this. 378 * 379 * This routine is not needed since there are no objects 380 * deleted by this manager. 381 */ 382 383 /* 384 * _MPCI_Internal_packets_Send_extract_proxy 385 * 386 * DESCRIPTION: 387 * 388 * This routine is invoked when a task is deleted and it 389 * has a proxy which must be removed from a thread queue and 390 * the remote node must be informed of this. 391 * 392 * This routine is not needed since there are no objects 393 * deleted by this manager. 394 */ 395 396 /* 397 * _MPCI_Internal_packets_Get_packet 398 * 399 * DESCRIPTION: 400 * 401 * This routine is used to obtain a internal threads mp packet. 402 */ 403 404 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ); 274 405 275 406 #ifdef __cplusplus -
c/src/exec/score/include/rtems/score/mppkt.h
r75f09e5 radf98bd 39 39 40 40 typedef enum { 41 MP_PACKET_ INTERNAL_THREADS= 0,41 MP_PACKET_MPCI_INTERNAL = 0, 42 42 MP_PACKET_TASKS = 1, 43 43 MP_PACKET_MESSAGE_QUEUE = 2, … … 49 49 } MP_packet_Classes; 50 50 51 #define MP_PACKET_CLASSES_FIRST MP_PACKET_ INTERNAL_THREADS51 #define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL 52 52 #define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL 53 53 -
c/src/exec/score/include/rtems/score/object.h
r75f09e5 radf98bd 101 101 #define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS 102 102 #define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES 103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_ INTERNAL_THREADS103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_MPCI_PACKETS 104 104 #define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS 105 105 -
c/src/exec/score/include/rtems/score/sysstate.h
r75f09e5 radf98bd 32 32 SYSTEM_STATE_BEFORE_INITIALIZATION, /* start -> end of 1st init part */ 33 33 SYSTEM_STATE_BEFORE_MULTITASKING, /* end of 1st -> beginning of 2nd */ 34 SYSTEM_STATE_BEGIN_MULTITASKING, /* beginning of 2nd -> end of SYSI*/34 SYSTEM_STATE_BEGIN_MULTITASKING, /* just before multitasking starts */ 35 35 SYSTEM_STATE_UP, /* normal operation */ 36 36 SYSTEM_STATE_FAILED /* fatal error occurred */ -
c/src/exec/score/include/rtems/score/thread.h
r75f09e5 radf98bd 162 162 163 163 /* 164 * The following constants define the stack size requirements for 165 * the idle thread. 166 */ 167 168 169 #define THREAD_IDLE_STACK_SIZE STACK_MINIMUM_SIZE 170 171 /* 172 * The following defines the information control block used to 173 * manage this class of objects. 174 */ 175 176 EXTERN Objects_Information _Thread_Internal_information; 177 178 /* 179 * The following define the thread control pointers used to access 180 * and manipulate the idle thread. 181 */ 182 183 EXTERN Thread_Control *_Thread_Idle; 184 185 /* 164 186 * The following context area contains the context of the "thread" 165 187 * which invoked the start multitasking routine. This context is … … 237 259 unsigned32 maximum_proxies 238 260 ); 261 262 /* 263 * _Thread_Create_idle 264 * 265 * DESCRIPTION: 266 * 267 * This routine creates the idle thread. 268 * 269 * WARNING!! No thread should be created before this one. 270 */ 271 272 void _Thread_Create_idle( void ); 239 273 240 274 /* … … 757 791 ); 758 792 793 /* 794 * _Thread_Internal_allocate 795 * 796 * DESCRIPTION: 797 * 798 * This routine allocates an internal thread. 799 */ 800 801 STATIC INLINE Thread_Control *_Thread_Internal_allocate( void ); 802 803 /* 804 * _Thread_Internal_free 805 * 806 * DESCRIPTION: 807 * 808 * This routine frees an internal thread. 809 */ 810 811 STATIC INLINE void _Thread_Internal_free ( 812 Thread_Control *the_task 813 ); 814 815 /* 816 * _Thread_Idle_body 817 * 818 * DESCRIPTION: 819 * 820 * This routine is the body of the system idle thread. 821 */ 822 823 #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) 824 Thread _Thread_Idle_body( 825 unsigned32 ignored 826 ); 827 #endif 828 759 829 #include <rtems/score/thread.inl> 760 830 #include <rtems/score/threadmp.h> -
c/src/exec/score/inline/rtems/score/thread.inl
r75f09e5 radf98bd 284 284 } 285 285 286 /*PAGE 287 * 288 * _Thread_Internal_allocate 289 * 290 */ 291 292 STATIC INLINE Thread_Control *_Thread_Internal_allocate( void ) 293 { 294 return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ); 295 } 296 297 /*PAGE 298 * 299 * _Thread_Internal_free 300 * 301 */ 302 303 STATIC INLINE void _Thread_Internal_free ( 304 Thread_Control *the_task 305 ) 306 { 307 _Objects_Free( &_Thread_Internal_information, &the_task->Object ); 308 } 309 286 310 #endif 287 311 /* end of include file */ -
c/src/exec/score/inline/thread.inl
r75f09e5 radf98bd 284 284 } 285 285 286 /*PAGE 287 * 288 * _Thread_Internal_allocate 289 * 290 */ 291 292 STATIC INLINE Thread_Control *_Thread_Internal_allocate( void ) 293 { 294 return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ); 295 } 296 297 /*PAGE 298 * 299 * _Thread_Internal_free 300 * 301 */ 302 303 STATIC INLINE void _Thread_Internal_free ( 304 Thread_Control *the_task 305 ) 306 { 307 _Objects_Free( &_Thread_Internal_information, &the_task->Object ); 308 } 309 286 310 #endif 287 311 /* end of include file */ -
c/src/exec/score/macros/rtems/score/thread.inl
r75f09e5 radf98bd 198 198 ( (_code) == THREAD_STATUS_PROXY_BLOCKING ) 199 199 200 /* 201 * _Thread_Internal_allocate 202 * 203 */ 204 205 #define _Thread_Internal_allocate() \ 206 ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information )) 207 208 /* 209 * _Thread_Internal_free 210 * 211 */ 212 213 #define _Thread_Internal_free( _the_task ) \ 214 _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object ) 215 200 216 #endif 201 217 /* end of include file */ -
c/src/exec/score/macros/thread.inl
r75f09e5 radf98bd 198 198 ( (_code) == THREAD_STATUS_PROXY_BLOCKING ) 199 199 200 /* 201 * _Thread_Internal_allocate 202 * 203 */ 204 205 #define _Thread_Internal_allocate() \ 206 ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information )) 207 208 /* 209 * _Thread_Internal_free 210 * 211 */ 212 213 #define _Thread_Internal_free( _the_task ) \ 214 _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object ) 215 200 216 #endif 201 217 /* end of include file */ -
c/src/exec/score/src/mpci.c
r75f09e5 radf98bd 51 51 _MPCI_table = users_mpci_table; 52 52 53 if ( !_System_state_Is_multiprocessing ) 54 return; 55 56 /* 57 * Register the MP Process Packet routine. 58 */ 59 60 _MPCI_Register_packet_processor( 61 MP_PACKET_MPCI_INTERNAL, 62 _MPCI_Internal_packets_Process_packet 63 ); 64 65 /* 66 * Create the counting semaphore used by the MPCI Receive Server. 67 */ 68 53 69 attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 54 70 … … 68 84 NULL, 69 85 timeout_status 86 ); 87 } 88 89 /*PAGE 90 * 91 * _MPCI_Create_server 92 * 93 * This subprogram creates the MPCI receive server. 94 */ 95 96 char *_MPCI_Internal_name = "MPCI"; 97 98 void _MPCI_Create_server( void ) 99 { 100 101 if ( !_System_state_Is_multiprocessing ) 102 return; 103 104 /* 105 * Initialize the MPCI Receive Server 106 */ 107 108 _MPCI_Receive_server_tcb = _Thread_Internal_allocate(); 109 110 _Thread_Initialize( 111 &_Thread_Internal_information, 112 _MPCI_Receive_server_tcb, 113 NULL, /* allocate the stack */ 114 MPCI_RECEIVE_SERVER_STACK_SIZE, 115 CPU_ALL_TASKS_ARE_FP, 116 PRIORITY_MINIMUM, 117 FALSE, /* no preempt */ 118 FALSE, /* not timesliced */ 119 0, /* all interrupts enabled */ 120 _MPCI_Internal_name 121 ); 122 123 _Thread_Start( 124 _MPCI_Receive_server_tcb, 125 THREAD_START_NUMERIC, 126 _MPCI_Receive_server, 127 NULL, 128 0 70 129 ); 71 130 } … … 287 346 */ 288 347 289 void _MPCI_Receive_server( void ) 348 Thread _MPCI_Receive_server( 349 unsigned32 ignored 350 ) 290 351 { 291 352 … … 295 356 296 357 executing = _Thread_Executing; 297 _MPCI_Receive_server_tcb = executing;298 358 299 359 for ( ; ; ) { … … 343 403 } 344 404 405 /*PAGE 406 * 407 * _MPCI_Internal_packets_Send_process_packet 408 * 409 */ 410 411 void _MPCI_Internal_packets_Send_process_packet ( 412 MPCI_Internal_Remote_operations operation 413 ) 414 { 415 MPCI_Internal_packet *the_packet; 416 417 switch ( operation ) { 418 419 case MPCI_PACKETS_SYSTEM_VERIFY: 420 421 the_packet = _MPCI_Internal_packets_Get_packet(); 422 the_packet->Prefix.the_class = MP_PACKET_MPCI_INTERNAL; 423 the_packet->Prefix.length = sizeof ( MPCI_Internal_packet ); 424 the_packet->Prefix.to_convert = sizeof ( MPCI_Internal_packet ); 425 the_packet->operation = operation; 426 427 the_packet->maximum_nodes = _Objects_Maximum_nodes; 428 429 the_packet->maximum_global_objects = _Objects_MP_Maximum_global_objects; 430 431 _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix ); 432 break; 433 } 434 } 435 436 /*PAGE 437 * 438 * _MPCI_Internal_packets_Send_request_packet 439 * 440 * This subprogram is not needed since there are no request 441 * packets to be sent by this manager. 442 * 443 */ 444 445 /*PAGE 446 * 447 * _MPCI_Internal_packets_Send_response_packet 448 * 449 * This subprogram is not needed since there are no response 450 * packets to be sent by this manager. 451 * 452 */ 453 454 /*PAGE 455 * 456 * 457 * _MPCI_Internal_packets_Process_packet 458 * 459 */ 460 461 void _MPCI_Internal_packets_Process_packet ( 462 MP_packet_Prefix *the_packet_prefix 463 ) 464 { 465 MPCI_Internal_packet *the_packet; 466 unsigned32 maximum_nodes; 467 unsigned32 maximum_global_objects; 468 469 the_packet = (MPCI_Internal_packet *) the_packet_prefix; 470 471 switch ( the_packet->operation ) { 472 473 case MPCI_PACKETS_SYSTEM_VERIFY: 474 475 maximum_nodes = the_packet->maximum_nodes; 476 maximum_global_objects = the_packet->maximum_global_objects; 477 if ( maximum_nodes != _Objects_Maximum_nodes || 478 maximum_global_objects != _Objects_MP_Maximum_global_objects ) { 479 480 _MPCI_Return_packet( the_packet_prefix ); 481 482 _Internal_error_Occurred( 483 INTERNAL_ERROR_CORE, 484 TRUE, 485 INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION 486 ); 487 } 488 489 _MPCI_Return_packet( the_packet_prefix ); 490 491 break; 492 } 493 } 494 495 /*PAGE 496 * 497 * _MPCI_Internal_packets_Send_object_was_deleted 498 * 499 * This subprogram is not needed since there are no objects 500 * deleted by this manager. 501 * 502 */ 503 504 /*PAGE 505 * 506 * _MPCI_Internal_packets_Send_extract_proxy 507 * 508 * This subprogram is not needed since there are no objects 509 * deleted by this manager. 510 * 511 */ 512 513 /*PAGE 514 * 515 * _MPCI_Internal_packets_Get_packet 516 * 517 */ 518 519 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ) 520 { 521 return ( (MPCI_Internal_packet *) _MPCI_Get_packet() ); 522 } 523 345 524 /* end of file */ -
c/src/exec/score/src/thread.c
r75f09e5 radf98bd 41 41 */ 42 42 43 char *_Thread_Idle_name = "IDLE"; 44 43 45 void _Thread_Handler_initialization( 44 46 unsigned32 ticks_per_timeslice, … … 47 49 ) 48 50 { 49 unsigned32 index;51 unsigned32 index; 50 52 51 53 _Context_Switch_necessary = FALSE; … … 67 69 68 70 _Thread_MP_Handler_initialization( maximum_proxies ); 71 72 /* 73 * Initialize this class of objects. 74 */ 75 76 _Objects_Initialize_information( 77 &_Thread_Internal_information, 78 OBJECTS_INTERNAL_THREADS, 79 FALSE, 80 ( _System_state_Is_multiprocessing ) ? 2 : 1, 81 sizeof( Thread_Control ), 82 TRUE, 83 8, 84 TRUE 85 ); 86 87 } 88 89 /*PAGE 90 * 91 * _Thread_Create_idle 92 */ 93 94 void _Thread_Create_idle( void ) 95 { 96 Thread (*idle); 97 98 /* 99 * The entire workspace is zeroed during its initialization. Thus, all 100 * fields not explicitly assigned were explicitly zeroed by 101 * _Workspace_Initialization. 102 */ 103 104 _Thread_Idle = _Thread_Internal_allocate(); 105 106 /* 107 * Initialize the IDLE task. 108 */ 109 110 #if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE) 111 idle = _CPU_Thread_Idle_body; 112 #else 113 idle = _Thread_Idle_body; 114 #endif 115 116 if ( _CPU_Table.idle_task ) 117 idle = _CPU_Table.idle_task; 118 119 _Thread_Initialize( 120 &_Thread_Internal_information, 121 _Thread_Idle, 122 NULL, /* allocate the stack */ 123 THREAD_IDLE_STACK_SIZE, 124 CPU_IDLE_TASK_IS_FP, 125 PRIORITY_MAXIMUM, 126 TRUE, /* preemptable */ 127 FALSE, /* not timesliced */ 128 0, /* all interrupts enabled */ 129 _Thread_Idle_name 130 ); 131 132 /* 133 * WARNING!!! This is necessary to "kick" start the system and 134 * MUST be done before _Thread_Start is invoked. 135 */ 136 137 _Thread_Heir = 138 _Thread_Executing = _Thread_Idle; 139 140 _Thread_Start( 141 _Thread_Idle, 142 THREAD_START_NUMERIC, 143 idle, 144 NULL, 145 0 146 ); 147 69 148 } 70 149 … … 90 169 */ 91 170 92 void _Thread_Start_multitasking( 93 Thread_Control *system_thread, 94 Thread_Control *idle_thread 95 ) 171 void _Thread_Start_multitasking( void ) 96 172 { 97 173 /* … … 1069 1145 return (Thread_Control *) _Objects_Get( information, id, location ); 1070 1146 } 1147 1148 /*PAGE 1149 * 1150 * _Thread_Idle_body 1151 * 1152 * This kernel routine is the idle thread. The idle thread runs any time 1153 * no other thread is ready to run. This thread loops forever with 1154 * interrupts enabled. 1155 * 1156 * Input parameters: 1157 * ignored - this parameter is ignored 1158 * 1159 * Output parameters: NONE 1160 */ 1161 1162 #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) 1163 Thread _Thread_Idle_body( 1164 unsigned32 ignored 1165 ) 1166 { 1167 for( ; ; ) ; 1168 } 1071 1169 #endif 1170 1171 #endif -
cpukit/score/include/rtems/score/mpci.h
r75f09e5 radf98bd 29 29 #include <rtems/score/watchdog.h> 30 30 #include <rtems/score/coresem.h> 31 32 /* 33 * The following constants define the stack size requirements for 34 * the system threads. 35 */ 36 37 #define MPCI_RECEIVE_SERVER_STACK_SIZE \ 38 ( STACK_MINIMUM_SIZE + \ 39 CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \ 40 _CPU_Table.extra_mpci_receive_server_stack \ 41 ) 31 42 32 43 /* … … 93 104 94 105 /* 106 * The following enumerated type defines the list of 107 * internal MP operations. 108 */ 109 110 typedef enum { 111 MPCI_PACKETS_SYSTEM_VERIFY = 0 112 } MPCI_Internal_Remote_operations; 113 114 /* 115 * The following data structure defines the packet used to perform 116 * remote event operations. 117 */ 118 119 typedef struct { 120 MP_packet_Prefix Prefix; 121 MPCI_Internal_Remote_operations operation; 122 unsigned32 maximum_nodes; 123 unsigned32 maximum_global_objects; 124 } MPCI_Internal_packet; 125 126 /* 95 127 * This is the core semaphore which the MPCI Receive Server blocks on. 96 128 */ … … 136 168 unsigned32 timeout_status 137 169 ); 170 171 /* 172 * _MPCI_Create_server 173 * 174 * DESCRIPTION: 175 * 176 * This routine creates the packet receive server used in MP systems. 177 */ 178 179 void _MPCI_Create_server( void ); 138 180 139 181 /* … … 260 302 */ 261 303 262 void _MPCI_Receive_server( void ); 304 Thread _MPCI_Receive_server( 305 unsigned32 ignored 306 ); 263 307 264 308 /*PAGE … … 272 316 273 317 void _MPCI_Announce ( void ); 318 319 /* 320 * _MPCI_Internal_packets_Send_process_packet 321 * 322 * DESCRIPTION: 323 * 324 * This routine performs a remote procedure call so that a 325 * process operation can be performed on another node. 326 */ 327 328 void _MPCI_Internal_packets_Send_process_packet ( 329 MPCI_Internal_Remote_operations operation 330 ); 331 332 /* 333 * _MPCI_Internal_packets_Send_request_packet 334 * 335 * DESCRIPTION: 336 * 337 * This routine performs a remote procedure call so that a 338 * directive operation can be initiated on another node. 339 * 340 * This routine is not needed since there are no request 341 * packets to be sent by this manager. 342 */ 343 344 /* 345 * _MPCI_Internal_packets_Send_response_packet 346 * 347 * DESCRIPTION: 348 * 349 * This routine performs a remote procedure call so that a 350 * directive can be performed on another node. 351 * 352 * This routine is not needed since there are no response 353 * packets to be sent by this manager. 354 */ 355 356 /* 357 * 358 * _MPCI_Internal_packets_Process_packet 359 * 360 * DESCRIPTION: 361 * 362 * This routine performs the actions specific to this package for 363 * the request from another node. 364 */ 365 366 void _MPCI_Internal_packets_Process_packet ( 367 MP_packet_Prefix *the_packet_prefix 368 ); 369 370 /* 371 * _MPCI_Internal_packets_Send_object_was_deleted 372 * 373 * DESCRIPTION: 374 * 375 * This routine is invoked indirectly by the thread queue 376 * when a proxy has been removed from the thread queue and 377 * the remote node must be informed of this. 378 * 379 * This routine is not needed since there are no objects 380 * deleted by this manager. 381 */ 382 383 /* 384 * _MPCI_Internal_packets_Send_extract_proxy 385 * 386 * DESCRIPTION: 387 * 388 * This routine is invoked when a task is deleted and it 389 * has a proxy which must be removed from a thread queue and 390 * the remote node must be informed of this. 391 * 392 * This routine is not needed since there are no objects 393 * deleted by this manager. 394 */ 395 396 /* 397 * _MPCI_Internal_packets_Get_packet 398 * 399 * DESCRIPTION: 400 * 401 * This routine is used to obtain a internal threads mp packet. 402 */ 403 404 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ); 274 405 275 406 #ifdef __cplusplus -
cpukit/score/include/rtems/score/mppkt.h
r75f09e5 radf98bd 39 39 40 40 typedef enum { 41 MP_PACKET_ INTERNAL_THREADS= 0,41 MP_PACKET_MPCI_INTERNAL = 0, 42 42 MP_PACKET_TASKS = 1, 43 43 MP_PACKET_MESSAGE_QUEUE = 2, … … 49 49 } MP_packet_Classes; 50 50 51 #define MP_PACKET_CLASSES_FIRST MP_PACKET_ INTERNAL_THREADS51 #define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL 52 52 #define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL 53 53 -
cpukit/score/include/rtems/score/object.h
r75f09e5 radf98bd 101 101 #define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS 102 102 #define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES 103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_ INTERNAL_THREADS103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_MPCI_PACKETS 104 104 #define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS 105 105 -
cpukit/score/include/rtems/score/sysstate.h
r75f09e5 radf98bd 32 32 SYSTEM_STATE_BEFORE_INITIALIZATION, /* start -> end of 1st init part */ 33 33 SYSTEM_STATE_BEFORE_MULTITASKING, /* end of 1st -> beginning of 2nd */ 34 SYSTEM_STATE_BEGIN_MULTITASKING, /* beginning of 2nd -> end of SYSI*/34 SYSTEM_STATE_BEGIN_MULTITASKING, /* just before multitasking starts */ 35 35 SYSTEM_STATE_UP, /* normal operation */ 36 36 SYSTEM_STATE_FAILED /* fatal error occurred */ -
cpukit/score/include/rtems/score/thread.h
r75f09e5 radf98bd 162 162 163 163 /* 164 * The following constants define the stack size requirements for 165 * the idle thread. 166 */ 167 168 169 #define THREAD_IDLE_STACK_SIZE STACK_MINIMUM_SIZE 170 171 /* 172 * The following defines the information control block used to 173 * manage this class of objects. 174 */ 175 176 EXTERN Objects_Information _Thread_Internal_information; 177 178 /* 179 * The following define the thread control pointers used to access 180 * and manipulate the idle thread. 181 */ 182 183 EXTERN Thread_Control *_Thread_Idle; 184 185 /* 164 186 * The following context area contains the context of the "thread" 165 187 * which invoked the start multitasking routine. This context is … … 237 259 unsigned32 maximum_proxies 238 260 ); 261 262 /* 263 * _Thread_Create_idle 264 * 265 * DESCRIPTION: 266 * 267 * This routine creates the idle thread. 268 * 269 * WARNING!! No thread should be created before this one. 270 */ 271 272 void _Thread_Create_idle( void ); 239 273 240 274 /* … … 757 791 ); 758 792 793 /* 794 * _Thread_Internal_allocate 795 * 796 * DESCRIPTION: 797 * 798 * This routine allocates an internal thread. 799 */ 800 801 STATIC INLINE Thread_Control *_Thread_Internal_allocate( void ); 802 803 /* 804 * _Thread_Internal_free 805 * 806 * DESCRIPTION: 807 * 808 * This routine frees an internal thread. 809 */ 810 811 STATIC INLINE void _Thread_Internal_free ( 812 Thread_Control *the_task 813 ); 814 815 /* 816 * _Thread_Idle_body 817 * 818 * DESCRIPTION: 819 * 820 * This routine is the body of the system idle thread. 821 */ 822 823 #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) 824 Thread _Thread_Idle_body( 825 unsigned32 ignored 826 ); 827 #endif 828 759 829 #include <rtems/score/thread.inl> 760 830 #include <rtems/score/threadmp.h> -
cpukit/score/inline/rtems/score/thread.inl
r75f09e5 radf98bd 284 284 } 285 285 286 /*PAGE 287 * 288 * _Thread_Internal_allocate 289 * 290 */ 291 292 STATIC INLINE Thread_Control *_Thread_Internal_allocate( void ) 293 { 294 return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ); 295 } 296 297 /*PAGE 298 * 299 * _Thread_Internal_free 300 * 301 */ 302 303 STATIC INLINE void _Thread_Internal_free ( 304 Thread_Control *the_task 305 ) 306 { 307 _Objects_Free( &_Thread_Internal_information, &the_task->Object ); 308 } 309 286 310 #endif 287 311 /* end of include file */ -
cpukit/score/macros/rtems/score/thread.inl
r75f09e5 radf98bd 198 198 ( (_code) == THREAD_STATUS_PROXY_BLOCKING ) 199 199 200 /* 201 * _Thread_Internal_allocate 202 * 203 */ 204 205 #define _Thread_Internal_allocate() \ 206 ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information )) 207 208 /* 209 * _Thread_Internal_free 210 * 211 */ 212 213 #define _Thread_Internal_free( _the_task ) \ 214 _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object ) 215 200 216 #endif 201 217 /* end of include file */ -
cpukit/score/src/mpci.c
r75f09e5 radf98bd 51 51 _MPCI_table = users_mpci_table; 52 52 53 if ( !_System_state_Is_multiprocessing ) 54 return; 55 56 /* 57 * Register the MP Process Packet routine. 58 */ 59 60 _MPCI_Register_packet_processor( 61 MP_PACKET_MPCI_INTERNAL, 62 _MPCI_Internal_packets_Process_packet 63 ); 64 65 /* 66 * Create the counting semaphore used by the MPCI Receive Server. 67 */ 68 53 69 attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 54 70 … … 68 84 NULL, 69 85 timeout_status 86 ); 87 } 88 89 /*PAGE 90 * 91 * _MPCI_Create_server 92 * 93 * This subprogram creates the MPCI receive server. 94 */ 95 96 char *_MPCI_Internal_name = "MPCI"; 97 98 void _MPCI_Create_server( void ) 99 { 100 101 if ( !_System_state_Is_multiprocessing ) 102 return; 103 104 /* 105 * Initialize the MPCI Receive Server 106 */ 107 108 _MPCI_Receive_server_tcb = _Thread_Internal_allocate(); 109 110 _Thread_Initialize( 111 &_Thread_Internal_information, 112 _MPCI_Receive_server_tcb, 113 NULL, /* allocate the stack */ 114 MPCI_RECEIVE_SERVER_STACK_SIZE, 115 CPU_ALL_TASKS_ARE_FP, 116 PRIORITY_MINIMUM, 117 FALSE, /* no preempt */ 118 FALSE, /* not timesliced */ 119 0, /* all interrupts enabled */ 120 _MPCI_Internal_name 121 ); 122 123 _Thread_Start( 124 _MPCI_Receive_server_tcb, 125 THREAD_START_NUMERIC, 126 _MPCI_Receive_server, 127 NULL, 128 0 70 129 ); 71 130 } … … 287 346 */ 288 347 289 void _MPCI_Receive_server( void ) 348 Thread _MPCI_Receive_server( 349 unsigned32 ignored 350 ) 290 351 { 291 352 … … 295 356 296 357 executing = _Thread_Executing; 297 _MPCI_Receive_server_tcb = executing;298 358 299 359 for ( ; ; ) { … … 343 403 } 344 404 405 /*PAGE 406 * 407 * _MPCI_Internal_packets_Send_process_packet 408 * 409 */ 410 411 void _MPCI_Internal_packets_Send_process_packet ( 412 MPCI_Internal_Remote_operations operation 413 ) 414 { 415 MPCI_Internal_packet *the_packet; 416 417 switch ( operation ) { 418 419 case MPCI_PACKETS_SYSTEM_VERIFY: 420 421 the_packet = _MPCI_Internal_packets_Get_packet(); 422 the_packet->Prefix.the_class = MP_PACKET_MPCI_INTERNAL; 423 the_packet->Prefix.length = sizeof ( MPCI_Internal_packet ); 424 the_packet->Prefix.to_convert = sizeof ( MPCI_Internal_packet ); 425 the_packet->operation = operation; 426 427 the_packet->maximum_nodes = _Objects_Maximum_nodes; 428 429 the_packet->maximum_global_objects = _Objects_MP_Maximum_global_objects; 430 431 _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix ); 432 break; 433 } 434 } 435 436 /*PAGE 437 * 438 * _MPCI_Internal_packets_Send_request_packet 439 * 440 * This subprogram is not needed since there are no request 441 * packets to be sent by this manager. 442 * 443 */ 444 445 /*PAGE 446 * 447 * _MPCI_Internal_packets_Send_response_packet 448 * 449 * This subprogram is not needed since there are no response 450 * packets to be sent by this manager. 451 * 452 */ 453 454 /*PAGE 455 * 456 * 457 * _MPCI_Internal_packets_Process_packet 458 * 459 */ 460 461 void _MPCI_Internal_packets_Process_packet ( 462 MP_packet_Prefix *the_packet_prefix 463 ) 464 { 465 MPCI_Internal_packet *the_packet; 466 unsigned32 maximum_nodes; 467 unsigned32 maximum_global_objects; 468 469 the_packet = (MPCI_Internal_packet *) the_packet_prefix; 470 471 switch ( the_packet->operation ) { 472 473 case MPCI_PACKETS_SYSTEM_VERIFY: 474 475 maximum_nodes = the_packet->maximum_nodes; 476 maximum_global_objects = the_packet->maximum_global_objects; 477 if ( maximum_nodes != _Objects_Maximum_nodes || 478 maximum_global_objects != _Objects_MP_Maximum_global_objects ) { 479 480 _MPCI_Return_packet( the_packet_prefix ); 481 482 _Internal_error_Occurred( 483 INTERNAL_ERROR_CORE, 484 TRUE, 485 INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION 486 ); 487 } 488 489 _MPCI_Return_packet( the_packet_prefix ); 490 491 break; 492 } 493 } 494 495 /*PAGE 496 * 497 * _MPCI_Internal_packets_Send_object_was_deleted 498 * 499 * This subprogram is not needed since there are no objects 500 * deleted by this manager. 501 * 502 */ 503 504 /*PAGE 505 * 506 * _MPCI_Internal_packets_Send_extract_proxy 507 * 508 * This subprogram is not needed since there are no objects 509 * deleted by this manager. 510 * 511 */ 512 513 /*PAGE 514 * 515 * _MPCI_Internal_packets_Get_packet 516 * 517 */ 518 519 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ) 520 { 521 return ( (MPCI_Internal_packet *) _MPCI_Get_packet() ); 522 } 523 345 524 /* end of file */ -
cpukit/score/src/thread.c
r75f09e5 radf98bd 41 41 */ 42 42 43 char *_Thread_Idle_name = "IDLE"; 44 43 45 void _Thread_Handler_initialization( 44 46 unsigned32 ticks_per_timeslice, … … 47 49 ) 48 50 { 49 unsigned32 index;51 unsigned32 index; 50 52 51 53 _Context_Switch_necessary = FALSE; … … 67 69 68 70 _Thread_MP_Handler_initialization( maximum_proxies ); 71 72 /* 73 * Initialize this class of objects. 74 */ 75 76 _Objects_Initialize_information( 77 &_Thread_Internal_information, 78 OBJECTS_INTERNAL_THREADS, 79 FALSE, 80 ( _System_state_Is_multiprocessing ) ? 2 : 1, 81 sizeof( Thread_Control ), 82 TRUE, 83 8, 84 TRUE 85 ); 86 87 } 88 89 /*PAGE 90 * 91 * _Thread_Create_idle 92 */ 93 94 void _Thread_Create_idle( void ) 95 { 96 Thread (*idle); 97 98 /* 99 * The entire workspace is zeroed during its initialization. Thus, all 100 * fields not explicitly assigned were explicitly zeroed by 101 * _Workspace_Initialization. 102 */ 103 104 _Thread_Idle = _Thread_Internal_allocate(); 105 106 /* 107 * Initialize the IDLE task. 108 */ 109 110 #if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE) 111 idle = _CPU_Thread_Idle_body; 112 #else 113 idle = _Thread_Idle_body; 114 #endif 115 116 if ( _CPU_Table.idle_task ) 117 idle = _CPU_Table.idle_task; 118 119 _Thread_Initialize( 120 &_Thread_Internal_information, 121 _Thread_Idle, 122 NULL, /* allocate the stack */ 123 THREAD_IDLE_STACK_SIZE, 124 CPU_IDLE_TASK_IS_FP, 125 PRIORITY_MAXIMUM, 126 TRUE, /* preemptable */ 127 FALSE, /* not timesliced */ 128 0, /* all interrupts enabled */ 129 _Thread_Idle_name 130 ); 131 132 /* 133 * WARNING!!! This is necessary to "kick" start the system and 134 * MUST be done before _Thread_Start is invoked. 135 */ 136 137 _Thread_Heir = 138 _Thread_Executing = _Thread_Idle; 139 140 _Thread_Start( 141 _Thread_Idle, 142 THREAD_START_NUMERIC, 143 idle, 144 NULL, 145 0 146 ); 147 69 148 } 70 149 … … 90 169 */ 91 170 92 void _Thread_Start_multitasking( 93 Thread_Control *system_thread, 94 Thread_Control *idle_thread 95 ) 171 void _Thread_Start_multitasking( void ) 96 172 { 97 173 /* … … 1069 1145 return (Thread_Control *) _Objects_Get( information, id, location ); 1070 1146 } 1147 1148 /*PAGE 1149 * 1150 * _Thread_Idle_body 1151 * 1152 * This kernel routine is the idle thread. The idle thread runs any time 1153 * no other thread is ready to run. This thread loops forever with 1154 * interrupts enabled. 1155 * 1156 * Input parameters: 1157 * ignored - this parameter is ignored 1158 * 1159 * Output parameters: NONE 1160 */ 1161 1162 #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) 1163 Thread _Thread_Idle_body( 1164 unsigned32 ignored 1165 ) 1166 { 1167 for( ; ; ) ; 1168 } 1071 1169 #endif 1170 1171 #endif
Note: See TracChangeset
for help on using the changeset viewer.