⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcse.c

📁 nuclues 内核源代码已经在arm7-9 上作了移植
💻 C
📖 第 1 页 / 共 3 页
字号:
/*      03-01-1993      Created initial version 1.0                      */
/*      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                                                                */
/*                                                                       */
/*      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                                                               */
/*                                                                       */
/*         DATE                    REMARKS                               */
/*                                                                       */
/*      03-01-1993      Created initial version 1.0                      */
/*      04-19-1993      Verified version 1.0                             */
/*      03-01-1994      Changed function interface,                      */
/*                        resulting in version 1.1                       */
/*                                                                       */
/*      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                                                                */
/*                                                                       */
/*      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                                                               */
/*                                                                       */
/*         DATE                    REMARKS                               */
/*                                                                       */
/*      03-01-1993      Created initial version 1.0                      */
/*      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                                                                */
/*                                                                       */
/*      Accelerated Technology, Inc.                                     */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -