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     *  ======== TransportShmNotify.xdc ========
    34     */
    35    
    36    /*!
    37     *  ======== TransportShmNotify ========
    38     *  Transport for MessageQ that acts on shared memory.
    39     *
    40     *  TransportShmSingle is a simplified version of {@link TransportShm}.  This
    41     *  transport uses the Notify module to do all the real work.  The 'put'
    42     *  function passes the message to the other processor using the 'payload'
    43     *  parameter to Notify_sendEvent().  The receive side simply casts this
    44     *  payload parameter to a MessageQ_Msg and enqueues it locally.
    45     *
    46     *  CAVEATS:
    47     *
    48     *  The sender will spin in Notify_sendEvent until the receive side has
    49     *  read the previous message.  This is Notify-driver specific.
    50     *  NotifyDriverShm  will spin before sending a new event if the prior event
    51     *  hasn't been handled.  Some Notify drivers may support a FIFO or queue
    52     *  for these events to mitigate this busy-wait affect.
    53     */
    54    @InstanceFinalize
    55    @InstanceInitError
    56    
    57    module TransportShmNotify inherits ti.sdo.ipc.interfaces.IMessageQTransport
    58    {
    59        /*!
    60         *  ======== notifyEventId ========
    61         *  Notify event ID for transport.
    62         */
    63        config UInt16 notifyEventId = 2;
    64    
    65        /*!
    66         *  @_nodoc
    67         *  Determines whether the put() call unconditionally does a Cache_wbInv of
    68         *  the message before sending a notification to the remote core.
    69         *  The default value of 'true' allows us to skip the additional step of
    70         *  checking whether cache is enabled for the message.
    71         *
    72         *  This should be set to 'false' when it is optimal to perform this
    73         *  check.  This may be OPTIMAL when sending a message that is allocated
    74         *  from a shared region whose cacheFlag is 'false' and when the write-back
    75         *  cache operation is expensive.
    76         */
    77        config Bool alwaysWriteBackMsg = true;
    78    
    79    instance:
    80    
    81    internal:
    82    
    83        Void notifyFxn(UInt16 procId, UInt16 lineId, UInt32 eventId, UArg arg,
    84                       UInt32 payload);
    85    
    86        /* Instance State object */
    87        struct Instance_State {
    88            UInt16          remoteProcId;  /* dst proc id                   */
    89            UInt16          priority;      /* priority to register          */
    90        };
    91    }