?? tcse.c
字號:
/* W. Lamie 03-01-1993 Created initial version 1.0 */
/* D. Lamie 04-19-1993 Verified version 1.0 */
/* */
/*************************************************************************/
OPTION TCSE_Change_Preemption(OPTION preempt)
{
TC_TCB *task; /* Pointer to task */
OPTION old_preempt;
/* Pickup the current thread and place it in the task pointer. */
task = (TC_TCB *) TCD_Current_Thread;
/* Determine if the current thread is really a task thread. */
if (task -> tc_id == TC_TASK_ID)
/* Yes, change the preemption posture. */
old_preempt = TCS_Change_Preemption(preempt);
else
/* Return the original request. */
old_preempt = preempt;
/* Return the previous preemption posture. */
return(old_preempt);
}
/*************************************************************************/
/* */
/* FUNCTION */
/* */
/* TCSE_Change_Time_Slice */
/* */
/* DESCRIPTION */
/* */
/* This function performs error checking on the change time slice */
/* service. If the specified task pointer is invalid, this */
/* request is ignored. */
/* */
/* AUTHOR */
/* */
/* William E. Lamie, Accelerated Technology, Inc. */
/* */
/* CALLED BY */
/* */
/* Application */
/* */
/* CALLS */
/* */
/* TCS_Change_Time_Slice Change the time slice of the */
/* specified task */
/* */
/* INPUTS */
/* */
/* task_ptr Task control block pointer */
/* time_slice New time slice value */
/* */
/* OUTPUTS */
/* */
/* old_time_slice Old time slice value */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* W. Lamie 03-01-1993 Created initial version 1.0 */
/* D. Lamie 04-19-1993 Verified version 1.0 */
/* W. Lamie 03-01-1994 Changed function interface, */
/* resulting in version 1.1 */
/* R. Pfaff - */
/* D. Lamie 03-18-1994 Verified version 1.1 */
/* */
/*************************************************************************/
UNSIGNED TCSE_Change_Time_Slice(NU_TASK *task_ptr, UNSIGNED time_slice)
{
TC_TCB *task; /* Task control block ptr */
UNSIGNED old_time_slice; /* Old time slice value */
/* Move input task pointer into internal pointer. */
task = (TC_TCB *) task_ptr;
/* Determine if the task pointer is valid. */
if (task -> tc_id == TC_TASK_ID)
/* Yes, change the time slice. */
old_time_slice = TCS_Change_Time_Slice(task_ptr, time_slice);
else
/* Return the current request. */
old_time_slice = time_slice;
/* Return the previous time slice value. */
return(old_time_slice);
}
/*************************************************************************/
/* */
/* FUNCTION */
/* */
/* TCSE_Control_Signals */
/* */
/* DESCRIPTION */
/* */
/* This function checks to see if the call is being made from a */
/* non-task thread. If so, the request is simply ignored. */
/* */
/* AUTHOR */
/* */
/* William E. Lamie, Accelerated Technology, Inc. */
/* */
/* CALLED BY */
/* */
/* Application */
/* */
/* CALLS */
/* */
/* TCS_Control_Signals Actual control signals func */
/* */
/* INPUTS */
/* */
/* enable_signal_mask Enable signal mask */
/* */
/* OUTPUTS */
/* */
/* Previous signal enable mask */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* W. Lamie 03-01-1993 Created initial version 1.0 */
/* D. Lamie 04-19-1993 Verified version 1.0 */
/* */
/*************************************************************************/
UNSIGNED TCSE_Control_Signals(UNSIGNED enable_signal_mask)
{
UNSIGNED return_mask; /* Return signal mask */
TC_TCB *task; /* Task pointer */
/* Pickup the task pointer. */
task = (TC_TCB *) TCD_Current_Thread;
/* Determine if the call is valid. */
if (task -> tc_id == TC_TASK_ID)
/* Valid request- call actual routine to control signals. */
return_mask = TCS_Control_Signals(enable_signal_mask);
else
/* Return a cleared mask. */
return_mask = 0;
/* Return the old enable mask. */
return(return_mask);
}
/*************************************************************************/
/* */
/* FUNCTION */
/* */
/* TCSE_Receive_Signals */
/* */
/* DESCRIPTION */
/* */
/* This function determines whether or not the call is being made */
/* from a task thread of execution. If not, the call is ignored. */
/* */
/* AUTHOR */
/* */
/* William E. Lamie, Accelerated Technology, Inc. */
/* */
/* CALLED BY */
/* */
/* Application */
/* */
/* CALLS */
/* */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -