xref: /csrg-svn/sys/tahoe/align/align.c (revision 45699)
1*45699Sbostic /*	align.c	1.2	90/12/04	*/
229646Ssam 
3*45699Sbostic #include	"align.h"
429646Ssam 
529646Ssam /*
629646Ssam  * Part of the parameter list is set up by locore.s.
729646Ssam  * First 2 dummy variables MUST BE the first local
829646Ssam  * variables; leaving place for registers 0 and 1
929646Ssam  * which are not preserved by the current C compiler.
1029646Ssam  * Then, the array of structures and the last_operand
1129646Ssam  * HAVE to be in the given order, to correspond to the
1229646Ssam  * description of process_info in 'alignment.h'.
1329646Ssam  */
1429646Ssam alignment()
1529646Ssam {
1629646Ssam 	long	space_4_Register_1;	/* register 1 */
1729646Ssam 	long	space_4_Register_0;	/* register 0 */
1829646Ssam 	struct	oprnd	space_4_decoded[4];
1929646Ssam 	long	space_4_opcode;
2029646Ssam 	long	space_4_last_operand;	/* Last operand # processed */
2129646Ssam 	long	space_4_saved_pc;
2229646Ssam 	long	space_4_saved_sp;
2329646Ssam 
2429646Ssam 	register process_info *infop;
2529646Ssam 
2629646Ssam 	infop = (process_info *)&space_4_saved_sp;
2729646Ssam 	saved_pc = pc;
2829646Ssam 	saved_sp = sp;	     			/* For possible exceptions */
2929646Ssam 
3029646Ssam 	last_operand = -1;   /* To get the operand routine going correctly */
3129646Ssam 
3229646Ssam 	opCODE = 0xff & *(char *)pc;
3329646Ssam 	pc++;
3429646Ssam 	(*Table[opCODE].routine) (infop);	/* Call relevant handler */
3529646Ssam 	/*
3629646Ssam 	 * NOTE: nothing should follow, except the return.
3729646Ssam 	 * The register variables cannot be trusted anymore,
3829646Ssam 	 * if an exception is signalled.  See 'exception.c'
3929646Ssam 	 * to understand why.
4029646Ssam 	 */
4129646Ssam }
42