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     *  ======== SemProcess.xdc ========
    15     */
    16    
    17    import xdc.runtime.Error;
    18    import xdc.runtime.knl.ISemaphore;
    19    import xdc.runtime.knl.ISemProcessSupport;
    20    
    21    /*!
    22     *  ======== SemProcess ========
    23     *  SemProcess Manager
    24     *
    25     *  This module manages multi-process semaphores through its proxy
    26     *  ISemProcessSupport interface. It has a module wide config parameter 
    27     *  {@link #Proxy} which needs to be bound to an OS specific delegate before 
    28     *  this module can be used.
    29     *  
    30     *  Here is an example showing how the proxy is bound to an BIOS 6.x specific 
    31     *  delegate.
    32     *   
    33     *  @p(code)
    34     *  var SemProcess = xdc.useModule('xdc.runtime.knl.SemProcess');
    35     *  SemProcess.Proxy = xdc.useModule('ti.sysbios.xdcruntime.SemProcessSupport');
    36     *  @p
    37     *
    38     *  Typically the package containing the delegates have a Settings module that 
    39     *  will bind all {@link xdc.runtime.knl} proxies. The following
    40     *  example sets up all the xdc.runtime.knl proxies.
    41     *  
    42     *  @p(code)
    43     *  xdc.useModule("ti.sysbios.xdcruntime.Settings");
    44     *  @p  
    45     */
    46    
    47    @InstanceInitError      /* because initialization can fail */
    48    @InstanceFinalize       /* have to Semaphore_Proxy_delete(sem) on delete */
    49    
    50    module SemProcess inherits ISemaphore
    51    {
    52        
    53        /*! Proxy that needs to be bound to an OS specific delegate. */
    54        proxy Proxy inherits ISemProcessSupport;
    55    
    56    instance:
    57        
    58       /*!
    59        *  ======== create ========
    60        *  Create a SemProcess object
    61        *
    62        *  This function creates a new `SemProcess` object which is initialized to
    63        *  count.  All semaphores created with the same key reference the same
    64        *  underlying synchronization object and work between processes.
    65        *
    66        *  @param(count)    initial semaphore count
    67        *  @param(key)      globally unique key for SysV-style semaphore
    68        */
    69        create(Int count, UInt32 key);
    70    
    71    internal:
    72    
    73        struct Instance_State {
    74            Proxy.Handle proxyHandle;
    75        }
    76    }
    77    /*
    78     *  @(#) xdc.runtime.knl; 1, 0, 0,181; 2-10-2012 10:18:54; /db/ztree/library/trees/xdc/xdc-y21x/src/packages/
    79     */
    80