/* Copyright 1984 by the Massachusetts Institute of Technology */

/* This file contains various machine dependant definitons for the RT.
 */

/*
 *------------------------------------------------------------------
 *
 * $Source: /mit/cgw/src/sys/include/RCS/sys.h,v $
 * $Revision: 1.2 $
 * $Date: 87/12/10 02:27:31 $
 * $State: Exp $
 * $Author: jon $
 * $Locker: jon $
 *
 * $Log:	sys.h,v $
 * 
 *------------------------------------------------------------------
 */

#define	BIG_ENDIAN	1		/* The RT is big endian */

#define	TICKS	100			/* Number of ticks per second */

/* The name of the symbol that is at the end of used memory */
#define	END_OF_MEMORY	end

ext int md_inth();

#define	MD_INTEN	0x0	/* Status register that enables interrupts */

/* This is the structure for the machine code at the head of the DCT. */
#define	md_ihx	struct smd_ihx

md_ihx	{
	unss	ihx_1;
	unss	ihx_2;
	unss	ihx_3;
	unss	ihx_4;
	int	(* ihx_func)();
	};

/* The interrupt vector points into the DCT.  This code is what is
 * found.  It pushes the address of the DCT onto the stack and calls a
 * standard interrupt handler, md_inth.  This interrupt handler saves
 * all the registers and then calls the C routine specified by the DCT
 * in d_iha with the address of the DCT as its argument.
 */
#define	MD_IHD	{ \
		0xefdf,	0xfffa, 0xffff,	/*	pushal -6(pc)	*/ \
		0x9f17, md_inth		/*	jmp md_inth	*/ \
		}

/* This macro sets an interrupt vector.  It is a macro so that if some
 * machine needs something more complicated, it can easily be turned
 * into an assembly language routine.
 */

ext word scb[];
#define	set_int(i_vec, addr)	scb[((word)i_vec)/sizeof(word)] = (word)(addr);

/* Macro to make sure a pointer is on a useful boundry of some sort. */
#define	even(p)		(p)
