rspctl.h 3.12 KB

/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1994, Silicon Graphics, Inc.               *
 *                                                                        *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *                                                                        *
 *************************************************************************/

/*
 * File:	rspctl.h
 * Creator:	hsa@sgi.com
 * Create Date:	Wed Feb  9 09:33:23 PST 1994
 *
 */

#ifndef _rsp_rspctl_h_
#define _rsp_rspctl_h_ 1

/*
 * The RSP clock.
 */
extern u32	rsp_clock;

/*
 * The RSP PC, points into the instruction cache.
 */
extern u32	rsp_programCounter;

/*
 * The RSP control register, accessible to the host processor.
 */
#define rsp_CtlHaltMask	SP_STATUS_HALT	/* for backwards-compatability */
/* these are in rcp.h */

extern u32	rsp_controlReg;

/*
 * RSP step functions, implemented in each module, they execute one clock
 * step. Each module installs these during their own init.
 */
typedef boolean (*rsp_stepProc_t)(void);

#define rsp_STEP_PROC_MAX	128

extern rsp_stepProc_t	rsp_procStepProcs[rsp_STEP_PROC_MAX];

/*
 * reset processor state.
 */
extern void	rsp_ProcessorReset(int pc);

/*
 * RSP control logic initialize.
 */
extern void	rsp_ProcessorInit(void);

/*
 * This function is called form other modules, it installs
 * a 'step' routine, that will be executed once per clock tick.
 */
extern void	rsp_ProcessorStepInstall(rsp_stepProc_t StepProc);

/*
 * This function is called to install a breakpoint at the
 * specified address or clock value.
 */
extern void	rsp_ProcessorBreakpointInstall(u32 where, boolean isAddr);

/*
 * enable (or disable) a breakpoint.
 */
extern void	rsp_ProcessorBreakpointEnable(int bp, boolean doEnable);

/*
 * init breakpoint commands.
 */
extern void	rsp_ProcessorBreakpointCmdInit(int bp);

/*
 * install a command at a breakpoint.
 */
extern void	rsp_ProcessorBreakpointCmdInstall(int bp, char *string);

/*
 * list out all the breakpoints.
 */
extern void	rsp_ProcessorBreakpointList(FILE *out);

/*
 * This function is called to install a memory watchpoint at the
 * specified address.
 */
extern void	rsp_ProcessorWatchpointInstall(u32 where);

extern boolean	rsp_ProcessorSlip(boolean doClock);
/*
 * Step RSP one clock tick.
 */
extern boolean	rsp_ProcessorStep(void);

/*
 * Step RSP one instruction.
 */
extern boolean	rsp_ProcessorSStep(void);

/*
 * Run RSP (until breakpoint or completion)
 */
extern void	rsp_ProcessorRun(void);

/*
 * this function sets the value when a jump/branch
 * needs to set the PC.
 */
extern void	rsp_PCSet(u32 addr, int clockDelay);

extern boolean	rsp_SULockReg(int reg);
extern boolean	rsp_SURegIsLocked(int reg);


#endif