]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/sdo/ipc/gates/GatePeterson-src.html
Merge branch 'pasdk1_3_master' into prsdk_pa_demo_sync_external_git
[processor-sdk/performance-audio-sr.git] / psdk_cust / ipc_3_43_00_00_eng / docs / cdoc / ti / sdo / ipc / gates / GatePeterson-src.html
diff --git a/psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/sdo/ipc/gates/GatePeterson-src.html b/psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/sdo/ipc/gates/GatePeterson-src.html
deleted file mode 100644 (file)
index 8b2a072..0000000
+++ /dev/null
@@ -1,192 +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.sdo.ipc.gates.GatePeterson</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) 2012-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"> *  ======== GatePeterson.xdc ========
-</span>    34    <span class="comment"> *
-</span>    35    <span class="comment"> */</span>
-    36    
-    37    <span class=key>package</span> ti.sdo.ipc.gates;
-    38    
-    39    import xdc.runtime.Error;
-    40    import xdc.runtime.Assert;
-    41    import xdc.runtime.IGateProvider;
-    42    import xdc.runtime.Diags;
-    43    import xdc.runtime.Log;
-    44    import xdc.rov.ViewInfo;
-    45    
-    46    import ti.sdo.utils.MultiProc;
-    47    import ti.sdo.ipc.Ipc;
-    48    
-    49    import ti.sdo.ipc.interfaces.IGateMPSupport;
-    50    
-    51    <span class="xdoc">/*!
-</span>    52    <span class="xdoc"> *  ======== GatePeterson ========
-</span>    53    <span class="xdoc"> *  IGateMPSupport gate based on the Peterson algorithm
-</span>    54    <span class="xdoc"> *
-</span>    55    <span class="xdoc"> *  This module implements the {<b>@link</b> ti.sdo.ipc.interfaces.IGateMPSupport}
-</span>    56    <span class="xdoc"> *  interface using the Peterson Algorithm in shared memory. This
-</span>    57    <span class="xdoc"> *  implementation works for only 2 processors.
-</span>    58    <span class="xdoc"> *
-</span>    59    <span class="xdoc"> *  Each GatePeterson instance requires a small piece of
-</span>    60    <span class="xdoc"> *  shared memory.  The base address of this shared memory is specified as
-</span>    61    <span class="xdoc"> *  the 'sharedAddr' argument to the create. The amount of shared memory
-</span>    62    <span class="xdoc"> *  consumed by a single instance can be obtained using the
-</span>    63    <span class="xdoc"> *  {<b>@link</b> #sharedMemReq} call.
-</span>    64    <span class="xdoc"> *
-</span>    65    <span class="xdoc"> *  Shared memory has to conform to the following specification.  Padding is
-</span>    66    <span class="xdoc"> *  added between certain elements in shared memory if cache alignment is
-</span>    67    <span class="xdoc"> *  required for the region in which the instance is placed.
-</span>    68    <span class="xdoc"> *
-</span>    69    <span class="xdoc"> *  <b>@p(code)</b>
-</span>    70    <span class="xdoc"> *
-</span>    71    <span class="xdoc"> *              shmBaseAddr -&gt; --------------------------- bytes
-</span>    72    <span class="xdoc"> *                             |  version                | 4
-</span>    73    <span class="xdoc"> *              (Attrs struct) |  creatorProcId          | 2
-</span>    74    <span class="xdoc"> *                             |  openerProcId           | 2
-</span>    75    <span class="xdoc"> *                             |  (PADDING if aligned)   |
-</span>    76    <span class="xdoc"> *                             |-------------------------|
-</span>    77    <span class="xdoc"> *                             |  flag[0]                | 2
-</span>    78    <span class="xdoc"> *                             |  (PADDING if aligned)   |
-</span>    79    <span class="xdoc"> *                             |-------------------------|
-</span>    80    <span class="xdoc"> *                             |  flag[1]                | 2
-</span>    81    <span class="xdoc"> *                             |  (PADDING if aligned)   |
-</span>    82    <span class="xdoc"> *                             |-------------------------|
-</span>    83    <span class="xdoc"> *                             |  turn                   | 2
-</span>    84    <span class="xdoc"> *                             |  (PADDING if aligned)   |
-</span>    85    <span class="xdoc"> *                             |-------------------------|
-</span>    86    <span class="xdoc"> *  <b>@p</b>
-</span>    87    <span class="xdoc"> */</span>
-    88    @InstanceInitError
-    89    @InstanceFinalize
-    90    
-    91    <span class=key>module</span> GatePeterson <span class=key>inherits</span> IGateMPSupport
-    92    {
-    93        <span class="xdoc">/*! <b>@_nodoc</b> */</span>
-    94        <span class=key>metaonly</span> <span class=key>struct</span> BasicView {
-    95            String  objType;
-    96            Ptr     localGate;
-    97            UInt    nested;
-    98            UInt    creatorProcId;
-    99            UInt    openerProcId;
-   100            String  gateOwner;
-   101        }
-   102    
-   103        <span class="xdoc">/*! <b>@_nodoc</b> */</span>
-   104        @Facet
-   105        <span class=key>metaonly</span> <span class=key>config</span> ViewInfo.Instance rovViewInfo =
-   106            ViewInfo.create({
-   107                viewMap: [
-   108                    [<span class="string">'Basic'</span>,
-   109                        {
-   110                            type: ViewInfo.INSTANCE,
-   111                            viewInitFxn: <span class="string">'viewInitBasic'</span>,
-   112                            structName: <span class="string">'BasicView'</span>
-   113                        }
-   114                    ],
-   115                ]
-   116            });
-   117    
-   118        <span class="xdoc">/*!
-</span>   119    <span class="xdoc">     *  ======== E_gateRemotelyOpened ========
-</span>   120    <span class="xdoc">     *  Error raised when gate cannot be opened because of the opener's ID
-</span>   121    <span class="xdoc">     *
-</span>   122    <span class="xdoc">     *  Error raised in {<b>@link</b> #open} when trying to remotely open a
-</span>   123    <span class="xdoc">     *  GatePeterson instance whose configured opener processor Id does
-</span>   124    <span class="xdoc">     *  not match that of the opener's MultiProc id. but it has already been
-</span>   125    <span class="xdoc">     *  opened/created on two other processors.  GatePeterson only works with
-</span>   126    <span class="xdoc">     *  two processors.
-</span>   127    <span class="xdoc">     */</span>
-   128        <span class=key>config</span> Error.Id E_gateRemotelyOpened  = {
-   129            msg: <span class="string">"E_gateRemotelyOpened: Gate already in use by two other processors: creator: %d, opener: %d"</span>
-   130        };
-   131    
-   132        <span class="xdoc">/*!
-</span>   133    <span class="xdoc">     *  ======== numInstances ========
-</span>   134    <span class="xdoc">     *  Maximum number of instances supported by the GatePeterson module
-</span>   135    <span class="xdoc">     */</span>
-   136        <span class=key>config</span> UInt numInstances = 512;
-   137    
-   138    <span class=key>instance</span>:
-   139    
-   140        <span class="xdoc">/*!
-</span>   141    <span class="xdoc">     *  <b>@_nodoc</b>
-</span>   142    <span class="xdoc">     *  ======== enter ========
-</span>   143    <span class="xdoc">     *  Enter this gate
-</span>   144    <span class="xdoc">     */</span>
-   145        @DirectCall
-   146        <span class=key>override</span> IArg enter();
-   147    
-   148        <span class="xdoc">/*!
-</span>   149    <span class="xdoc">     *  <b>@_nodoc</b>
-</span>   150    <span class="xdoc">     *  ======== leave ========
-</span>   151    <span class="xdoc">     *  Leave this gate
-</span>   152    <span class="xdoc">     */</span>
-   153        @DirectCall
-   154        <span class=key>override</span> Void leave(IArg key);
-   155    
-   156    <span class=key>internal</span>:
-   157    
-   158        <span class="comment">/* Used for the 'flag' in shared memory */</span>
-   159        <span class=key>const</span> UInt32 FREE = 0;
-   160        <span class=key>const</span> UInt32 BUSY = 1;
-   161    
-   162        <span class="comment">/* Stored in shared memory */</span>
-   163        <span class=key>struct</span> Attrs {
-   164            Bits16   creatorProcId;
-   165            Bits16   openerProcId;
-   166        };
-   167    
-   168        <span class="comment">/* initializes shared memory */</span>
-   169        Void postInit(Object *obj);
-   170    
-   171        <span class=key>struct</span> Instance_State {
-   172            Attrs           *attrs;
-   173            volatile Bits16 *flag[2];
-   174            volatile Bits16 *turn;
-   175            UInt16          selfId;
-   176            UInt16          otherId;
-   177            UInt            nested;    <span class="comment">/* For nesting */</span>
-   178            IGateProvider.Handle localGate;
-   179            Ipc.ObjType     objType;
-   180            SizeT           cacheLineSize;
-   181            Bool            cacheEnabled;
-   182        };
-   183    }
-</pre>
-</body></html>