1    /* 
     2     *  Copyright (c) 2012 Texas Instruments. All rights reserved. 
     3     *  This program and the accompanying materials are made available under the 
     4     *  terms of the Eclipse Public License v1.0 and Eclipse Distribution License
     5     *  v. 1.0 which accompanies this distribution. The Eclipse Public License is
     6     *  available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
     7     *  Distribution License is available at 
     8     *  http://www.eclipse.org/org/documents/edl-v10.php.
     9     *
    10     *  Contributors:
    11     *      Texas Instruments - initial implementation
    12     * */
    13    /*
    14     *  ======== SysCallback.xdc ========
    15     */
    16    package xdc.runtime;
    17    
    18    /*!
    19     *  ======== SysCallback ========
    20     *  ISystemSupport implementation for user callback functions  
    21     *
    22     *  This module provides a implementation of the `{@link ISystemSupport}`
    23     *  interface that simply calls back the user defined functions to enable the 
    24     *  System module's functionality. 
    25     *
    26     *  Configuration is as shown below. 
    27     *  @p(code)
    28     *
    29     *  var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
    30     *  SysCallback.abortFxn = "&userAbort";
    31     *  SysCallback.exitFxn  = "&userExit";
    32     *  SysCallback.flushFxn = "&userFlush";
    33     *  SysCallback.putchFxn = "&userPutch";
    34     *  SysCallback.readyFxn = "&userReady";
    35     *
    36     *  @p
    37     *  
    38     */
    39    module SysCallback inherits xdc.runtime.ISystemSupport {
    40        /*!
    41         *  ======== AbortFxn ========
    42         *  Abort function signature
    43         */
    44        typedef Void (*AbortFxn)(CString);
    45        
    46        /*!
    47         *  ======== ExitFxn ========
    48         *  Exit function signature
    49         */
    50        typedef Void (*ExitFxn)(Int);
    51        
    52        /*!
    53         *  ======== FlushFxn ========
    54         *  Flush function signature
    55         */
    56        typedef Void (*FlushFxn)();
    57        
    58        /*!
    59         *  ======== PutchFxn ========
    60         *  Putch function signature
    61         */
    62        typedef Void (*PutchFxn)(Char);
    63        
    64        /*!
    65         *  ======== ReadyFxn ========
    66         *  Ready function signature
    67         */
    68        typedef Bool (*ReadyFxn)();
    69    
    70        /*!
    71         *  ======== abortFxn =========
    72         *  User supplied abort function
    73         *  
    74         *  This function is called when the application calls 
    75         *  `{@link System#abort()}` function. If the user supplied funtion 
    76         *  returns, the abort function of the ANSI C Standard library is called. 
    77         *  For more information see the `{@link System#abort()}` documentation.
    78         * 
    79         *  By default, this function is configured with a default abort function.  
    80         *  This default abort function spins forever and never returns.
    81         */
    82        config AbortFxn abortFxn = "&xdc_runtime_SysCallback_defaultAbort";
    83    
    84        /*!
    85         *  ======== exitFxn =========
    86         *  User supplied exit function
    87         *
    88         *  This function is called when the application calls 
    89         *  `{@link System#exit()}` function. If the user supplied function 
    90         *  returns, the ANSI C Standard Library atexit processing will be 
    91         *  completed. For more information see the `{@link System#exit()}` 
    92         *  documentation.
    93         *
    94         *  By default, this function is configured with a default exit function.
    95         *  The default exit function does nothing and returns.
    96         */
    97        config ExitFxn exitFxn = "&xdc_runtime_SysCallback_defaultExit";
    98    
    99        /*!
   100         *  ======== flushFxn =========
   101         *  User supplied flush function
   102         *
   103         *  This function is called when the application calls
   104         *  `{@link System#flush()}` function. 
   105         *
   106         *  By default, this function is configured with a default flush function. 
   107         *  The default flush function does nothing and returns.
   108         */
   109        config FlushFxn flushFxn = "&xdc_runtime_SysCallback_defaultFlush";
   110    
   111        /*!
   112         *  ======== putchFxn =========
   113         *  User supplied character output function
   114         *
   115         *  This function is called whenever the `System` module needs to output 
   116         *  a character; e.g., during `{@link System#printf()}` or 
   117         *  `{@link System#putch()}`.
   118         *
   119         *  By default, this function is configured with a default putch function.
   120         *  The default putch function drops the characters.
   121         */
   122        config PutchFxn putchFxn = "&xdc_runtime_SysCallback_defaultPutch";
   123    
   124        /*!
   125         *  ======== readyFxn =========
   126         *  User supplied ready function
   127         *
   128         *  This function is called by the `System` module prior to performing any
   129         *  character output to check if the `SystemSupport` module is ready to 
   130         *  accept the character. For more information see the 
   131         * `{@link ISystemSupport#ready()}` documentation.
   132         *
   133         *  By default, this function is configured with a default ready function. 
   134         *  The default ready function returns `TRUE` always.
   135         */
   136        config ReadyFxn readyFxn = "&xdc_runtime_SysCallback_defaultReady";
   137    }
   138    /*
   139     *  @(#) xdc.runtime; 2, 1, 0,0; 4-24-2015 12:34:13; /db/ztree/library/trees/xdc/xdc-A71/src/packages/
   140     */
   141