1    /*
     2     * Copyright (c) 2012-2014, 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     * */
    32    
    33    /*
    34     *  ======== LoggerTypes.xdc ========
    35     *  TODO: This module is only used in LogSnapshot.  Can probably
    36     *  just move the LogMemoryRangeFxn typedef to LogSnapshot and then
    37     *  remove this module.
    38     */
    39    
    40    package ti.uia.runtime;
    41    import xdc.runtime.Types;
    42    import xdc.runtime.Log;
    43    import ti.uia.runtime.IUIATraceSyncProvider;
    44    
    45    /*!
    46     *  ======== LoggerTypes ========
    47     *  Function pointer type definitions for various types of loggers
    48     *
    49     *  This module defines function prototypes for use in defining
    50     *  callback functions that support device-specific features (e.g.
    51     *  synchronization with CPU Trace) and support customization and
    52     *  extensibility of core UIA features (e.g. logging a range of memory values).
    53     */
    54    module LoggerTypes {
    55    
    56        /*!
    57         *  ======== LogMemoryRangeFxn ========
    58         *  Log an event along with values from a range of memory addresses
    59         *
    60         *  Note that this function can support logging of null terminated strings,
    61         *  arrays of characters and memory mapped registgers as well as blocks of
    62         *  memory.  The LogSnapshot module uses this callback function.
    63         *  Modules that implement the ILoggerSnapshot interface provide implementations
    64         *  of this callback function.
    65         *
    66         *  @param(ptr)         module instance object handle
    67         *  @param(evt)         event to be logged
    68         *  @param(snapshotId)  0 = no other snapshot groups, Use value from
    69         *                      LogSnapshot.getSnapshotId() for all snapshots to be
    70         *                      grouped.
    71         *  @param(fileName)    __FILE__ result
    72         *  @param(lineNum)     __LINE__ result
    73         *  @param(fmt)         a `printf` style format string
    74         *  @param(startAdrs)   value for first format conversion character
    75         *  @param(lengthInMAUs) value for second format conversion character
    76         *
    77         *  @see Log#Event
    78         *  @see ILoggerSnapshot#writeMemoryRange
    79         */
    80         typedef Void (*LogMemoryRangeFxn)(Ptr, xdc.runtime.Log.Event,
    81            UInt32, UInt32, IArg, IArg, IArg, IArg, IArg);
    82    
    83        /*!
    84         * ====== InjectIntoTraceFxn ======
    85         * Callback function that injects syncPoint info into GEM Trace
    86         *
    87         * This callback function injects correlation info into the trace stream
    88         * to enable correlation between software events and hardware trace.
    89         *
    90         * @param(serialNum)   the serial number that is to be injected
    91         * @param(ctxType)     the context type ID to be injected into the trace
    92         *
    93         * @see IUIATraceSyncProvider
    94         * @see IUIATraceSyncClient
    95         */
    96        typedef Void (*InjectIntoTraceFxn)(UInt32, IUIATraceSyncProvider.ContextType);
    97    }