alpha_params.c 2.75 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.
 *
 */


#include <stdlib.h>
#include "params.h"
#include "alpha.h"
#include "alpha_params.h"
#include "cpu_interface.h"
#include "annotations.h"
#include "tclsimos.h"
#include "tb.h"
#include "ev5.h"

void AlphaCommitAnnExec()
{
  AnnPtr ann;
  for (AnnFirst("commit", &ann); ann; AnnNext(&ann)) {
    AnnExec(ann);
  }
}



/* called from tcl_init.c:TCLInit */

struct AlphaConsoleParams alphaConsoleParams;
struct AlphaDebugParams alphaDebugParams;


char *
DTBAccess(ClientData clientData, Tcl_Interp *interp,
	  char *name1, char *name2, int flags)
{
  Tcl_SetVar(interp, "DTB", TBPrint(PE[CPUVec.CurrentCpuNum()]->tb, TB_DATA), TCL_GLOBAL_ONLY);
  return NULL;
}

extern char *
IPRAccess(ClientData clientData, Tcl_Interp *interp,
	  char *name1, char *name2, int flags);

void AlphaTclInit(void)
{
   ParamRegister("PARAM(ALPHA.BootNT)", (char *)&alphaConsoleParams.bootNT, 
                 PARAM_BOOLEAN);
   ParamRegister("PARAM(ALPHA.Files.PALCode)", (char *)&alphaConsoleParams.PALcodeFileName, 
                 PARAM_STRING);
   ParamRegister("PARAM(ALPHA.Files.Console)", (char *)&alphaConsoleParams.consoleFileName, 
                 PARAM_STRING);
   ParamRegister("PARAM(ALPHA.Files.Kernel)", (char *)&alphaConsoleParams.kernelFileName, 
                 PARAM_STRING);
   ParamRegister("PARAM(ALPHA.Files.NT_Firmware)", (char *)&alphaConsoleParams.NT_FirmwareFileName, 
                 PARAM_STRING);
   ParamRegister("PARAM(ALPHA.Files.NT_OSLoader)", (char *)&alphaConsoleParams.NT_OSLoaderFileName, 
                 PARAM_STRING);

   ParamRegister("PARAM(CPU.Alpha.Debug.Traps)", (char *)&alphaDebugParams.debugTraps, 
                 PARAM_INT);
   ParamRegister("PARAM(CPU.Alpha.Debug.Interrupts)", (char *)&alphaDebugParams.debugInterrupts, 
                 PARAM_INT);
   ParamRegister("PARAM(CPU.Alpha.Debug.TBInsert)", (char *)&alphaDebugParams.debugTBInsert, 
                 PARAM_INT);
   ParamRegister("PARAM(CPU.Alpha.Debug.VATranslation)", (char *)&alphaDebugParams.debugVATranslation, 
                 PARAM_INT);

   Tcl_SetVar2(TCLInterp, "IPR", "0", "0", TCL_GLOBAL_ONLY);
   Tcl_TraceVar(TCLInterp, "IPR",
                TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, 
                IPRAccess, NULL);
   Tcl_SetVar2(TCLInterp, "DTB", "0", "0", TCL_GLOBAL_ONLY);
   Tcl_TraceVar(TCLInterp, "DTB",
                TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, 
                DTBAccess, NULL); 

}


extern void AlphaTraceTclInit(Tcl_Interp *interp);

void
(*FFF)(Tcl_Interp *interp) = AlphaTraceTclInit;