OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [osf-share/] [cma_init.h] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/*
/*
 * (c) Copyright 1990-1996 OPEN SOFTWARE FOUNDATION, INC.
 * (c) Copyright 1990-1996 OPEN SOFTWARE FOUNDATION, INC.
 * (c) Copyright 1990-1996 HEWLETT-PACKARD COMPANY
 * (c) Copyright 1990-1996 HEWLETT-PACKARD COMPANY
 * (c) Copyright 1990-1996 DIGITAL EQUIPMENT CORPORATION
 * (c) Copyright 1990-1996 DIGITAL EQUIPMENT CORPORATION
 * (c) Copyright 1991, 1992 Siemens-Nixdorf Information Systems
 * (c) Copyright 1991, 1992 Siemens-Nixdorf Information Systems
 * To anyone who acknowledges that this file is provided "AS IS" without
 * To anyone who acknowledges that this file is provided "AS IS" without
 * any express or implied warranty: permission to use, copy, modify, and
 * any express or implied warranty: permission to use, copy, modify, and
 * distribute this file for any purpose is hereby granted without fee,
 * distribute this file for any purpose is hereby granted without fee,
 * provided that the above copyright notices and this notice appears in
 * provided that the above copyright notices and this notice appears in
 * all source code copies, and that none of the names listed above be used
 * all source code copies, and that none of the names listed above be used
 * in advertising or publicity pertaining to distribution of the software
 * in advertising or publicity pertaining to distribution of the software
 * without specific, written prior permission.  None of these organizations
 * without specific, written prior permission.  None of these organizations
 * makes any representations about the suitability of this software for
 * makes any representations about the suitability of this software for
 * any purpose.
 * any purpose.
 */
 */
/*
/*
 *      Header file for CMA initialization
 *      Header file for CMA initialization
 */
 */
 
 
#ifndef CMA_INIT
#ifndef CMA_INIT
#define CMA_INIT
#define CMA_INIT
 
 
/*
/*
 *  INCLUDE FILES
 *  INCLUDE FILES
 */
 */
#include <dce/cma_host.h>
#include <dce/cma_host.h>
#include <cma_errors.h>
#include <cma_errors.h>
 
 
/*
/*
 * CONSTANTS AND MACROS
 * CONSTANTS AND MACROS
 */
 */
 
 
#define cma__c_env_maxattr      0
#define cma__c_env_maxattr      0
#define cma__c_env_minattr      1
#define cma__c_env_minattr      1
#define cma__c_env_maxcond      2
#define cma__c_env_maxcond      2
#define cma__c_env_mincond      3
#define cma__c_env_mincond      3
#define cma__c_env_maxmutex     4
#define cma__c_env_maxmutex     4
#define cma__c_env_minmutex     5
#define cma__c_env_minmutex     5
#define cma__c_env_maxthread    6
#define cma__c_env_maxthread    6
#define cma__c_env_minthread    7
#define cma__c_env_minthread    7
#define cma__c_env_maxcluster   8
#define cma__c_env_maxcluster   8
#define cma__c_env_mincluster   9
#define cma__c_env_mincluster   9
#define cma__c_env_maxvp        10
#define cma__c_env_maxvp        10
#define cma__c_env_multiplex    11
#define cma__c_env_multiplex    11
#define cma__c_env_trace        12
#define cma__c_env_trace        12
#define cma__c_env_trace_file   13
#define cma__c_env_trace_file   13
 
 
#define cma__c_env_count        13
#define cma__c_env_count        13
 
 
 
 
/*
/*
 * cma__int_init
 * cma__int_init
 *
 *
 * Initialize the main body of CMA exactly once.
 * Initialize the main body of CMA exactly once.
 *
 *
 * We raise an exception if, for some odd reason, there are already threads
 * We raise an exception if, for some odd reason, there are already threads
 * in the environment (e.g. kernel threads), and one of them is trying to
 * in the environment (e.g. kernel threads), and one of them is trying to
 * initialize CMA before the  first thread got all the way through the actual
 * initialize CMA before the  first thread got all the way through the actual
 * initialization. This code maintains the invariants: "after successfully
 * initialization. This code maintains the invariants: "after successfully
 * calling CMA_INIT, you can call any CMA function", and  "CMA is actually
 * calling CMA_INIT, you can call any CMA function", and  "CMA is actually
 * initialized at most once".
 * initialized at most once".
 */
 */
/*#ifndef _HP_LIBC_R */
/*#ifndef _HP_LIBC_R */
 
 
#if  defined _HP_LIBC_R  ||(defined(SNI_SVR4) && !defined(CMA_INIT_NEEDED))
#if  defined _HP_LIBC_R  ||(defined(SNI_SVR4) && !defined(CMA_INIT_NEEDED))
# define cma__int_init()
# define cma__int_init()
#else
#else
# define cma__int_init() { \
# define cma__int_init() { \
    if (!cma__tac_isset(&cma__g_init_started)) { \
    if (!cma__tac_isset(&cma__g_init_started)) { \
        if (!cma__test_and_set (&cma__g_init_started)) { \
        if (!cma__test_and_set (&cma__g_init_started)) { \
            cma__init_static (); \
            cma__init_static (); \
            cma__test_and_set (&cma__g_init_done); \
            cma__test_and_set (&cma__g_init_done); \
            } \
            } \
        else if (!cma__tac_isset (&cma__g_init_done)) { \
        else if (!cma__tac_isset (&cma__g_init_done)) { \
            cma__error (cma_s_inialrpro); \
            cma__error (cma_s_inialrpro); \
    }}}
    }}}
#endif
#endif
 
 
/*
/*
 * TYPEDEFS
 * TYPEDEFS
 */
 */
 
 
typedef enum CMA__T_ENV_TYPE {
typedef enum CMA__T_ENV_TYPE {
    cma__c_env_type_int,
    cma__c_env_type_int,
    cma__c_env_type_file
    cma__c_env_type_file
    } cma__t_env_type;
    } cma__t_env_type;
 
 
typedef struct CMA__T_ENV {
typedef struct CMA__T_ENV {
    char                *name;          /* Name of environment variable */
    char                *name;          /* Name of environment variable */
    cma__t_env_type     type;           /* Type of variable */
    cma__t_env_type     type;           /* Type of variable */
    cma_t_integer       value;          /* Numeric value of the variable */
    cma_t_integer       value;          /* Numeric value of the variable */
    } cma__t_env;
    } cma__t_env;
 
 
/*
/*
 *  GLOBAL DATA
 *  GLOBAL DATA
 */
 */
 
 
extern cma__t_env               cma__g_env[cma__c_env_count];
extern cma__t_env               cma__g_env[cma__c_env_count];
extern cma__t_atomic_bit        cma__g_init_started;
extern cma__t_atomic_bit        cma__g_init_started;
extern cma__t_atomic_bit        cma__g_init_done;
extern cma__t_atomic_bit        cma__g_init_done;
extern char                     *cma__g_version;
extern char                     *cma__g_version;
 
 
/*
/*
 * INTERNAL INTERFACES
 * INTERNAL INTERFACES
 */
 */
 
 
extern void
extern void
cma__init_static (void);        /* Initialize static data */
cma__init_static (void);        /* Initialize static data */
 
 
#if _CMA_OS_ != _CMA__VMS
#if _CMA_OS_ != _CMA__VMS
extern void cma__init_atfork (void);
extern void cma__init_atfork (void);
#endif
#endif
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.