1    /* 
     2     *  Copyright (c) 2008 Texas Instruments. All rights reserved. 
     3     *  This program and the accompanying materials are made available under the 
     4     *  terms of the Eclipse Public License v1.0 and Eclipse Distribution License
     5     *  v. 1.0 which accompanies this distribution. The Eclipse Public License is
     6     *  available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
     7     *  Distribution License is available at 
     8     *  http://www.eclipse.org/org/documents/edl-v10.php.
     9     *
    10     *  Contributors:
    11     *      Texas Instruments - initial implementation
    12     * */
    13    /*
    14     *  ======== IGateProcessSupport.xdc ========
    15     */
    16    
    17    import xdc.runtime.Error;
    18    
    19    /*!
    20     *  ======== IGateProcessSupport ========
    21     *  Interface for OS specific back-end.
    22     *
    23     *  The {@link xdc.runtime.knl} package contains modules that provide typical
    24     *  OS services. These xdc.runtime.knl modules require proxies to be
    25     *  bound to an OS specific delegate. This specifies the interface to 
    26     *  be implemented by the OS specific delegate for 
    27     *  {@link xdc.runtime.knl#GateProcess} module.
    28     *  
    29     *  The implementation of IGateThreadSupport should try to implement a gate
    30     *  that supports priority inversion.
    31     */
    32    interface IGateProcessSupport inherits IGateThreadSupport
    33    {
    34    
    35        /*! Status returned by {@link #getReferenceCount} when there is an error */
    36        const Int GETREFCOUNT_FAILED = -1;
    37    
    38    instance:
    39    
    40        config Int key = -1; /*! globally unique key for SysV-style semaphore */
    41    
    42       /*!
    43        *  ======== create ========
    44        *  Create a GateProcess object.
    45        *
    46        *  This function creates a new `GateProcess` object which is initialized to
    47        *  count.  All gates created with the same key reference the same
    48        *  underlying synchronization object and work between processes.  The
    49        *  underlying synchronization object should be automatically deleted when
    50        *  all references to it have been deleted, and the reference count should
    51        *  An implementation for a platform on which this is technically impossible
    52        *  (e.g. an operating system that does not support multiple processes) may
    53        *  provide a 'toy' implemenation with behavior matching that of
    54        *  IGateProcessSupport.
    55        */
    56        override create();
    57    
    58        /*!
    59         *  ======== getReferenceCount ========
    60         *  Get the number of processes with references to this Gate.
    61         *
    62         *  @param(err)     Pointer to Error.Block
    63         *  @a(returns)     Returns the number of processes that possess a 
    64         *          reference to this gate, or GETREFCOUNT_FAILED if an 
    65         *          error occured.  
    66         *                  A 'toy' implementation should always return 0.
    67         */
    68        Int getReferenceCount(Error.Block* err);
    69    
    70    }
    71    /*
    72     *  @(#) xdc.runtime.knl; 1, 0, 0,195; 9-20-2012 15:02:06; /db/ztree/library/trees/xdc/xdc-y36x/src/packages/
    73     */
    74