/*****************************************************************************
 * Copyright (c) 1988-95 Digi International Inc., All Rights Reserved
 * 
 * This  software  contains  proprietary  and  confidential   information   of
 * Digi International  Inc.   By  accepting  transfer  of this copy, Recipient
 * agrees to retain this software in  confidence,  to  prevent  disclosure  to
 * others,  and  to make no  use of this software other than that for which it
 * was delivered.  This is an unpublished copyright work  Digi   International
 * Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is
 * strictly prohibited.
 * 
 * Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc.
 * Confidential  when   combined   with   the   aggregated  modules  for  this
 * product) OBJECT CODE ONLY SOURCE MATERIALS
 * 
 * (C) COPYRIGHT Digi International Inc. 1995
 * 
 * All Rights Reserved
 * 
 * US   Government   Users   Restricted   Rights   -   Use,   duplication   or
 * disclosure  restricted by GSA ADP Schedule Contract with Digi International
 * Inc.
 * 
 *****************************************************************************/

/********************************************************************
 ***  Debugger definitions needed by both C and assembly routines
 ***
 *** @(#) $Id: db.h,v 1.1 1997/09/15 21:10:37 gary Exp $
 ********************************************************************/

#if 1
#include "dbcocall.h"
#else  
/********************************************************************
 ***  Coroutine support.
 ********************************************************************/

BEGIN_STRUCT(cocall)
    S4(ulong,  co_start)		/* Start address */
    S4(ulong,  co_resume)		/* Procedure resume address */
    S4(ulong,  co_tstack)		/* Top of stack */
    S4(ulong,  co_stack)		/* Stack pointer */
    S4(ulong,  co_frame)		/* Frame pointer */
    S4A(ulong, co_save, 24)		/* S, T, & A registers */
END_STRUCT(cocall)


/********************************************************************
 ***  User context structure.
 ********************************************************************/

BEGIN_STRUCT(user)
    S4(  ulong, us_epc)			/* Exception program counter */
    S4(  ulong, us_status)		/* Status register */
    S4(  ulong, us_cause)		/* Exception cause register */
    S4(  int,   us_except)		/* Exception type */
    S4(  ulong, us_context)		/* Context Register */
    S4(  ulong, us_vaddr)		/* Bad Virtual Address */
    S4A( ulong, us_hilo, 2)		/* Multiply hi/lo registers */
    S4A( ulong, us_reg, 32)		/* User registers */
END_STRUCT(user)
#endif

/********************************************************************
 ***	Exception numbering.
 ********************************************************************/

#define EX_INT		0		/* Interrupt */
#define EX_MOD		1		/* TLB Modification */
#define EX_TLBL		2		/* TLB miss (load or fetch) */
#define EX_TLBS		3		/* TLB miss (store) */
#define EX_ADEL		4		/* Address error (load or fetch) */
#define EX_ADES		5		/* Address error (store) */
#define EX_IBE		6		/* Bus error (fetch) */
#define EX_DBE		7		/* Bus error (load or store) */
#define EX_SYS		8		/* Syscall */
#define EX_BP		9		/* Breakpoint */
#define EX_RI		10		/* Reserved instruction */
#define EX_CPU		11		/* Coprocessor unusable */
#define EX_OVF		12		/* Arithmetic overflow */

#define EX_UTLB		13		/* UTLB exception */

#define EX_ABORT	14		/* Break received */
#define EX_BOGUS	15		/* Program still running */
#define EX_PAUSE	16		/* Program pause requested */
#define EX_CHECK1	17		/* Text checksum error */
#define EX_CHECK2	18		/* Data checksum error */


/**********************************************************************
 ***  Miscellaneous stuff.
 **********************************************************************/

#define DLE 0x10			/* Message escape char */
#define SYN 0x16			/* Message start char */
