1    /* --COPYRIGHT--,BSD
     2     * Copyright (c) $(CPYYEAR), Texas Instruments Incorporated
     3     * All rights reserved.
     4     *
     5     * Redistribution and use in source and binary forms, with or without
     6     * modification, are permitted provided that the following conditions
     7     * are met:
     8     *
     9     * *  Redistributions of source code must retain the above copyright
    10     *    notice, this list of conditions and the following disclaimer.
    11     *
    12     * *  Redistributions in binary form must reproduce the above copyright
    13     *    notice, this list of conditions and the following disclaimer in the
    14     *    documentation and/or other materials provided with the distribution.
    15     *
    16     * *  Neither the name of Texas Instruments Incorporated nor the names of
    17     *    its contributors may be used to endorse or promote products derived
    18     *    from this software without specific prior written permission.
    19     *
    20     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    22     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    23     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    24     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    25     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    26     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    27     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    28     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    29     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    30     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31     * --/COPYRIGHT--*/
    32    /*
    33     *  ======== INotifyDriver.xdc ========
    34     *  
    35     *! Revision History
    36     *! ================
    37     *! 24-Mar-2010 skp     update cdoc, removed callback fxn typedef
    38     *! 19-Nov-2009 skp     cdoc updates
    39     *! 18-Nov-2009 skp     Code review changes
    40     *! 05-Nov-2009 kw      major updates to simplify the drivers
    41     *! 26-Oct-2009 skp     Added getEventList()
    42     *! 06-Feb-2009 yogesh  modified to incorporate review comments
    43     *! 08-Jan-2009 yogesh  created
    44     */
    45    
    46    /*!
    47     *  ======== INotifyDriver ========
    48     *  Notify driver interface
    49     *
    50     *  Interface implemented by all drivers for the notify module.  Modules that
    51     *  implement this interface expect the eventId arguments to be valid.
    52     */
    53    
    54    interface INotifyDriver {
    55        
    56    instance:
    57    
    58        /*!
    59         *  ======== registerEvent ========
    60         *  Register a callback to an event
    61         *
    62         *  This driver function is called by the Notify_registerEvent function 
    63         *  within the Notify module gate. Refer to its documentation for more 
    64         *  details.  
    65         *
    66         *  @param(eventId)      Number of event that is being registered
    67         */
    68        @DirectCall
    69        Void registerEvent(UInt32 eventId);
    70    
    71        /*!
    72         *  ======== unregisterEvent ========
    73         *  Remove an event listener from an event
    74         *
    75         *  This driver function is called by the Notify_unregisterEvent function
    76         *  within the Notify module gate. Refer to it for more details.
    77         *
    78         *  @param(eventId)      Number of event that is being unregistered
    79         */
    80        @DirectCall
    81        Void unregisterEvent(UInt32 eventId);
    82    
    83        /*!
    84         *  ======== sendEvent ========
    85         *  Send a signal to an event
    86         *
    87         *  This interface function is called by the Notify_sendEvent function.
    88         *  Notify_sendEvent does not provide any context protection for
    89         *  INotifyDriver_sendEvent, so appropriate measures must be taken within
    90         *  the driver itself.
    91         *
    92         *  @param(eventId)      Number of event to signal
    93         *  @param(payload)      Payload (optional) to pass to callback function
    94         *  @param(waitClear)    If TRUE, have the NotifyDriver wait for
    95         *                       acknowledgement back from the destination
    96         *                       processor.
    97         *
    98         *  @b(returns)          Notify status
    99         */
   100        @DirectCall
   101        Int sendEvent(UInt32 eventId, UInt32 payload, Bool waitClear);
   102    
   103        /*!
   104         *  ======== disable ========
   105         *  Disable a NotifyDriver instance
   106         *
   107         *  Disables the ability of a Notify driver to receive events for a given
   108         *  processor. This interface function is called by the Notify_disable
   109         *  function. Refer to its documentation for more details.
   110         */
   111        @DirectCall
   112        Void disable();
   113    
   114        /*!
   115         *  ======== enable ========
   116         *  Enable a NotifyDriver instance
   117         *
   118         *  Enables the ability of a Notify driver to receive events for a given
   119         *  processor. This interface function is called by the Notify_restore 
   120         *  function. Refer to its documentation for more details.
   121         */
   122        @DirectCall
   123        Void enable();
   124    
   125        /*!
   126         *  ======== disableEvent ========
   127         *  Disable an event
   128         *
   129         *  This interface function is called by the Notify_disableEvent function. 
   130         *  Refer to its documentation for more details.
   131         *
   132         *  The Notify module does validation of the eventId.  The Notify module
   133         *  enters calls this function within the Notify module gate.
   134         *
   135         *  @param(eventId)      Number of event to disable
   136         */
   137        @DirectCall
   138        Void disableEvent(UInt32 eventId);
   139    
   140        /*!
   141         *  ======== enableEvent ========
   142         *  Enable an event
   143         *
   144         *  This interface function is called by the Notify_disableEvent function. 
   145         *  Refer to its documentation for more details.
   146         *
   147         *  The Notify module does validation of the eventId.  The Notify module
   148         *  enters calls this function within the Notify module gate.
   149         *
   150         *  @param(eventId)      Number of event to enable
   151         */
   152        @DirectCall
   153        Void enableEvent(UInt32 eventId);
   154        
   155        /*! @_nodoc
   156         *  ======== setNotifyHandle ========
   157         *  Called during Notify instance creation to 'send' its handle to its
   158         *  corresponding notify driver instance
   159         */
   160        @DirectCall
   161        Void setNotifyHandle(Ptr driverHandle);
   162        
   163    }