/*****************************************************************************
 * 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.
 * 
 *****************************************************************************/

/***********************************************************
 ***  Standard Register Definitions.
 ***
 ***  @(#) $Id: reg.h,v 1.8 1996/08/12 20:37:11 gary Exp $
 ***********************************************************/
#if ARNET
/*
	05/20/92 robertl for danmc
		add macros for WORD, WORDA, VWORD
	08/09/93 robertl
		Finalize extentions for GNU environment.
*/
#endif

#define	v0	$2
#define	v1	$3

#define a0	$4
#define a1	$5
#define a2	$6
#define a3	$7

#define	t0	$8
#define	t1	$9
#define	t2	$10
#define	t3	$11
#define	t4	$12
#define	t5	$13
#define	t6	$14
#define	t7	$15

#define	s0	$16
#define	s1	$17
#define	s2	$18
#define	s3	$19
#define	s4	$20
#define	s5	$21
#define	s6	$22
#define	s7	$23

#define	t8	$24
#define	t9	$25

#define	k0	$26
#define	k1	$27

#define	gp	$28
#define	sp	$29
#define	fp	$30
#define	ra	$31

/**************************************************************
 ***  3051 Control Processor definitions.
 **************************************************************/

#define	c0_index	$0
#define	c0_random	$1
#define	c0_entrylo	$2
#define	c0_context	$4
#define	c0_vaddr	$8
#define	c0_entryhi	$10
#define	c0_status	$12
#define	c0_cause	$13
#define	c0_epc		$14
#define	c0_prid		$15


/***************************************************************
 ***  Defines to share structures between C and Assembly
 ***************************************************************/

#define MO(t,a)		(a)
#define VMO(t,a)	(a)

#if __ASSEMBLER__ /* If GNU Assembler __GNUAS__  */
	/*
	 * The GNU assembler (GAS) does not have support for .struct,
	 * so we emulate it it by doing this...
	 * .bss
	 *  bogus variable = . (current address)
	 * .byte
	 * structure_member_1 = . - bogus_variable
	 * .word
	 * structure_member_2 = . - bogus_variable
	 * ....and so on....
	 */

# define	BEGIN_STRUCT(x)	.bss ; __StRuCtuRe = . ; .align 0;

# define	S1(t,x)		x = . - __StRuCtuRe ; .byte 0 
# define	S2(t,x)		x = . - __StRuCtuRe ; .half 0 
# define	S4(t,x)		x = . - __StRuCtuRe ; .word 0 

# define S1A(t,x,n)	x = . - __StRuCtuRe ; .byte 0 :n ;
# define S2A(t,x,n)	x = . - __StRuCtuRe ; .half 0 :n ;
# define S4A(t,x,n)	x = . - __StRuCtuRe ; .word 0 :n ; 

# define WORD(x)		x = . - __StRuCtuRe ; .word 0
# define WORDA(x,n)	x = . - __StRuCtuRe ; .word 0 :n
# define VWORD(x)	x = . - __StRuCtuRe ; .word 0
# define	END_STRUCT	.data ; .align 2

#else
#define	BEGIN_STRUCT(x)	.struct 0
#define S1A(t,x,n)	x: .byte 0:n
#define S2A(t,x,n)	x: .half 0:n
#define S4A(t,x,n)	x: .word 0:n
#define WORD(x)		x: .word 0
#define WORDA(x,n)	x: .word 0:n
#define VWORD(x)	x: .word 0
#define	S1(t,x)		x: .byte 0
#define	S2(t,x)		x: .half 0
#define	S4(t,x)		x: .word 0
#define	END_STRUCT	.data
#endif



#define HERE \
	li fp,__LINE__ ; sw fp,0x83000010 ; li fp,0

/* memory size */
#if PRI
/*
 * This leaves enough room for four MUNICH32 control vector pointers,
 * just in case the platform becomes "super-stuffed" in the future.
 */
#define	dpstackloc	0x833fffec
#else
#ifdef PCI
#define	dpstackloc	0x831ffffc
#else
#ifdef TWOMEG
#define	dpstackloc	0x831ffffc
#else
#define	dpstackloc	0x830ffffc
#endif	/* TWOMEG */
#endif  /* PCI */
#endif	/* PRI */
