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

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

#define	LITTLE_ENDIAN	1		/* The VAX is little 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);

/* Macros to make figuring out the CSR and vector of PDP-11
 * peripherals on a VAX easier. */
#define VAX_CSR(csr) ((csr & 0x1fff) | 0x20000000)
#define VAX_INT(vec) (vec + 0x200)

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