export.h 2.4 KB
/*
 * Copyright (C) 1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * Copyright (C) 1998 Digital Equipment Corporation
 *
 * This file is part of the SimOS distribution.
 * See LICENSE file for terms of the license.
 *
 */

#ifndef _EXPORT_H_
#define _EXPORT_H_

/*
 * Definitions of exported global variables.
 */

#include <stdio.h>
#include "event.h"
#include "macros.h"

/* The maximum number of processes that can be simulated. This is used
 * to allocate space. This value can be changed with the "-p" command
 * line option up to a maximum of MAXPROC.
 */
extern int max_nprocs;

/* The absolute maximum number of processes that can be simulated. */
#define MAXPROC 256

/* the number of existing processes */
extern int nprocs;

/* the maximum process id ever used (process ids start at zero) */
extern int max_pid;

/*
 * The file descriptor used by AINT for its output. Can be assigned by
 * the user program. Defaults to stderr. If NULL, no output from MINT
 * is generated.
 */
extern FILE *aint_output;

/*
 * Ckpoint_freq controls the frequency of calls to sim_checkpoint().
 * This can be set on the command line as well as changed by the user while
 * the program is running. If set to zero, no further calls to sim_checkpoint()
 * will occur.
 */
extern unsigned int ckpoint_freq;

/* If true, then the simulator must supply a value on a read by using
 * the pointer "value" in the event structure to write the value that
 * should be used. On a write, the "value" pointer points to the value
 * being written by the object program. This flag is set by the "-V"
 * command line option.
 *
 extern int Verify_protocol; */

/* If true, then the simulator must explicitly release a lock or
 * semaphore by calling RC_unlock() and RC_vsema().
 *
 extern int Release_consist; */

/* If true, then a connection to a remote client has been established 
   extern int Connection_established; */

/* If true, then an optimization is enabled where the back-end function
 * prmcache_read() is called to determined if a reschedule should occur.
 * An event pointer is passed in as the only argument. A return value
 * of 0 means "no reschedule"; any other return value means "reschedule".
 * Similarly for prmcache_write(). These variables default to zero and
 * must be set to 1 in sim_init() in order to enable this optimization.
 *
 extern int Use_prmcache_read;
 extern int Use_prmcache_write; */

#endif /* _EXPORT_H_ */