mipsy.h 1.78 KB
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */

/*****************************************************************
 * mipsy.h
 *
 * Author: $Author: blythe $
 * Date:   $Date: 2002/05/29 01:09:10 $
 ****************************************************************/

#ifndef _MIPSY_H
#define _MIPSY_H

#include "sim_error.h"
#include "simtypes.h"
#include "../shared/cpu_state.h"
/* Global Functions */
extern void MipsyEarlyInit(void);
extern void MipsyInit(void);
extern void MipsyRun(int swtch);
extern void MipsyExit(CPUType exitTo);
extern void MipsyReissueUncachedOp(int cpuNum);
extern void MipsyResetStats(void);

extern SimTime mipsyCurrentTime;
#define   MipsyReadTime(_cpu)      (mipsyCurrentTime)

/* Macros for dealing with Mipsy's time */
#define MIPSY_ADD_TIME(_cpu, _amt)	(MipsyReadTime(_cpu) += _amt)
#define MIPSY_SET_TIME(_cpu, _amt)      (MipsyReadTime(_cpu) = _amt)

#include "syslimits.h"
#define MIPSY_MAX_CPUS        SIM_MAXCPUS

extern CPUState *PE;
extern CPUState *pePtr[];

/* support for debugging.  These definitions are the interface between
 * cpu.c (which checks mipsy_break_nexti on each cycle) and simos_interface.c
 * (which interacts with simos debugging support).
 */

/* returns nonzero if need to reload from new PC or changed contents of *PC */
extern int MipsyDebug(int cpunum, int is_break_instruction);
extern int mipsy_debug_mode;      /* nonzero if debugger enabled */
extern int mipsy_sigusr;
extern int mipsy_break_nexti;     /* set to number of cpu to do a breakpoint on,
				   * or to one of two special values:
				   */
#define MIPSY_NOBREAK      (-2)
#define MIPSY_BREAKANYCPU  (-1)

#endif /* _MIPSY_H */