ev5.h 2.2 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 EV5_H
#define EV5_H

#ifndef IMPLVER_EV4_FAMILY
#define IMPLVER_EV4_FAMILY      0               /* LCA/EV4/EV45 */
#endif
#ifndef IMPLVER_EV5_FAMILY
#define IMPLVER_EV5_FAMILY      1               /* EV5/EV56 */
#endif
#ifndef IMPLVER_EV6_FAMILY
#define IMPLVER_EV6_FAMILY      2               /* EV6 */
#endif

#undef DEBUG_DELTA_MMSTAT

typedef enum {
   ACCESS_KERNEL=0,
   ACCESS_KERNEL_SP0,
   ACCESS_KERNEL_SP1,
   ACCESS_KERNEL_SP01,
   ACCESS_SUPERVISOR,
   ACCESS_EXECUTIVE,
   ACCESS_USER,
   ACCESS_PAL ,  /* unused for I, could use it for D (not now)*/
   NUM_QC_MODES } AccessModes;
   

extern AlphaTrapState *allocTrapState(AlphaTrapState *oldtrapstate);
extern void freeTrapState(AlphaTrapState *trapstate);
extern AlphaTrapState *initTrapState(AlphaTrapState *newTrapState, AlphaTrapState *oldtrapstate);
extern void EV5_InitPE(AlphaState *pe, int cpuNum);

extern MMUStatus EV5_ITranslateVirtual(AlphaState *P, PA *pAddr, int trapNow);
extern MMUStatus EV5_DTranslateVirtual(AlphaState *P, VA vA, int isWrite, int trapNow, PA *pAddr);

extern Reg  EV5_MoveFromPriv(AlphaState *P, int priv);
extern void EV5_MoveToPriv(AlphaState *P, int priv, Reg val);

extern int EV5_CheckForInterrupts(AlphaState *P, const char *where);

extern void EV5_PALOpcode(AlphaState *P, Reg func);
extern void EV5_HwRei(AlphaState *P);
extern MMUStatus EV5_HW_Store(AlphaState *P, uint32 instr, Reg rbv, PA*, int *size);
extern MMUStatus EV5_HW_Load (AlphaState *P,  uint32 instr, Reg rbv, PA*, int *size);
extern void EV5_MiscReadClearSet(AlphaState *P, Reg *rap,int set);

extern int  EV5_SetExtInterrupt(AlphaState *P, int irq);
extern void EV5_ClearExtInterrupt(AlphaState *P, int irq);

extern void EV5_UpdateQCMode(AlphaState *, int type);
extern void EV5_UpdateQCAltMode(AlphaState *, int type);

extern int EV5_ShadowRegistersUsed(AlphaState *P, VA PC);
extern void EV5_SwitchShadowRegisters(AlphaState *P, Reg newPC, Reg newICSR);

extern void EV5_Trap(AlphaState *P, int trap);

#endif