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

📄 evce.c

📁 nuclues 内核源代码已经在arm7-9 上作了移植
💻 C
📖 第 1 页 / 共 2 页
字号:
        /* Event group pointer is valid, call function to delete it.  */
        status =  EVC_Delete_Event_Group(event_group_ptr);
        
    else
    
        /* Event group pointer is invalid, indicate in completion status.  */
        status =  NU_INVALID_GROUP;
        
    /* Return completion status.  */
    return(status);
}


/*************************************************************************/
/*                                                                       */
/* FUNCTION                                                              */
/*                                                                       */
/*      EVCE_Set_Events                                                  */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This function performs error checking on the parameters supplied */
/*      to the set events function.                                      */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      Accelerated Technology, Inc.                                     */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */
/*      EVC_Set_Events                      Actual set events function   */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      event_group_ptr                     Event Group control block ptr*/
/*      events                              Event flag setting           */
/*      operation                           Operation to perform on the  */
/*                                            event flag group (AND/OR)  */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      NU_INVALID_GROUP                    Event group control block    */
/*                                            pointer is invalid         */
/*      NU_INVALID_OPERATION                Event operation is invalid   */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         DATE                    REMARKS                               */
/*                                                                       */
/*      03-01-1993      Created initial version 1.0                      */
/*      04-19-1993      Verified version 1.0                             */
/*      03-01-1994      Modified function interface,                     */
/*                      resulting in version 1.1                         */
/*                                                                       */
/*      03-18-1994      Verified version 1.1                             */
/*                                                                       */
/*************************************************************************/
STATUS  EVCE_Set_Events(NU_EVENT_GROUP *event_group_ptr, UNSIGNED events, 
                                                OPTION operation)
{

EV_GCB         *event_group;                /* Event control block ptr   */
STATUS          status;                     /* Completion status         */


    /* Move input event group pointer into internal pointer.  */
    event_group =  (EV_GCB *) event_group_ptr;

    /* Determine if event group pointer is invalid.  */
    if (event_group == NU_NULL)
    
        /* Event group pointer is invalid, indicate in completion status.  */
        status =  NU_INVALID_GROUP;

    else if (event_group -> ev_id != EV_EVENT_ID)
    
        /* Event group pointer is invalid, indicate in completion status.  */
        status =  NU_INVALID_GROUP;
        
    else if ((operation != NU_AND) && (operation != NU_OR))
             
        /* Invalid operation on the event flag group.  */
        status =  NU_INVALID_OPERATION;

    else 
    
        /* Parameters are valid, call actual function.  */
        status =  EVC_Set_Events(event_group_ptr, events, operation);

    /* Return the completion status.  */
    return(status);
}


/*************************************************************************/
/*                                                                       */
/* FUNCTION                                                              */
/*                                                                       */
/*      EVCE_Retrieve_Events                                             */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This function performs error checking on the parameter supplied  */
/*      to the retrieve events function.                                 */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      Accelerated Technology, Inc.                                     */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */
/*      EVC_Retrieve_Events                 Retrieve event flags         */
/*      TCCE_Suspend_Error                  Check for suspend validity   */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      event_group_ptr                     Event Group control block ptr*/
/*      requested_events                    Requested event flags        */
/*      operation                           AND/OR selection of flags    */
/*      retrieved_events                    Pointer to destination for   */
/*                                            actual flags retrieved     */
/*      suspend                             Suspension option            */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      NU_INVALID_GROUP                    Event group control block    */
/*                                            pointer is invalid         */
/*      NU_INVALID_POINTER                  Received event flag pointer  */
/*                                            is NULL                    */
/*      NU_INVALID_OPERATION                Event operation is invalid   */
/*      NU_INVALID_SUSPEND                  Invalid suspension request   */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*        DATE                    REMARKS                                */
/*                                                                       */
/*      03-01-1993      Created initial version 1.0                      */
/*      04-19-1993      Verified version 1.0                             */
/*      03-01-1994      Modified function interface,                     */
/*                      resulting in version 1.1                         */
/*                                                                       */
/*      03-18-1994      Verified version 1.1                             */
/*                                                                       */
/*************************************************************************/
STATUS  EVCE_Retrieve_Events(NU_EVENT_GROUP *event_group_ptr, 
                        UNSIGNED requested_events, OPTION operation, 
                        UNSIGNED *retrieved_events, UNSIGNED suspend)
{

EV_GCB         *event_group;                /* Event control block ptr   */
STATUS          status;                     /* Completion status         */


    /* Move input event group pointer into internal pointer.  */
    event_group =  (EV_GCB *) event_group_ptr;

    /* Determine if event group pointer is invalid.  */
    if (event_group == NU_NULL)
    
        /* Event group pointer is invalid, indicate in completion status.  */
        status =  NU_INVALID_GROUP;

    else if (event_group -> ev_id != EV_EVENT_ID)
    
        /* Event group pointer is invalid, indicate in completion status.  */
        status =  NU_INVALID_GROUP;
        
    else if ((operation != NU_AND) &&
             (operation != NU_AND_CONSUME) &&
             (operation != NU_OR) &&
             (operation != NU_OR_CONSUME))
             
        /* Invalid operation on the event flag group.  */
        status =  NU_INVALID_OPERATION;

    else if ((suspend) && (TCCE_Suspend_Error()))
    
        /* Suspension from an non-task thread.  */
        status =  NU_INVALID_SUSPEND;

    else if (retrieved_events == NU_NULL)
    
        /* Retrieved events pointer is NULL.  */
        status =  NU_INVALID_POINTER;

    else 
    
        /* Parameters are valid, call actual function.  */
        status =  EVC_Retrieve_Events(event_group_ptr, requested_events,
                                        operation, retrieved_events, suspend);

    /* Return the completion status.  */
    return(status);
}

⌨️ 快捷键说明

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