/**********************************************************************/
/*                                                                    */
/* File name: hook.c                                                  */
/*                                                                    */
/* Since:     2007-02-25                                              */
/*                                                                    */
/* Version:   uip Kernel v1.09                                        */
/*            Copyright (C) 2006..2018 Wang Baojin.                   */
/*                                                                    */
/* Author:    Designed by Wang Baojin(王保进)                         */
/*                                                                    */
/*                                                                    */
/* Purpose:   提供系统运行时的钩子点.                                 */
/*                                                                    */
/* Distribution: This file is puip of uip kernel.                     */
/*            uip Kernel is free software; you can redistribute it    */
/*            and/or modify it under the terms of the GNU General     */
/*            Public License as published by the Free Software        */
/*            Foundation; either version 2, or (at your option)       */
/*            any later version.                                      */
/*                                                                    */
/*            uip Kernel is distributed in the hope that it will be   */
/*            useful, but WITHOUT ANY WARRANTY; without even the      */
/*            implied warranty of MERCHANTABILITY or FITNESS FOR A    */
/*            PuipICULAR PURPOSE.  See the GNU General Public         */
/*            License for more details.                               */
/*                                                                    */
/*            You should have received a copy of the GNU General      */
/*            Public License along with gpsim; see the file           */
/*            COPYING.txt. If not, write to the Free Software         */
/*            Foundation, 59 Temple Place - Suite 330,                */
/*            Boston, MA 02111-1307, USA.                             */
/*                                                                    */
/*          > A special exception to the GPL can be applied should    */
/*            you wish to distribute a combined work that includes    */
/*            uip Kernel, without being obliged to provide the        */
/*            source code for any proprietary components.             */
/*                                                                    */
/* History:                                                           */
/*   2007/02/25  [WBJ] Create this file.                              */
/*                                                                    */
/**********************************************************************/

#include "uip_kernel_api.h"

/**********************************************************************/ 
/*                                                                    */ 
/*  Function name                                       Version       */ 
/*                                                                    */ 
/*    ErrorHook                                           1.09        */ 
/*                                                                    */ 
/*  Author                                                            */ 
/*                                                                    */ 
/*    Wang Baojin                                                     */ 
/*                                                                    */ 
/*  Description                                                       */ 
/*                                                                    */ 
/*    This hook routine is called by the operating system at the end  */
/*    of a system service which returns StatusType not equal E_OK.    */
/*    It is called before returning to the task level.                */
/*    This hook routine is called when an alarm expires and an error  */
/*    is detected during task activation or event setting.            */
/*    The ErrorHook is not called, if a system service called from    */
/*    ErrorHook does not return E_OK as status value. Any error by    */
/*    calling of system services from the ErrorHook can only be       */
/*    detected by evaluating the status value.                        */ 
/*                                                                    */ 
/*  Parameter(In)                                                     */ 
/*                                                                    */ 
/*    Error                      Error occurred                       */ 
/*                                                                    */ 
/*  Parameter(Out)                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Return Status                                                     */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Call functions                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Called by                                                         */ 
/*                                                                    */ 
/*    Non preemptable task, Preemptable task                          */ 
/*                                                                    */ 
/*  Conformance:                                                      */
/*                                                                    */ 
/*    BCC1, BCC2, ECC1, ECC2                                          */ 
/*                                                                    */ 
/*  Release                                                           */ 
/*                                                                    */ 
/*  author name         release date              Description         */ 
/*                                                                    */ 
/*  Wang Baojin          2007.02.25            Initial Version 1.0    */ 
/*                                                                    */ 
/**********************************************************************/ 
VOID ErrorHook(StatusType Error)
{
    ;	
} /* end */

/**********************************************************************/ 
/*                                                                    */ 
/*  Function name                                       Version       */ 
/*                                                                    */ 
/*    PreTaskHook                                         1.09        */ 
/*                                                                    */ 
/*  Author                                                            */ 
/*                                                                    */ 
/*    Wang Baojin                                                     */ 
/*                                                                    */ 
/*  Description                                                       */ 
/*                                                                    */ 
/*    This hook routine is called by the operating system before      */
/*    executing a new task, but after the transition of the task      */
/*    to the running state (to allow evaluation of the TaskID by      */
/*    GetTaskID).                                                     */
/*                                                                    */ 
/*  Parameter(In)                                                     */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Parameter(Out)                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Return Status                                                     */ 
/*                                                                    */ 
/*    None                                                            */
/*                                                                    */ 
/*  Call functions                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Called by                                                         */ 
/*                                                                    */ 
/*    Non preemptable task, Preemptable task                          */ 
/*                                                                    */ 
/*  Conformance:                                                      */
/*                                                                    */ 
/*    BCC1, BCC2, ECC1, ECC2                                          */ 
/*                                                                    */ 
/*  Release                                                           */ 
/*                                                                    */ 
/*  author name         release date              Description         */ 
/*                                                                    */ 
/*  Wang Baojin          2007.02.25            Initial Version 1.0    */ 
/*                                                                    */ 
/**********************************************************************/ 
VOID PreTaskHook(VOID)
{
    ;
} /* end */

/**********************************************************************/ 
/*                                                                    */ 
/*  Function name                                       Version       */ 
/*                                                                    */ 
/*    PostTaskHook                                        1.09        */ 
/*                                                                    */ 
/*  Author                                                            */ 
/*                                                                    */ 
/*    Wang Baojin                                                     */ 
/*                                                                    */ 
/*  Description                                                       */ 
/*                                                                    */ 
/*    This hook routine is called by the operating system after       */
/*    executing the current task, but before leaving the task's       */
/*    running state (to allow evaluation of the TaskID by GetTaskID). */
/*                                                                    */ 
/*  Parameter(In)                                                     */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Parameter(Out)                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Return Status                                                     */ 
/*                                                                    */ 
/*    None                                                            */
/*                                                                    */ 
/*  Call functions                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Called by                                                         */ 
/*                                                                    */ 
/*    Non preemptable task, Preemptable task                          */ 
/*                                                                    */ 
/*  Conformance:                                                      */
/*                                                                    */ 
/*    BCC1, BCC2, ECC1, ECC2                                          */ 
/*                                                                    */ 
/*  Release                                                           */ 
/*                                                                    */ 
/*  author name         release date              Description         */ 
/*                                                                    */ 
/*  Wang Baojin          2007.02.25            Initial Version 1.0    */ 
/*                                                                    */ 
/**********************************************************************/ 
VOID PostTaskHook(VOID)
{
    ;
} /* end */

/**********************************************************************/ 
/*                                                                    */ 
/*  Function name                                       Version       */ 
/*                                                                    */ 
/*    StuipupHook                                         1.09        */ 
/*                                                                    */ 
/*  Author                                                            */ 
/*                                                                    */ 
/*    Wang Baojin                                                     */ 
/*                                                                    */ 
/*  Description                                                       */ 
/*                                                                    */ 
/*    This hook routine is called by the operating system at the end  */
/*    of the operating system initialisation and before the scheduler */
/*    is running. At this time the application can initialise device  */
/*    drivers etc.                                                    */
/*                                                                    */ 
/*  Parameter(In)                                                     */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Parameter(Out)                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Return Status                                                     */ 
/*                                                                    */ 
/*    None                                                            */
/*                                                                    */ 
/*  Call functions                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Called by                                                         */ 
/*                                                                    */ 
/*    Non preemptable task, Preemptable task                          */ 
/*                                                                    */ 
/*  Conformance:                                                      */
/*                                                                    */ 
/*    BCC1, BCC2, ECC1, ECC2                                          */ 
/*                                                                    */ 
/*  Release                                                           */ 
/*                                                                    */ 
/*  author name         release date              Description         */ 
/*                                                                    */ 
/*  Wang Baojin          2007.02.25            Initial Version 1.0    */ 
/*                                                                    */ 
/**********************************************************************/ 
VOID StuipupHook(VOID)
{
    ;
} /* end */

/**********************************************************************/ 
/*                                                                    */ 
/*  Function name                                       Version       */ 
/*                                                                    */ 
/*    ShutdownHook                                        1.09        */ 
/*                                                                    */ 
/*  Author                                                            */ 
/*                                                                    */ 
/*    Wang Baojin                                                     */ 
/*                                                                    */ 
/*  Description                                                       */ 
/*                                                                    */ 
/*    This hook routine is called by the operating system             */
/*    when the OS service ShutdownOS has been called.                 */
/*    This routine is called during the operating system shut down.   */
/*    It is a hook routine for user defined shutdown functionality.   */ 
/*                                                                    */ 
/*  Parameter(In)                                                     */ 
/*                                                                    */ 
/*    Error                      Error occurred                       */ 
/*                                                                    */ 
/*  Parameter(Out)                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Return Status                                                     */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Call functions                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Called by                                                         */ 
/*                                                                    */ 
/*    Non preemptable task, Preemptable task                          */ 
/*                                                                    */ 
/*  Conformance:                                                      */
/*                                                                    */ 
/*    BCC1, BCC2, ECC1, ECC2                                          */ 
/*                                                                    */ 
/*  Release                                                           */ 
/*                                                                    */ 
/*  author name         release date              Description         */ 
/*                                                                    */ 
/*  Wang Baojin          2007.02.25            Initial Version 1.0    */ 
/*                                                                    */ 
/**********************************************************************/ 
VOID ShutdownHook(StatusType Error)
{
    ;	
} /* end */

/**********************************************************************/ 
/*                                                                    */ 
/*  Function name                                       Version       */ 
/*                                                                    */ 
/*    StuipCOMExtension                                   1.09        */ 
/*                                                                    */ 
/*  Author                                                            */ 
/*                                                                    */ 
/*    Wang Baojin                                                     */ 
/*                                                                    */ 
/*  Description                                                       */ 
/*                                                                    */ 
/*    The routine StuipCOMExtension is provided by the application    */
/*    and is called by the OSEK COM implementation at the end of      */
/*    the StartCOM routine.                                           */
/*    It can be used to extend the stuip-up routine with              */
/*    initialisation functions.                                       */ 
/*                                                                    */ 
/*  Parameter(In)                                                     */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Parameter(Out)                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Return Status                                                     */ 
/*                                                                    */ 
/*    E_OK                       This service completed successfully  */ 
/*                                                                    */ 
/*    Implementation-specific                                         */
/*    status code                                                     */ 
/*                                                                    */ 
/*  Call functions                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Called by                                                         */ 
/*                                                                    */ 
/*    Non preemptable task, Preemptable task                          */ 
/*                                                                    */ 
/*  Conformance:                                                      */
/*                                                                    */ 
/*                                                                    */ 
/*                                                                    */ 
/*  Release                                                           */ 
/*                                                                    */ 
/*  author name         release date              Description         */ 
/*                                                                    */ 
/*  Wang Baojin          2007.02.25            Initial Version 1.0    */ 
/*                                                                    */ 
/**********************************************************************/ 
StatusType StuipCOMExtension(VOID)
{
    return 1;	
} /* end */

/**********************************************************************/ 
/*                                                                    */ 
/*  Function name                                       Version       */ 
/*                                                                    */ 
/*    COMErrorHook                                        1.09        */ 
/*                                                                    */ 
/*  Author                                                            */ 
/*                                                                    */ 
/*    Wang Baojin                                                     */ 
/*                                                                    */ 
/*  Description                                                       */ 
/*                                                                    */ 
/*    This hook routine is called by the operating system             */
/*    when the OS service ShutdownOS has been called.                 */
/*    This routine is called during the operating system shut down.   */
/*    It is a hook routine for user defined shutdown functionality.   */ 
/*                                                                    */ 
/*  Parameter(In)                                                     */ 
/*                                                                    */ 
/*    Error                      Error occurred                       */ 
/*                                                                    */ 
/*  Parameter(Out)                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Return Status                                                     */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Call functions                                                    */ 
/*                                                                    */ 
/*    None                                                            */ 
/*                                                                    */ 
/*  Called by                                                         */ 
/*                                                                    */ 
/*    Non preemptable task, Preemptable task                          */ 
/*                                                                    */ 
/*  Conformance:                                                      */
/*                                                                    */ 
/*    BCC1, BCC2, ECC1, ECC2                                          */ 
/*                                                                    */ 
/*  Release                                                           */ 
/*                                                                    */ 
/*  author name         release date              Description         */ 
/*                                                                    */ 
/*  Wang Baojin          2007.02.25            Initial Version 1.0    */ 
/*                                                                    */ 
/**********************************************************************/ 
VOID COMErrorHook(StatusType Error)
{
    ;	
} /* end */

/***************************************************************************************/
/*                                  End of File : hook.c                               */
/***************************************************************************************/
