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

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

#define	BIG_ENDIAN	1	/* The 68000 is big endian */
#define	BS_BUS		1	/* The Qbus 68000 has the bytes backwards on the bus */

#define	TICKS	60			/* 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	0x2000	/* 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;
	int	(* ihx_func)();
	};

/* The interrupt vector causes a jump 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 in ihx_ifunc with the
 * address of the DCT as its argument.
 */
#define	MD_IHD	{ \
		0x487A, 0xfffe,	/*	pea pc@(-2)	*/ \
		0x4EF9, md_inth	/*	jmp md_inth	*/ \
		}

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

#define	set_int(i_vec, addr)	*(i_vec) = (word)(addr);

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