[processor-sdk/performance-audio-sr.git] / psdk_cust / ipc_3_43_00_00_eng / docs / cdoc / ti / trace / SysMin-src.html
diff --git a/psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/trace/SysMin-src.html b/psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/trace/SysMin-src.html
+++ /dev/null
@@ -1,238 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><title>module ti.trace.SysMin</title>
-<meta name="googlebot" content="noindex,nofollow">
-<link rel="stylesheet" type="text/css" href="../../src.css"/>
-</head>
-<body>
-<pre class=src>
- 1 <span class="comment">/*
-</span> 2 <span class="comment"> * Copyright (c) 2011-2013, Texas Instruments Incorporated
-</span> 3 <span class="comment"> * All rights reserved.
-</span> 4 <span class="comment"> *
-</span> 5 <span class="comment"> * Redistribution and use in source and binary forms, with or without
-</span> 6 <span class="comment"> * modification, are permitted provided that the following conditions
-</span> 7 <span class="comment"> * are met:
-</span> 8 <span class="comment"> *
-</span> 9 <span class="comment"> * * Redistributions of source code must retain the above copyright
-</span> 10 <span class="comment"> * notice, this list of conditions and the following disclaimer.
-</span> 11 <span class="comment"> *
-</span> 12 <span class="comment"> * * Redistributions in binary form must reproduce the above copyright
-</span> 13 <span class="comment"> * notice, this list of conditions and the following disclaimer in the
-</span> 14 <span class="comment"> * documentation and/or other materials provided with the distribution.
-</span> 15 <span class="comment"> *
-</span> 16 <span class="comment"> * * Neither the name of Texas Instruments Incorporated nor the names of
-</span> 17 <span class="comment"> * its contributors may be used to endorse or promote products derived
-</span> 18 <span class="comment"> * from this software without specific prior written permission.
-</span> 19 <span class="comment"> *
-</span> 20 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-</span> 21 <span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-</span> 22 <span class="comment"> * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-</span> 23 <span class="comment"> * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-</span> 24 <span class="comment"> * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-</span> 25 <span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-</span> 26 <span class="comment"> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-</span> 27 <span class="comment"> * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-</span> 28 <span class="comment"> * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-</span> 29 <span class="comment"> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-</span> 30 <span class="comment"> * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-</span> 31 <span class="comment"> */</span>
- 32 <span class="comment">/*
-</span> 33 <span class="comment"> * ======== SysMin.xdc ========
-</span> 34 <span class="comment"> */</span>
- 35
- 36 <span class="xdoc">/*!
-</span> 37 <span class="xdoc"> * ======== SysMin ========
-</span> 38 <span class="xdoc"> *
-</span> 39 <span class="xdoc"> * Minimal implementation of `{<b>@link</b> ISystemSupport}`.
-</span> 40 <span class="xdoc"> *
-</span> 41 <span class="xdoc"> * This implementation provides a fully functional implementation of
-</span> 42 <span class="xdoc"> * all methods specified by `ISystemSupport`.
-</span> 43 <span class="xdoc"> *
-</span> 44 <span class="xdoc"> * The module maintains an internal buffer (with a configurable size)
-</span> 45 <span class="xdoc"> * that stores on the "output". When full, the data is over-written. When
-</span> 46 <span class="xdoc"> * `System_flush()` is called the characters in the internal buffer are
-</span> 47 <span class="xdoc"> * "output" using the user configuratble `{<b>@link</b> #outputFxn}`.
-</span> 48 <span class="xdoc"> *
-</span> 49 <span class="xdoc"> * As with all `ISystemSupport` modules, this module is the back-end for the
-</span> 50 <span class="xdoc"> * `{<b>@link</b> System}` module; application code does not directly call these
-</span> 51 <span class="xdoc"> * functions.
-</span> 52 <span class="xdoc"> */</span>
- 53 @Template(<span class="string">"./SysMin.xdt"</span>)
- 54 @ModuleStartup
- 55 <span class=key>module</span> SysMin <span class=key>inherits</span> xdc.runtime.ISystemSupport {
- 56
- 57 <span class=key>metaonly</span> <span class=key>struct</span> ModuleView {
- 58 Ptr outBuf;
- 59 UInt outBufIndex;
- 60 Bool getTime; <span class="comment">/* set to true for each new trace */</span>
- 61 Bool wrapped; <span class="comment">/* has the buffer wrapped */</span>
- 62 };
- 63
- 64 <span class=key>metaonly</span> <span class=key>struct</span> BufferEntryView {
- 65 String entry;
- 66 }
- 67
- 68 <span class="xdoc">/*!
-</span> 69 <span class="xdoc"> * ======== rovViewInfo ========
-</span> 70 <span class="xdoc"> * <b>@_nodoc</b>
-</span> 71 <span class="xdoc"> */</span>
- 72 @Facet
- 73 <span class=key>metaonly</span> <span class=key>config</span> xdc.rov.ViewInfo.Instance rovViewInfo =
- 74 xdc.rov.ViewInfo.create({
- 75 viewMap: [
- 76 [<span class="string">'Module'</span>,
- 77 {
- 78 type: xdc.rov.ViewInfo.MODULE,
- 79 viewInitFxn: <span class="string">'viewInitModule'</span>,
- 80 structName: <span class="string">'ModuleView'</span>
- 81 }
- 82 ],
- 83 [<span class="string">'OutputBuffer'</span>,
- 84 {
- 85 type: xdc.rov.ViewInfo.MODULE_DATA,
- 86 viewInitFxn: <span class="string">'viewInitOutputBuffer'</span>,
- 87 structName: <span class="string">'BufferEntryView'</span>
- 88 }
- 89 ]
- 90 ]
- 91 });
- 92
- 93 <span class="xdoc">/*!
-</span> 94 <span class="xdoc"> * ======== LINEBUFSIZE ========
-</span> 95 <span class="xdoc"> * Size (in MAUs) of the line buffer
-</span> 96 <span class="xdoc"> *
-</span> 97 <span class="xdoc"> * An internal line buffer of this size is allocated. All output is stored
-</span> 98 <span class="xdoc"> * in this internal buffer until a new line is output.
-</span> 99 <span class="xdoc"> */</span>
- 100 <span class=key>const</span> SizeT LINEBUFSIZE = 0x100;
- 101
- 102 <span class="xdoc">/*!
-</span> 103 <span class="xdoc"> * ======== bufSize ========
-</span> 104 <span class="xdoc"> * Size (in MAUs) of the output.
-</span> 105 <span class="xdoc"> *
-</span> 106 <span class="xdoc"> * An internal buffer of this size is allocated. All output is stored
-</span> 107 <span class="xdoc"> * in this internal buffer.
-</span> 108 <span class="xdoc"> *
-</span> 109 <span class="xdoc"> * If 0 is specified for the size, no buffer is created and ALL
-</span> 110 <span class="xdoc"> * tracing is disabled.
-</span> 111 <span class="xdoc"> */</span>
- 112 <span class=key>config</span> SizeT bufSize = 0x1000;
- 113
- 114 <span class="xdoc">/*!
-</span> 115 <span class="xdoc"> * ======== sectionName ========
-</span> 116 <span class="xdoc"> * Section where the internal character output buffer is placed
-</span> 117 <span class="xdoc"> *
-</span> 118 <span class="xdoc"> * The default is to have no explicit placement; i.e., the linker is
-</span> 119 <span class="xdoc"> * free to place it anywhere in the memory map.
-</span> 120 <span class="xdoc"> */</span>
- 121 <span class=key>metaonly</span> <span class=key>config</span> String sectionName = <span class=key>null</span>;
- 122
- 123 <span class="xdoc">/*!
-</span> 124 <span class="xdoc"> * ======== flushAtExit ========
-</span> 125 <span class="xdoc"> * Flush the internal buffer during `{<b>@link</b> #exit}` or `{<b>@link</b> #abort}`.
-</span> 126 <span class="xdoc"> *
-</span> 127 <span class="xdoc"> * If the application's target is a TI target, the internal buffer is
-</span> 128 <span class="xdoc"> * flushed via the `HOSTwrite` function in the TI C Run Time Support
-</span> 129 <span class="xdoc"> * (RTS) library.
-</span> 130 <span class="xdoc"> *
-</span> 131 <span class="xdoc"> * If the application's target is not a TI target, the internal buffer
-</span> 132 <span class="xdoc"> * is flushed to `stdout` via `fwrite(..., stdout)`.
-</span> 133 <span class="xdoc"> *
-</span> 134 <span class="xdoc"> * Setting this parameter to `false` reduces the footprint of the
-</span> 135 <span class="xdoc"> * application at the expense of not getting output when the application
-</span> 136 <span class="xdoc"> * ends via a `System_exit()`, `System_abort()`, `exit()` or `abort()`.
-</span> 137 <span class="xdoc"> */</span>
- 138 <span class=key>config</span> Bool flushAtExit = <span class=key>true</span>;
- 139
- 140 <span class="xdoc">/*!
-</span> 141 <span class="xdoc"> * ======== abort ========
-</span> 142 <span class="xdoc"> * Backend for `{<b>@link</b> System#abort()}`
-</span> 143 <span class="xdoc"> *
-</span> 144 <span class="xdoc"> * This abort function writes the string to the internal
-</span> 145 <span class="xdoc"> * output buffer and then gives all internal output to the
-</span> 146 <span class="xdoc"> * `{<b>@link</b> #outputFxn}` function if the `{<b>@link</b> #flushAtExit}`
-</span> 147 <span class="xdoc"> * configuration parameter is true.
-</span> 148 <span class="xdoc"> *
-</span> 149 <span class="xdoc"> * <b>@param(str)</b> message to output just prior to aborting
-</span> 150 <span class="xdoc"> *
-</span> 151 <span class="xdoc"> * If non-`NULL`, this string should be output just prior to
-</span> 152 <span class="xdoc"> * terminating.
-</span> 153 <span class="xdoc"> *
-</span> 154 <span class="xdoc"> * <b>@see</b> ISystemSupport#abort
-</span> 155 <span class="xdoc"> */</span>
- 156 <span class=key>override</span> Void abort(CString str);
- 157
- 158 <span class="xdoc">/*!
-</span> 159 <span class="xdoc"> * ======== exit ========
-</span> 160 <span class="xdoc"> * Backend for `{<b>@link</b> System#exit()}`
-</span> 161 <span class="xdoc"> *
-</span> 162 <span class="xdoc"> * This exit function gives all internal output to the
-</span> 163 <span class="xdoc"> * `{<b>@link</b> #outputFxn}` function if the `{<b>@link</b> #flushAtExit}`
-</span> 164 <span class="xdoc"> * configuration parameter is true.
-</span> 165 <span class="xdoc"> *
-</span> 166 <span class="xdoc"> * <b>@see</b> ISystemSupport#exit
-</span> 167 <span class="xdoc"> */</span>
- 168 <span class=key>override</span> Void exit(Int stat);
- 169
- 170 <span class="xdoc">/*!
-</span> 171 <span class="xdoc"> * ======== flush ========
-</span> 172 <span class="xdoc"> * Backend for `{<b>@link</b> System#flush()}`
-</span> 173 <span class="xdoc"> *
-</span> 174 <span class="xdoc"> * The `flush` writes the contents of the internal character buffer
-</span> 175 <span class="xdoc"> * via the `{<b>@link</b> #outputFxn}` function.
-</span> 176 <span class="xdoc"> *
-</span> 177 <span class="xdoc"> * <b>@a(Warning)</b>
-</span> 178 <span class="xdoc"> * The `{<b>@link</b> System}` gate is used for thread safety during the
-</span> 179 <span class="xdoc"> * entire flush operation, so care must be taken when flushing with
-</span> 180 <span class="xdoc"> * this `ISystemSupport` module. Depending on the nature of the
-</span> 181 <span class="xdoc"> * `System` gate, your application's interrupt latency
-</span> 182 <span class="xdoc"> * may become a function of the `bufSize` parameter!
-</span> 183 <span class="xdoc"> *
-</span> 184 <span class="xdoc"> * <b>@see</b> ISystemSupport#flush
-</span> 185 <span class="xdoc"> */</span>
- 186 <span class=key>override</span> Void flush();
- 187
- 188 <span class="xdoc">/*!
-</span> 189 <span class="xdoc"> * ======== putch ========
-</span> 190 <span class="xdoc"> * Backend for `{<b>@link</b> System#printf()}` and `{<b>@link</b> System#putch()}`
-</span> 191 <span class="xdoc"> *
-</span> 192 <span class="xdoc"> * Places the character into an internal buffer. The `{<b>@link</b> #flush}`
-</span> 193 <span class="xdoc"> * sends the internal buffer to the `{<b>@link</b> #outputFxn}` function.
-</span> 194 <span class="xdoc"> * The internal buffer is also sent to the `SysMin_outputFxn`
-</span> 195 <span class="xdoc"> * function by `{<b>@link</b> #exit}` and `{<b>@link</b> #abort}` if the
-</span> 196 <span class="xdoc"> * `{<b>@link</b> #flushAtExit}` configuration parameter is true.
-</span> 197 <span class="xdoc"> *
-</span> 198 <span class="xdoc"> * <b>@see</b> ISystemSupport#putch
-</span> 199 <span class="xdoc"> */</span>
- 200 <span class=key>override</span> Void putch(Char ch);
- 201
- 202 <span class="xdoc">/*!
-</span> 203 <span class="xdoc"> * ======== ready ========
-</span> 204 <span class="xdoc"> * Test if character output can proceed
-</span> 205 <span class="xdoc"> *
-</span> 206 <span class="xdoc"> * This function returns true if the internal buffer is non-zero.
-</span> 207 <span class="xdoc"> *
-</span> 208 <span class="xdoc"> * <b>@see</b> ISystemSupport#ready
-</span> 209 <span class="xdoc"> */</span>
- 210 <span class=key>override</span> Bool ready();
- 211
- 212 <span class=key>internal</span>:
- 213
- 214 <span class=key>struct</span> LineBuffer {
- 215 UInt lineidx; <span class="comment">/* index within linebuf to write next Char */</span>
- 216 Char linebuf[LINEBUFSIZE]; <span class="comment">/* local line buffer */</span>
- 217 }
- 218
- 219 <span class=key>struct</span> Module_State {
- 220 LineBuffer lineBuffers[]; <span class="comment">/* internal line buffers */</span>
- 221 Char outbuf[]; <span class="comment">/* the output buffer */</span>
- 222 UInt outidx; <span class="comment">/* index within outbuf to next Char to write */</span>
- 223 Bool getTime; <span class="comment">/* set to true for each new trace */</span>
- 224 Bool wrapped; <span class="comment">/* has the index (outidx) wrapped */</span>
- 225 UInt writeidx[]; <span class="comment">/* index to the last "\n" char */</span>
- 226 UInt readidx[]; <span class="comment">/* index to the last char read by external
-</span> 227 <span class="comment"> * observer */</span>
- 228 }
- 229 }
-</pre>
-</body></html>