Changeset eb02f47 in rtems
- Timestamp:
- 11/10/99 13:48:27 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 442d0478
- Parents:
- dcc1f6b6
- Files:
-
- 6 added
- 1 deleted
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/itron/include/itronsys/types.h
rdcc1f6b6 reb02f47 20 20 */ 21 21 22 #if 023 22 typedef signed8 B; /* signed 8-bit integer */ 24 23 typedef signed16 H; /* signed 16-bit integer */ … … 27 26 typedef unsigned16 UH; /* unsigned 16-bit integer */ 28 27 typedef unsigned32 UW; /* unsigned 32-bit integer */ 29 #endif30 28 31 29 typedef unsigned32 VW; /* unpredictable data type (32-bit size) */ -
c/src/exec/itron/include/rtems/itron/object.h
rdcc1f6b6 reb02f47 81 81 (((_id) < -4) ? E_OACV : /* attempt to access a "system object" */ \ 82 82 ((_id) <= 0) ? E_ID : /* bogus index of 0 - -3 */ \ 83 ((_id) <= (_the_information)->maximum) ? E_ OBJ : /* object is in use*/ \83 ((_id) <= (_the_information)->maximum) ? E_NOEXS : /* does not exist */ \ 84 84 E_ID) /* simply a bad id */ 85 85 -
c/src/exec/itron/include/rtems/itron/task.h
rdcc1f6b6 reb02f47 78 78 ); 79 79 80 /* XXX remove the need for this. Enable dispatch should not be hidden */ 81 82 #define _ITRON_return_errorno( _errno ) \ 83 do { \ 84 _Thread_Enable_dispatch(); \ 85 return _errno; \ 86 } while (0); 87 88 89 #ifndef __RTEMS_APPLICATION__ 80 90 #include <rtems/itron/task.inl> 91 #endif 81 92 82 93 #ifdef __cplusplus -
c/src/exec/itron/inline/rtems/itron/task.inl
rdcc1f6b6 reb02f47 110 110 Objects_Locations *location 111 111 ) 112 { 112 { 113 if ( id == 0 ) { 114 _Thread_Disable_dispatch(); 115 *location = OBJECTS_LOCAL; 116 return _Thread_Executing; 117 } 118 113 119 return (Thread_Control *) 114 120 _ITRON_Objects_Get( &_ITRON_Task_Information, id, location ); … … 145 151 */ 146 152 147 RTEMS_INLINE_ROUTINE Priority_Control_ITRON_Task_Priority_to_Core(148 PRI _priority153 RTEMS_INLINE_ROUTINE _ITRON_Task_Priority_to_Core( 154 PRI ITRON_priority 149 155 ) 150 156 { 151 return ( (Priority_Control) (_priority));157 return (Priority_Control) ITRON_priority; 152 158 } 159 160 /*PAGE 161 * 162 * _ITRON_tasks_Core_to_Priority 163 */ 164 165 RTEMS_INLINE_ROUTINE _ITRON_Task_Core_to_Priority( 166 Priority_Control core_priority 167 ) 168 { 169 return (PRI) core_priority; 170 } 171 153 172 154 173 #ifdef __cplusplus … … 158 177 #endif 159 178 /* end of include file */ 160 -
c/src/exec/itron/src/can_wup.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 if (!the_thread) 33 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 34 35 switch ( location ) { 36 case OBJECTS_REMOTE: 37 case OBJECTS_ERROR: 38 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 39 40 case OBJECTS_LOCAL: 41 /* 42 * XXX - FILL ME IN. 43 */ 44 return E_OK; 45 } 46 47 return E_OBJ; /* XXX - Should never get here */ 29 48 } 30 49 -
c/src/exec/itron/src/chg_pri.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 Priority_Control new_priority; 31 32 the_thread = _ITRON_Task_Get( tskid, &location ); 33 if (!the_thread) 34 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 35 36 if (_States_Is_dormant( the_thread->current_state )) 37 return -1; 38 39 if (( tskpri <= 0 ) || ( tskpri >= 256 )) 40 _ITRON_return_errorno( E_PAR ); 41 42 switch ( location ) { 43 case OBJECTS_REMOTE: 44 case OBJECTS_ERROR: 45 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid )); 46 47 case OBJECTS_LOCAL: 48 new_priority = _ITRON_Task_Priority_to_Core( tskpri ); 49 the_thread->real_priority = new_priority; 50 51 /* 52 * XXX This is from the rtems side and I'm not sure what this is for. 53 * XXX Is this check right or should change priority be called 54 * regardless? 55 */ 56 57 if ( the_thread->resource_count == 0 || 58 the_thread->current_priority > new_priority ) 59 _Thread_Change_priority( the_thread, new_priority, FALSE ); 60 61 _Thread_Enable_dispatch(); 62 return E_OK; 63 } 64 65 return E_OBJ; /* XXX - Should never get here */ 29 66 } 30 67 68 -
c/src/exec/itron/src/cre_tsk.c
rdcc1f6b6 reb02f47 22 22 */ 23 23 24 /*25 * XXX - How do I return these errors ??? Do I have to validate the ID26 prior to calling the ID routine ??27 E_NOMEM Insufficient memory (Memory for control block and/or user stack28 cannot be allocated)29 E_ID Invalid ID Number (tskid was invalid or could not be used)30 E_RSATR Reserved attribute (tskatr was invalid or could not be used)31 E_OBJ Invalid object state (a task of the same ID already exists)32 E_OACV Object access violation (A tskid less than -4 was specified from33 a user task. This is implementation dependent.)34 E_PAR Parameter error (pk_ctsk, task, itskpri and/or stksz is invalid)35 EN_OBJNO An object number which could not be accessed on the target node36 is specified.37 EN_CTXID Specified an object on another node when the system call was38 issued from a task in dispatch disabled state or from a task-39 independent portion40 EN_PAR A value outside the range supported by the target node and/or41 transmission packet format was specified as a parameter (a value42 outside supported range was specified for exinf, tskatr, task,43 itskpri and/or stksz)44 */45 46 24 ER cre_tsk( 47 25 ID tskid, … … 61 39 62 40 /* 41 * Validate Parameters. 42 */ 43 44 if ( pk_ctsk == NULL ) 45 _ITRON_return_errorno( E_PAR ); 46 47 if ((pk_ctsk->tskatr != TA_ASM ) && 48 (pk_ctsk->tskatr != TA_HLNG) && 49 (pk_ctsk->tskatr != TA_COP0) && 50 (pk_ctsk->tskatr != TA_COP1) && 51 (pk_ctsk->tskatr != TA_COP2) && 52 (pk_ctsk->tskatr != TA_COP3) && 53 (pk_ctsk->tskatr != TA_COP4) && 54 (pk_ctsk->tskatr != TA_COP5) && 55 (pk_ctsk->tskatr != TA_COP6) && 56 (pk_ctsk->tskatr != TA_COP7)) 57 _ITRON_return_errorno( E_RSATR ); 58 59 if (( pk_ctsk->itskpri <= 0 ) || ( pk_ctsk->itskpri >= 256 )) 60 if ( pk_ctsk->itskpri <= 0 ) 61 _ITRON_return_errorno( E_PAR ); 62 if ( pk_ctsk->task == NULL ) 63 _ITRON_return_errorno( E_PAR ); 64 if ( pk_ctsk->stksz < 0 ) 65 _ITRON_return_errorno( E_PAR ); 66 67 /* 63 68 * allocate the thread. 64 69 */ 65 70 66 71 the_thread = _ITRON_Task_Allocate( tskid ); 67 if ( !the_thread ) { 68 ena_dsp(); 69 return _ITRON_Task_Clarify_allocation_id_error( tskid ); 70 } 71 72 /* 73 * XXX - FIX THE VARIABLES TO THE CORRECT VALUES!!! 74 */ 72 if ( !the_thread ) 73 _ITRON_return_errorno( _ITRON_Task_Clarify_allocation_id_error( tskid ) ); 75 74 76 75 /* … … 84 83 NULL, 85 84 pk_ctsk->stksz, 86 TRUE, /* XXX - All tasks FP ???*/85 TRUE, /* XXX - All tasks FP for now */ 87 86 core_priority, 88 87 TRUE, … … 95 94 if ( !status ) { 96 95 _ITRON_Task_Free( the_thread ); 97 _Thread_Enable_dispatch(); 98 return -1; 99 #if (0) 100 /* XXX */ 101 #endif 96 _ITRON_return_errorno( E_NOMEM ); 102 97 } 103 104 #if (0) /* XXX We have any thing else to set per API structure? */105 api = the_thread->API_Extensions[ THREAD_API_ITRON ];106 asr = &api->Signal;107 108 asr->is_enabled = FALSE;109 110 *id = the_thread->Object.id;111 #endif112 98 113 99 /* … … 126 112 } 127 113 114 115 116 -
c/src/exec/itron/src/del_tsk.c
rdcc1f6b6 reb02f47 30 30 ER result; 31 31 32 /* XXX - Fix Documentation and error checking for this error on self */32 the_thread = _ITRON_Task_Get( tskid, &location ); 33 33 34 the_thread = _ITRON_Task_Get( tskid, &location ); 35 _Thread_Disable_dispatch(); 34 if (!the_thread) 35 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 36 37 if ( the_thread == _Thread_Executing ) 38 _ITRON_return_errorno( E_OBJ ); 39 40 if ( !_States_Is_dormant( the_thread->current_state ) ) 41 _ITRON_return_errorno( E_OBJ ); 36 42 37 43 switch ( location ) { 38 44 case OBJECTS_REMOTE: 39 45 case OBJECTS_ERROR: 40 _Thread_Enable_dispatch(); 41 return _ITRON_Task_Clarify_get_id_error( tskid ); 46 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 42 47 43 48 case OBJECTS_LOCAL: -
c/src/exec/itron/src/exd_tsk.c
rdcc1f6b6 reb02f47 26 26 Objects_Information *the_information; 27 27 28 _Thread_Disable_dispatch(); 29 28 30 the_information = _Objects_Get_information( _Thread_Executing->Object.id ); 29 31 30 32 /* This should never happen if _Thread_Get() works right */ 31 33 assert( the_information ); 32 33 _Thread_Disable_dispatch();34 34 35 35 _Thread_Set_state( _Thread_Executing, STATES_DORMANT ); -
c/src/exec/itron/src/ext_tsk.c
rdcc1f6b6 reb02f47 24 24 void ext_tsk( void ) 25 25 { 26 _Thread_Disable_dispatch(); 27 28 _Thread_Restart( _Thread_Executing, NULL, 0 ); 26 29 _Thread_Set_state( _Thread_Executing, STATES_DORMANT ); 30 31 _Thread_Enable_dispatch(); 27 32 } -
c/src/exec/itron/src/frsm_tsk.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 if (!the_thread) 33 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 34 35 if ( the_thread == _Thread_Executing ) 36 _ITRON_return_errorno( E_OBJ ); 37 38 if (_States_Is_dormant( the_thread->current_state )) 39 _ITRON_return_errorno( E_OBJ ); 40 41 switch ( location ) { 42 case OBJECTS_REMOTE: 43 case OBJECTS_ERROR: 44 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 45 46 case OBJECTS_LOCAL: 47 _Thread_Resume( the_thread, TRUE ); 48 _Thread_Enable_dispatch(); 49 return E_OK; 50 } 51 52 return E_OBJ; /* XXX - Should never get here */ 53 29 54 } 30 55 -
c/src/exec/itron/src/get_tid.c
rdcc1f6b6 reb02f47 25 25 ) 26 26 { 27 /* 28 * This does not support multiprocessing. The id handling will have 29 * to be enhanced to support multiprocessing. 30 */ 31 32 *p_tskid = _Objects_Get_index( _Thread_Executing->Object.id ); 27 33 return E_OK; 28 34 } -
c/src/exec/itron/src/ref_tsk.c
rdcc1f6b6 reb02f47 27 27 ) 28 28 { 29 return E_OK; 29 register Thread_Control *the_thread; 30 Objects_Locations location; 31 Priority_Control core_priority; 32 33 the_thread = _ITRON_Task_Get( tskid, &location ); 34 if (!the_thread) 35 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 36 37 if (!pk_rtsk) 38 _ITRON_return_errorno( E_PAR ); 39 40 /* 41 * The following are extended functions [level X ]. 42 * XXX - tskwait, wid, wupcnt, and tskatr are presently not implemented. 43 */ 44 45 pk_rtsk->tskwait = 0; 46 pk_rtsk->wid = 0; 47 pk_rtsk->wupcnt = 0; 48 pk_rtsk->suscnt = the_thread->suspend_count; 49 pk_rtsk->tskatr = 0; 50 pk_rtsk->task = the_thread->Start.entry_point; 51 core_priority = the_thread->Start.initial_priority; 52 pk_rtsk->itskpri = _ITRON_Task_Core_to_Priority( core_priority ); 53 pk_rtsk->stksz = the_thread->Start.Initial_stack.size; 54 55 /* 56 * The following are required. 57 */ 58 59 pk_rtsk->exinf = NULL; /* extended information */ 60 pk_rtsk->tskpri = _ITRON_Task_Core_to_Priority(the_thread->current_priority); 61 pk_rtsk->tskstat = 0; 62 63 /* 64 * Mask in the tskstat information 65 * Convert the task state XXX double check this 66 */ 67 68 if ( the_thread == _Thread_Executing ) 69 pk_rtsk->tskstat |= TTS_RUN; 70 if ((the_thread->current_state & STATES_READY) != 0) 71 pk_rtsk->tskstat = TTS_RDY; 72 if (_States_Is_dormant( the_thread->current_state )) 73 pk_rtsk->tskstat = TTS_DMT; 74 if ((the_thread->current_state & STATES_SUSPENDED) != 0) 75 pk_rtsk->tskstat = TTS_SUS; 76 if ((the_thread->current_state & STATES_BLOCKED) != 0) 77 pk_rtsk->tskstat = TTS_WAI; 78 79 return E_OK; /* XXX - Should never get here */ 30 80 } 31 81 82 83 84 -
c/src/exec/itron/src/rel_wai.c
rdcc1f6b6 reb02f47 25 25 ) 26 26 { 27 return E_OK; 27 register Thread_Control *the_thread; 28 Objects_Locations location; 29 30 the_thread = _ITRON_Task_Get( tskid, &location ); 31 if (!the_thread) 32 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 33 34 _Thread_Disable_dispatch(); 35 36 switch ( location ) { 37 case OBJECTS_REMOTE: 38 case OBJECTS_ERROR: 39 _Thread_Enable_dispatch(); 40 return _ITRON_Task_Clarify_get_id_error( tskid ); 41 42 case OBJECTS_LOCAL: 43 /* 44 * XXX - FILL ME IN. 45 */ 46 return E_OK; 47 } 48 49 return E_OBJ; /* XXX - Should never get here */ 28 50 } 29 51 30 52 53 -
c/src/exec/itron/src/rot_rdq.c
rdcc1f6b6 reb02f47 25 25 ) 26 26 { 27 PRI priority; 28 29 30 _Thread_Disable_dispatch(); 31 32 /* 33 * Yield of processor will rotate the queue for this processor. 34 */ 35 36 if (( tskpri <= 0 ) || ( tskpri >= 256 )) 37 _ITRON_return_errorno( E_PAR ); 38 39 priority = _ITRON_Task_Core_to_Priority(_Thread_Executing->current_priority); 40 if ( priority == tskpri ) 41 _Thread_Yield_processor(); 42 else { 43 _Thread_Rotate_Ready_Queue( _ITRON_Task_Core_to_Priority( tskpri ) ); 44 } 45 _Thread_Enable_dispatch(); 46 27 47 return E_OK; 28 48 } -
c/src/exec/itron/src/rsm_tsk.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 33 if (!the_thread) 34 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 35 36 if ( the_thread == _Thread_Executing ) 37 _ITRON_return_errorno( E_OBJ ); 38 39 if (_States_Is_dormant( the_thread->current_state )) 40 _ITRON_return_errorno( E_OBJ ); 41 42 switch ( location ) { 43 case OBJECTS_REMOTE: 44 case OBJECTS_ERROR: 45 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 46 47 case OBJECTS_LOCAL: 48 _Thread_Resume( the_thread, FALSE ); 49 _Thread_Enable_dispatch(); 50 return E_OK; 51 } 52 53 return E_OBJ; /* XXX - Should never get here */ 29 54 } 30 55 -
c/src/exec/itron/src/slp_tsk.c
rdcc1f6b6 reb02f47 20 20 21 21 /* 22 * slp_tsk - Sleep Task Sleep Task with Timeout22 * slp_tsk - Sleep Task 23 23 */ 24 24 -
c/src/exec/itron/src/sta_tsk.c
rdcc1f6b6 reb02f47 22 22 */ 23 23 24 /*25 * XXX - How Do I know when these happen ???26 E_NOEXS Object does not exist (the task specified by tskid does not exist)27 E_OACV Object access violation (A tskid less than -4 was specified from28 a user task. This is implementation dependent.)29 E_OBJ Invalid object state (the target task is not in DORMANT state)30 EN_OBJNO An object number which could not be accessed on the target node31 is specified. XXX Should never get on a single processor??32 EN_CTXID Specified an object on another node when the system call was33 issued from a task in dispatch disabled state or from a task-34 independent portionXXX Should never get on a single processor??35 EN_PAR A value outside the range supported by the target node and/or36 transmission packet format was specified as a parameter (a value37 outside supported range was specified for stacd)38 XXX- What does _ITRON_Task_Get return on an invalid id and how do you know39 if it is E_ID, E_NOEXS, E_OACV40 */41 42 24 ER sta_tsk( 43 25 ID tskid, … … 50 32 51 33 the_thread = _ITRON_Task_Get( tskid, &location ); 34 if (!the_thread) 35 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 36 37 if ( !_States_Is_dormant( the_thread->current_state ) ) 38 _ITRON_return_errorno( E_OBJ ); 39 52 40 switch ( location ) { 53 41 case OBJECTS_REMOTE: 54 42 case OBJECTS_ERROR: 55 return E_ID; /* XXX */43 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 56 44 57 45 case OBJECTS_LOCAL: … … 64 52 ); 65 53 66 /* 67 * Wrong state XXX 68 */ 69 70 if ( !status ) { 71 _Thread_Enable_dispatch(); 72 return E_OBJ; 73 } 54 if ( !status ) 55 _ITRON_return_errorno( E_OBJ ); 74 56 75 57 _Thread_Enable_dispatch(); -
c/src/exec/itron/src/sus_tsk.c
rdcc1f6b6 reb02f47 30 30 ) 31 31 { 32 return E_OK; 32 register Thread_Control *the_thread; 33 Objects_Locations location; 34 35 the_thread = _ITRON_Task_Get( tskid, &location ); 36 if (!the_thread) 37 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 38 39 if ( the_thread == _Thread_Executing ) 40 _ITRON_return_errorno( E_OBJ ); 41 42 switch ( location ) { 43 case OBJECTS_REMOTE: 44 case OBJECTS_ERROR: 45 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 46 47 case OBJECTS_LOCAL: 48 _Thread_Suspend( the_thread ); 49 _Thread_Enable_dispatch(); 50 return E_OK; 51 } 52 53 return E_OBJ; /* XXX - Should never get here */ 33 54 } 34 55 56 57 58 59 60 61 -
c/src/exec/itron/src/task.c
rdcc1f6b6 reb02f47 118 118 119 119 the_information = _Objects_Get_information( the_thread->Object.id ); 120 121 120 if ( !the_information ) { 122 return -1; /* XXX */ 123 /* This should never happen if _Thread_Get() works right */ 121 return E_OBJ; /* XXX - should never happen */ 124 122 } 125 123 -
c/src/exec/itron/src/ter_tsk.c
rdcc1f6b6 reb02f47 19 19 20 20 /* 21 * ter_tsk - Terminate Other Task 21 * ter_tsk - Terminate Other Task - Set State to DORMANT 22 22 */ 23 23 … … 26 26 ) 27 27 { 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 33 if ( !the_thread ) 34 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 35 36 if ( the_thread == _Thread_Executing ) 37 _ITRON_return_errorno( E_OBJ ); 38 39 if ( _States_Is_dormant( the_thread->current_state ) ) 40 _ITRON_return_errorno( E_OBJ ); 41 42 _Thread_Restart( the_thread, NULL, 0 ); 43 _Thread_Set_state( the_thread, STATES_DORMANT ); 44 45 _Thread_Enable_dispatch(); 28 46 return E_OK; 29 47 } 30 48 49 50 51 52 53 54 -
c/src/exec/rtems/src/taskresume.c
rdcc1f6b6 reb02f47 71 71 case OBJECTS_LOCAL: 72 72 if ( _States_Is_suspended( the_thread->current_state ) ) { 73 _Thread_Resume( the_thread );73 _Thread_Resume( the_thread, TRUE ); 74 74 _Thread_Enable_dispatch(); 75 75 return RTEMS_SUCCESSFUL; -
c/src/exec/rtems/src/tasksuspend.c
rdcc1f6b6 reb02f47 72 72 case OBJECTS_LOCAL: 73 73 if ( !_States_Is_suspended( the_thread->current_state ) ) { 74 _Thread_S et_state( the_thread, STATES_SUSPENDED);74 _Thread_Suspend( the_thread ); 75 75 _Thread_Enable_dispatch(); 76 76 return RTEMS_SUCCESSFUL; -
c/src/exec/score/include/rtems/score/Makefile.in
rdcc1f6b6 reb02f47 11 11 RTEMS_ROOT = @RTEMS_ROOT@ 12 12 PROJECT_ROOT = @PROJECT_ROOT@ 13 14 HAS_ITRON_API = @HAS_ITRON_API@ 13 15 14 16 VPATH = @srcdir@ … … 94 96 echo "#define RTEMS_POSIX_API 1" >>$@; \ 95 97 fi 96 echo "SHOULD BE HAS_ITRON_API not RTEMS_HAS_ITRON_API XXX " 97 @if test "$(RTEMS_HAS_ITRON_API)" = "yes"; then \ 98 @if test "$(HAS_ITRON_API)" = "yes"; then \ 98 99 echo "#define RTEMS_ITRON_API 1" >>$@; \ 99 100 fi -
c/src/exec/score/include/rtems/score/thread.h
rdcc1f6b6 reb02f47 186 186 #endif 187 187 /****************** end of common block ********************/ 188 unsigned32 suspend_count; 188 189 boolean is_global; 189 190 boolean do_post_task_switch_extension; … … 553 554 void _Thread_Yield_processor( void ); 554 555 556 /* 557 * _Thread_Rotate_Ready_Queue 558 * 559 * DESCRIPTION: 560 * 561 * This routine is invoked to rotate the ready queue for the 562 * given priority. It can be used to yeild the processor 563 * by rotating the executing threads ready queue. 564 */ 565 566 void _Thread_Rotate_Ready_Queue( 567 Priority_Control priority 568 ); 569 555 570 /* 556 571 * _Thread_Load_environment … … 625 640 626 641 /* 642 * _Thread_Suspend 643 * 644 * DESCRIPTION: 645 * 646 * This routine updates the related suspend fields in the_thread 647 * control block to indicate the current nested level. 648 */ 649 650 void _Thread_Suspend( 651 Thread_Control *the_thread 652 ); 653 654 /* 655 * _Thread_Resume 656 * 657 * DESCRIPTION: 658 * 659 * This routine updates the related suspend fields in the_thread 660 * control block to indicate the current nested level. A force 661 * parameter of TRUE will force a resume and clear the suspend count. 662 */ 663 664 void _Thread_Resume( 665 Thread_Control *the_thread, 666 boolean force 667 ); 668 669 /* 627 670 * _Thread_Evaluate_mode 628 671 * 629 672 * DESCRIPTION: 630 673 * 631 * This routine XXX 674 * This routine evaluates the current scheduling information for the 675 * system and determines if a context switch is required. This 676 * is usually called after changing an execution mode such as preemptability 677 * for a thread. 632 678 */ 633 679 -
c/src/exec/score/inline/rtems/score/thread.inl
rdcc1f6b6 reb02f47 81 81 { 82 82 return ( _Thread_Executing == _Thread_Heir ); 83 }84 85 /*PAGE86 *87 * _Thread_Resume88 *89 * DESCRIPTION:90 *91 * This routine clears the SUSPENDED state for the_thread. It performs92 * any necessary scheduling operations including the selection of93 * a new heir thread.94 */95 96 RTEMS_INLINE_ROUTINE void _Thread_Resume (97 Thread_Control *the_thread98 )99 {100 _Thread_Clear_state( the_thread, STATES_SUSPENDED );101 83 } 102 84 -
c/src/exec/score/macros/rtems/score/thread.inl
rdcc1f6b6 reb02f47 53 53 #define _Thread_Is_executing_also_the_heir() \ 54 54 ( _Thread_Executing == _Thread_Heir ) 55 56 /*PAGE57 *58 * _Thread_Resume59 *60 */61 62 #define _Thread_Resume( _the_thread ) \63 _Thread_Clear_state( (_the_thread), STATES_SUSPENDED )64 55 65 56 /*PAGE -
c/src/exec/score/src/Makefile.in
rdcc1f6b6 reb02f47 43 43 threadcreateidle threaddelayended threaddispatch threadevaluatemode \ 44 44 threadget threadhandler threadidlebody threadinitialize threadloadenv \ 45 threadready threadresettimeslice threadrestart thread setpriority\46 thread setstate threadsettransient threadstackallocate threadstackfree\47 threadsta rt threadstartmultitasking threadtickletimeslice\48 thread yieldprocessor45 threadready threadresettimeslice threadrestart threadresume \ 46 threadrotatequeue threadsetpriority threadsetstate threadsettransient \ 47 threadstackallocate threadstackfree threadstart threadstartmultitasking \ 48 threadsuspend threadtickletimeslice threadyieldprocessor 49 49 50 50 THREADQ_C_PIECES= threadq threadqdequeue threadqdequeuefifo \ -
c/src/exec/score/src/threadinitialize.c
rdcc1f6b6 reb02f47 154 154 the_thread->current_state = STATES_DORMANT; 155 155 the_thread->resource_count = 0; 156 the_thread->suspend_count = 0; 156 157 the_thread->real_priority = priority; 157 158 the_thread->Start.initial_priority = priority; -
c/src/exec/score/src/threadrestart.c
rdcc1f6b6 reb02f47 45 45 46 46 _Thread_Set_transient( the_thread ); 47 the_thread->resource_count = 0; 47 the_thread->resource_count = 0; 48 the_thread->suspend_count = 0; 48 49 the_thread->is_preemptible = the_thread->Start.is_preemptible; 49 50 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; -
c/src/tests/itrontests/itrontask03/Makefile.in
rdcc1f6b6 reb02f47 20 20 21 21 # C source names, if any, go here -- minus the .c 22 C_PIECES = init preempt spinittask1 task2 task322 C_PIECES = init preempt task1 task2 task3 23 23 C_FILES = $(C_PIECES:%=%.c) 24 24 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) -
configure.in
rdcc1f6b6 reb02f47 32 32 RTEMS_CANONICAL_HOST 33 33 34 RTEMS_CHECK_POSIX_API(RTEMS_BSP) 35 RTEMS_CHECK_ITRON_API(RTEMS_BSP) 36 RTEMS_CHECK_NETWORKING(RTEMS_BSP) 37 RTEMS_CHECK_RDBG 38 34 39 AC_CONFIG_SUBDIRS(tools/build) 35 40 AC_CONFIG_SUBDIRS(tools/update) -
cpukit/itron/include/itronsys/types.h
rdcc1f6b6 reb02f47 20 20 */ 21 21 22 #if 023 22 typedef signed8 B; /* signed 8-bit integer */ 24 23 typedef signed16 H; /* signed 16-bit integer */ … … 27 26 typedef unsigned16 UH; /* unsigned 16-bit integer */ 28 27 typedef unsigned32 UW; /* unsigned 32-bit integer */ 29 #endif30 28 31 29 typedef unsigned32 VW; /* unpredictable data type (32-bit size) */ -
cpukit/itron/include/rtems/itron/object.h
rdcc1f6b6 reb02f47 81 81 (((_id) < -4) ? E_OACV : /* attempt to access a "system object" */ \ 82 82 ((_id) <= 0) ? E_ID : /* bogus index of 0 - -3 */ \ 83 ((_id) <= (_the_information)->maximum) ? E_ OBJ : /* object is in use*/ \83 ((_id) <= (_the_information)->maximum) ? E_NOEXS : /* does not exist */ \ 84 84 E_ID) /* simply a bad id */ 85 85 -
cpukit/itron/include/rtems/itron/task.h
rdcc1f6b6 reb02f47 78 78 ); 79 79 80 /* XXX remove the need for this. Enable dispatch should not be hidden */ 81 82 #define _ITRON_return_errorno( _errno ) \ 83 do { \ 84 _Thread_Enable_dispatch(); \ 85 return _errno; \ 86 } while (0); 87 88 89 #ifndef __RTEMS_APPLICATION__ 80 90 #include <rtems/itron/task.inl> 91 #endif 81 92 82 93 #ifdef __cplusplus -
cpukit/itron/inline/rtems/itron/task.inl
rdcc1f6b6 reb02f47 110 110 Objects_Locations *location 111 111 ) 112 { 112 { 113 if ( id == 0 ) { 114 _Thread_Disable_dispatch(); 115 *location = OBJECTS_LOCAL; 116 return _Thread_Executing; 117 } 118 113 119 return (Thread_Control *) 114 120 _ITRON_Objects_Get( &_ITRON_Task_Information, id, location ); … … 145 151 */ 146 152 147 RTEMS_INLINE_ROUTINE Priority_Control_ITRON_Task_Priority_to_Core(148 PRI _priority153 RTEMS_INLINE_ROUTINE _ITRON_Task_Priority_to_Core( 154 PRI ITRON_priority 149 155 ) 150 156 { 151 return ( (Priority_Control) (_priority));157 return (Priority_Control) ITRON_priority; 152 158 } 159 160 /*PAGE 161 * 162 * _ITRON_tasks_Core_to_Priority 163 */ 164 165 RTEMS_INLINE_ROUTINE _ITRON_Task_Core_to_Priority( 166 Priority_Control core_priority 167 ) 168 { 169 return (PRI) core_priority; 170 } 171 153 172 154 173 #ifdef __cplusplus … … 158 177 #endif 159 178 /* end of include file */ 160 -
cpukit/itron/src/can_wup.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 if (!the_thread) 33 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 34 35 switch ( location ) { 36 case OBJECTS_REMOTE: 37 case OBJECTS_ERROR: 38 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 39 40 case OBJECTS_LOCAL: 41 /* 42 * XXX - FILL ME IN. 43 */ 44 return E_OK; 45 } 46 47 return E_OBJ; /* XXX - Should never get here */ 29 48 } 30 49 -
cpukit/itron/src/chg_pri.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 Priority_Control new_priority; 31 32 the_thread = _ITRON_Task_Get( tskid, &location ); 33 if (!the_thread) 34 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 35 36 if (_States_Is_dormant( the_thread->current_state )) 37 return -1; 38 39 if (( tskpri <= 0 ) || ( tskpri >= 256 )) 40 _ITRON_return_errorno( E_PAR ); 41 42 switch ( location ) { 43 case OBJECTS_REMOTE: 44 case OBJECTS_ERROR: 45 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid )); 46 47 case OBJECTS_LOCAL: 48 new_priority = _ITRON_Task_Priority_to_Core( tskpri ); 49 the_thread->real_priority = new_priority; 50 51 /* 52 * XXX This is from the rtems side and I'm not sure what this is for. 53 * XXX Is this check right or should change priority be called 54 * regardless? 55 */ 56 57 if ( the_thread->resource_count == 0 || 58 the_thread->current_priority > new_priority ) 59 _Thread_Change_priority( the_thread, new_priority, FALSE ); 60 61 _Thread_Enable_dispatch(); 62 return E_OK; 63 } 64 65 return E_OBJ; /* XXX - Should never get here */ 29 66 } 30 67 68 -
cpukit/itron/src/cre_tsk.c
rdcc1f6b6 reb02f47 22 22 */ 23 23 24 /*25 * XXX - How do I return these errors ??? Do I have to validate the ID26 prior to calling the ID routine ??27 E_NOMEM Insufficient memory (Memory for control block and/or user stack28 cannot be allocated)29 E_ID Invalid ID Number (tskid was invalid or could not be used)30 E_RSATR Reserved attribute (tskatr was invalid or could not be used)31 E_OBJ Invalid object state (a task of the same ID already exists)32 E_OACV Object access violation (A tskid less than -4 was specified from33 a user task. This is implementation dependent.)34 E_PAR Parameter error (pk_ctsk, task, itskpri and/or stksz is invalid)35 EN_OBJNO An object number which could not be accessed on the target node36 is specified.37 EN_CTXID Specified an object on another node when the system call was38 issued from a task in dispatch disabled state or from a task-39 independent portion40 EN_PAR A value outside the range supported by the target node and/or41 transmission packet format was specified as a parameter (a value42 outside supported range was specified for exinf, tskatr, task,43 itskpri and/or stksz)44 */45 46 24 ER cre_tsk( 47 25 ID tskid, … … 61 39 62 40 /* 41 * Validate Parameters. 42 */ 43 44 if ( pk_ctsk == NULL ) 45 _ITRON_return_errorno( E_PAR ); 46 47 if ((pk_ctsk->tskatr != TA_ASM ) && 48 (pk_ctsk->tskatr != TA_HLNG) && 49 (pk_ctsk->tskatr != TA_COP0) && 50 (pk_ctsk->tskatr != TA_COP1) && 51 (pk_ctsk->tskatr != TA_COP2) && 52 (pk_ctsk->tskatr != TA_COP3) && 53 (pk_ctsk->tskatr != TA_COP4) && 54 (pk_ctsk->tskatr != TA_COP5) && 55 (pk_ctsk->tskatr != TA_COP6) && 56 (pk_ctsk->tskatr != TA_COP7)) 57 _ITRON_return_errorno( E_RSATR ); 58 59 if (( pk_ctsk->itskpri <= 0 ) || ( pk_ctsk->itskpri >= 256 )) 60 if ( pk_ctsk->itskpri <= 0 ) 61 _ITRON_return_errorno( E_PAR ); 62 if ( pk_ctsk->task == NULL ) 63 _ITRON_return_errorno( E_PAR ); 64 if ( pk_ctsk->stksz < 0 ) 65 _ITRON_return_errorno( E_PAR ); 66 67 /* 63 68 * allocate the thread. 64 69 */ 65 70 66 71 the_thread = _ITRON_Task_Allocate( tskid ); 67 if ( !the_thread ) { 68 ena_dsp(); 69 return _ITRON_Task_Clarify_allocation_id_error( tskid ); 70 } 71 72 /* 73 * XXX - FIX THE VARIABLES TO THE CORRECT VALUES!!! 74 */ 72 if ( !the_thread ) 73 _ITRON_return_errorno( _ITRON_Task_Clarify_allocation_id_error( tskid ) ); 75 74 76 75 /* … … 84 83 NULL, 85 84 pk_ctsk->stksz, 86 TRUE, /* XXX - All tasks FP ???*/85 TRUE, /* XXX - All tasks FP for now */ 87 86 core_priority, 88 87 TRUE, … … 95 94 if ( !status ) { 96 95 _ITRON_Task_Free( the_thread ); 97 _Thread_Enable_dispatch(); 98 return -1; 99 #if (0) 100 /* XXX */ 101 #endif 96 _ITRON_return_errorno( E_NOMEM ); 102 97 } 103 104 #if (0) /* XXX We have any thing else to set per API structure? */105 api = the_thread->API_Extensions[ THREAD_API_ITRON ];106 asr = &api->Signal;107 108 asr->is_enabled = FALSE;109 110 *id = the_thread->Object.id;111 #endif112 98 113 99 /* … … 126 112 } 127 113 114 115 116 -
cpukit/itron/src/del_tsk.c
rdcc1f6b6 reb02f47 30 30 ER result; 31 31 32 /* XXX - Fix Documentation and error checking for this error on self */32 the_thread = _ITRON_Task_Get( tskid, &location ); 33 33 34 the_thread = _ITRON_Task_Get( tskid, &location ); 35 _Thread_Disable_dispatch(); 34 if (!the_thread) 35 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 36 37 if ( the_thread == _Thread_Executing ) 38 _ITRON_return_errorno( E_OBJ ); 39 40 if ( !_States_Is_dormant( the_thread->current_state ) ) 41 _ITRON_return_errorno( E_OBJ ); 36 42 37 43 switch ( location ) { 38 44 case OBJECTS_REMOTE: 39 45 case OBJECTS_ERROR: 40 _Thread_Enable_dispatch(); 41 return _ITRON_Task_Clarify_get_id_error( tskid ); 46 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 42 47 43 48 case OBJECTS_LOCAL: -
cpukit/itron/src/exd_tsk.c
rdcc1f6b6 reb02f47 26 26 Objects_Information *the_information; 27 27 28 _Thread_Disable_dispatch(); 29 28 30 the_information = _Objects_Get_information( _Thread_Executing->Object.id ); 29 31 30 32 /* This should never happen if _Thread_Get() works right */ 31 33 assert( the_information ); 32 33 _Thread_Disable_dispatch();34 34 35 35 _Thread_Set_state( _Thread_Executing, STATES_DORMANT ); -
cpukit/itron/src/ext_tsk.c
rdcc1f6b6 reb02f47 24 24 void ext_tsk( void ) 25 25 { 26 _Thread_Disable_dispatch(); 27 28 _Thread_Restart( _Thread_Executing, NULL, 0 ); 26 29 _Thread_Set_state( _Thread_Executing, STATES_DORMANT ); 30 31 _Thread_Enable_dispatch(); 27 32 } -
cpukit/itron/src/frsm_tsk.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 if (!the_thread) 33 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 34 35 if ( the_thread == _Thread_Executing ) 36 _ITRON_return_errorno( E_OBJ ); 37 38 if (_States_Is_dormant( the_thread->current_state )) 39 _ITRON_return_errorno( E_OBJ ); 40 41 switch ( location ) { 42 case OBJECTS_REMOTE: 43 case OBJECTS_ERROR: 44 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 45 46 case OBJECTS_LOCAL: 47 _Thread_Resume( the_thread, TRUE ); 48 _Thread_Enable_dispatch(); 49 return E_OK; 50 } 51 52 return E_OBJ; /* XXX - Should never get here */ 53 29 54 } 30 55 -
cpukit/itron/src/get_tid.c
rdcc1f6b6 reb02f47 25 25 ) 26 26 { 27 /* 28 * This does not support multiprocessing. The id handling will have 29 * to be enhanced to support multiprocessing. 30 */ 31 32 *p_tskid = _Objects_Get_index( _Thread_Executing->Object.id ); 27 33 return E_OK; 28 34 } -
cpukit/itron/src/ref_tsk.c
rdcc1f6b6 reb02f47 27 27 ) 28 28 { 29 return E_OK; 29 register Thread_Control *the_thread; 30 Objects_Locations location; 31 Priority_Control core_priority; 32 33 the_thread = _ITRON_Task_Get( tskid, &location ); 34 if (!the_thread) 35 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 36 37 if (!pk_rtsk) 38 _ITRON_return_errorno( E_PAR ); 39 40 /* 41 * The following are extended functions [level X ]. 42 * XXX - tskwait, wid, wupcnt, and tskatr are presently not implemented. 43 */ 44 45 pk_rtsk->tskwait = 0; 46 pk_rtsk->wid = 0; 47 pk_rtsk->wupcnt = 0; 48 pk_rtsk->suscnt = the_thread->suspend_count; 49 pk_rtsk->tskatr = 0; 50 pk_rtsk->task = the_thread->Start.entry_point; 51 core_priority = the_thread->Start.initial_priority; 52 pk_rtsk->itskpri = _ITRON_Task_Core_to_Priority( core_priority ); 53 pk_rtsk->stksz = the_thread->Start.Initial_stack.size; 54 55 /* 56 * The following are required. 57 */ 58 59 pk_rtsk->exinf = NULL; /* extended information */ 60 pk_rtsk->tskpri = _ITRON_Task_Core_to_Priority(the_thread->current_priority); 61 pk_rtsk->tskstat = 0; 62 63 /* 64 * Mask in the tskstat information 65 * Convert the task state XXX double check this 66 */ 67 68 if ( the_thread == _Thread_Executing ) 69 pk_rtsk->tskstat |= TTS_RUN; 70 if ((the_thread->current_state & STATES_READY) != 0) 71 pk_rtsk->tskstat = TTS_RDY; 72 if (_States_Is_dormant( the_thread->current_state )) 73 pk_rtsk->tskstat = TTS_DMT; 74 if ((the_thread->current_state & STATES_SUSPENDED) != 0) 75 pk_rtsk->tskstat = TTS_SUS; 76 if ((the_thread->current_state & STATES_BLOCKED) != 0) 77 pk_rtsk->tskstat = TTS_WAI; 78 79 return E_OK; /* XXX - Should never get here */ 30 80 } 31 81 82 83 84 -
cpukit/itron/src/rel_wai.c
rdcc1f6b6 reb02f47 25 25 ) 26 26 { 27 return E_OK; 27 register Thread_Control *the_thread; 28 Objects_Locations location; 29 30 the_thread = _ITRON_Task_Get( tskid, &location ); 31 if (!the_thread) 32 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 33 34 _Thread_Disable_dispatch(); 35 36 switch ( location ) { 37 case OBJECTS_REMOTE: 38 case OBJECTS_ERROR: 39 _Thread_Enable_dispatch(); 40 return _ITRON_Task_Clarify_get_id_error( tskid ); 41 42 case OBJECTS_LOCAL: 43 /* 44 * XXX - FILL ME IN. 45 */ 46 return E_OK; 47 } 48 49 return E_OBJ; /* XXX - Should never get here */ 28 50 } 29 51 30 52 53 -
cpukit/itron/src/rot_rdq.c
rdcc1f6b6 reb02f47 25 25 ) 26 26 { 27 PRI priority; 28 29 30 _Thread_Disable_dispatch(); 31 32 /* 33 * Yield of processor will rotate the queue for this processor. 34 */ 35 36 if (( tskpri <= 0 ) || ( tskpri >= 256 )) 37 _ITRON_return_errorno( E_PAR ); 38 39 priority = _ITRON_Task_Core_to_Priority(_Thread_Executing->current_priority); 40 if ( priority == tskpri ) 41 _Thread_Yield_processor(); 42 else { 43 _Thread_Rotate_Ready_Queue( _ITRON_Task_Core_to_Priority( tskpri ) ); 44 } 45 _Thread_Enable_dispatch(); 46 27 47 return E_OK; 28 48 } -
cpukit/itron/src/rsm_tsk.c
rdcc1f6b6 reb02f47 26 26 ) 27 27 { 28 return E_OK; 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 33 if (!the_thread) 34 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 35 36 if ( the_thread == _Thread_Executing ) 37 _ITRON_return_errorno( E_OBJ ); 38 39 if (_States_Is_dormant( the_thread->current_state )) 40 _ITRON_return_errorno( E_OBJ ); 41 42 switch ( location ) { 43 case OBJECTS_REMOTE: 44 case OBJECTS_ERROR: 45 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 46 47 case OBJECTS_LOCAL: 48 _Thread_Resume( the_thread, FALSE ); 49 _Thread_Enable_dispatch(); 50 return E_OK; 51 } 52 53 return E_OBJ; /* XXX - Should never get here */ 29 54 } 30 55 -
cpukit/itron/src/slp_tsk.c
rdcc1f6b6 reb02f47 20 20 21 21 /* 22 * slp_tsk - Sleep Task Sleep Task with Timeout22 * slp_tsk - Sleep Task 23 23 */ 24 24 -
cpukit/itron/src/sta_tsk.c
rdcc1f6b6 reb02f47 22 22 */ 23 23 24 /*25 * XXX - How Do I know when these happen ???26 E_NOEXS Object does not exist (the task specified by tskid does not exist)27 E_OACV Object access violation (A tskid less than -4 was specified from28 a user task. This is implementation dependent.)29 E_OBJ Invalid object state (the target task is not in DORMANT state)30 EN_OBJNO An object number which could not be accessed on the target node31 is specified. XXX Should never get on a single processor??32 EN_CTXID Specified an object on another node when the system call was33 issued from a task in dispatch disabled state or from a task-34 independent portionXXX Should never get on a single processor??35 EN_PAR A value outside the range supported by the target node and/or36 transmission packet format was specified as a parameter (a value37 outside supported range was specified for stacd)38 XXX- What does _ITRON_Task_Get return on an invalid id and how do you know39 if it is E_ID, E_NOEXS, E_OACV40 */41 42 24 ER sta_tsk( 43 25 ID tskid, … … 50 32 51 33 the_thread = _ITRON_Task_Get( tskid, &location ); 34 if (!the_thread) 35 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 36 37 if ( !_States_Is_dormant( the_thread->current_state ) ) 38 _ITRON_return_errorno( E_OBJ ); 39 52 40 switch ( location ) { 53 41 case OBJECTS_REMOTE: 54 42 case OBJECTS_ERROR: 55 return E_ID; /* XXX */43 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 56 44 57 45 case OBJECTS_LOCAL: … … 64 52 ); 65 53 66 /* 67 * Wrong state XXX 68 */ 69 70 if ( !status ) { 71 _Thread_Enable_dispatch(); 72 return E_OBJ; 73 } 54 if ( !status ) 55 _ITRON_return_errorno( E_OBJ ); 74 56 75 57 _Thread_Enable_dispatch(); -
cpukit/itron/src/sus_tsk.c
rdcc1f6b6 reb02f47 30 30 ) 31 31 { 32 return E_OK; 32 register Thread_Control *the_thread; 33 Objects_Locations location; 34 35 the_thread = _ITRON_Task_Get( tskid, &location ); 36 if (!the_thread) 37 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 38 39 if ( the_thread == _Thread_Executing ) 40 _ITRON_return_errorno( E_OBJ ); 41 42 switch ( location ) { 43 case OBJECTS_REMOTE: 44 case OBJECTS_ERROR: 45 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 46 47 case OBJECTS_LOCAL: 48 _Thread_Suspend( the_thread ); 49 _Thread_Enable_dispatch(); 50 return E_OK; 51 } 52 53 return E_OBJ; /* XXX - Should never get here */ 33 54 } 34 55 56 57 58 59 60 61 -
cpukit/itron/src/task.c
rdcc1f6b6 reb02f47 118 118 119 119 the_information = _Objects_Get_information( the_thread->Object.id ); 120 121 120 if ( !the_information ) { 122 return -1; /* XXX */ 123 /* This should never happen if _Thread_Get() works right */ 121 return E_OBJ; /* XXX - should never happen */ 124 122 } 125 123 -
cpukit/itron/src/ter_tsk.c
rdcc1f6b6 reb02f47 19 19 20 20 /* 21 * ter_tsk - Terminate Other Task 21 * ter_tsk - Terminate Other Task - Set State to DORMANT 22 22 */ 23 23 … … 26 26 ) 27 27 { 28 register Thread_Control *the_thread; 29 Objects_Locations location; 30 31 the_thread = _ITRON_Task_Get( tskid, &location ); 32 33 if ( !the_thread ) 34 _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); 35 36 if ( the_thread == _Thread_Executing ) 37 _ITRON_return_errorno( E_OBJ ); 38 39 if ( _States_Is_dormant( the_thread->current_state ) ) 40 _ITRON_return_errorno( E_OBJ ); 41 42 _Thread_Restart( the_thread, NULL, 0 ); 43 _Thread_Set_state( the_thread, STATES_DORMANT ); 44 45 _Thread_Enable_dispatch(); 28 46 return E_OK; 29 47 } 30 48 49 50 51 52 53 54 -
cpukit/rtems/src/taskresume.c
rdcc1f6b6 reb02f47 71 71 case OBJECTS_LOCAL: 72 72 if ( _States_Is_suspended( the_thread->current_state ) ) { 73 _Thread_Resume( the_thread );73 _Thread_Resume( the_thread, TRUE ); 74 74 _Thread_Enable_dispatch(); 75 75 return RTEMS_SUCCESSFUL; -
cpukit/rtems/src/tasksuspend.c
rdcc1f6b6 reb02f47 72 72 case OBJECTS_LOCAL: 73 73 if ( !_States_Is_suspended( the_thread->current_state ) ) { 74 _Thread_S et_state( the_thread, STATES_SUSPENDED);74 _Thread_Suspend( the_thread ); 75 75 _Thread_Enable_dispatch(); 76 76 return RTEMS_SUCCESSFUL; -
cpukit/score/include/rtems/score/thread.h
rdcc1f6b6 reb02f47 186 186 #endif 187 187 /****************** end of common block ********************/ 188 unsigned32 suspend_count; 188 189 boolean is_global; 189 190 boolean do_post_task_switch_extension; … … 553 554 void _Thread_Yield_processor( void ); 554 555 556 /* 557 * _Thread_Rotate_Ready_Queue 558 * 559 * DESCRIPTION: 560 * 561 * This routine is invoked to rotate the ready queue for the 562 * given priority. It can be used to yeild the processor 563 * by rotating the executing threads ready queue. 564 */ 565 566 void _Thread_Rotate_Ready_Queue( 567 Priority_Control priority 568 ); 569 555 570 /* 556 571 * _Thread_Load_environment … … 625 640 626 641 /* 642 * _Thread_Suspend 643 * 644 * DESCRIPTION: 645 * 646 * This routine updates the related suspend fields in the_thread 647 * control block to indicate the current nested level. 648 */ 649 650 void _Thread_Suspend( 651 Thread_Control *the_thread 652 ); 653 654 /* 655 * _Thread_Resume 656 * 657 * DESCRIPTION: 658 * 659 * This routine updates the related suspend fields in the_thread 660 * control block to indicate the current nested level. A force 661 * parameter of TRUE will force a resume and clear the suspend count. 662 */ 663 664 void _Thread_Resume( 665 Thread_Control *the_thread, 666 boolean force 667 ); 668 669 /* 627 670 * _Thread_Evaluate_mode 628 671 * 629 672 * DESCRIPTION: 630 673 * 631 * This routine XXX 674 * This routine evaluates the current scheduling information for the 675 * system and determines if a context switch is required. This 676 * is usually called after changing an execution mode such as preemptability 677 * for a thread. 632 678 */ 633 679 -
cpukit/score/inline/rtems/score/thread.inl
rdcc1f6b6 reb02f47 81 81 { 82 82 return ( _Thread_Executing == _Thread_Heir ); 83 }84 85 /*PAGE86 *87 * _Thread_Resume88 *89 * DESCRIPTION:90 *91 * This routine clears the SUSPENDED state for the_thread. It performs92 * any necessary scheduling operations including the selection of93 * a new heir thread.94 */95 96 RTEMS_INLINE_ROUTINE void _Thread_Resume (97 Thread_Control *the_thread98 )99 {100 _Thread_Clear_state( the_thread, STATES_SUSPENDED );101 83 } 102 84 -
cpukit/score/macros/rtems/score/thread.inl
rdcc1f6b6 reb02f47 53 53 #define _Thread_Is_executing_also_the_heir() \ 54 54 ( _Thread_Executing == _Thread_Heir ) 55 56 /*PAGE57 *58 * _Thread_Resume59 *60 */61 62 #define _Thread_Resume( _the_thread ) \63 _Thread_Clear_state( (_the_thread), STATES_SUSPENDED )64 55 65 56 /*PAGE -
cpukit/score/src/threadinitialize.c
rdcc1f6b6 reb02f47 154 154 the_thread->current_state = STATES_DORMANT; 155 155 the_thread->resource_count = 0; 156 the_thread->suspend_count = 0; 156 157 the_thread->real_priority = priority; 157 158 the_thread->Start.initial_priority = priority; -
cpukit/score/src/threadrestart.c
rdcc1f6b6 reb02f47 45 45 46 46 _Thread_Set_transient( the_thread ); 47 the_thread->resource_count = 0; 47 the_thread->resource_count = 0; 48 the_thread->suspend_count = 0; 48 49 the_thread->is_preemptible = the_thread->Start.is_preemptible; 49 50 the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
Note: See TracChangeset
for help on using the changeset viewer.