xref: /csrg-svn/sys/tahoe/align/align.c (revision 45760)
1*45760Sbostic /*-
2*45760Sbostic  * Copyright (c) 1986 The Regents of the University of California.
3*45760Sbostic  * All rights reserved.
4*45760Sbostic  *
5*45760Sbostic  * This code is derived from software contributed to Berkeley by
6*45760Sbostic  * Computer Consoles Inc.
7*45760Sbostic  *
8*45760Sbostic  * %sccs.include.redist.c%
9*45760Sbostic  *
10*45760Sbostic  *	@(#)align.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229646Ssam 
1345699Sbostic #include	"align.h"
1429646Ssam 
1529646Ssam /*
1629646Ssam  * Part of the parameter list is set up by locore.s.
1729646Ssam  * First 2 dummy variables MUST BE the first local
1829646Ssam  * variables; leaving place for registers 0 and 1
1929646Ssam  * which are not preserved by the current C compiler.
2029646Ssam  * Then, the array of structures and the last_operand
2129646Ssam  * HAVE to be in the given order, to correspond to the
2229646Ssam  * description of process_info in 'alignment.h'.
2329646Ssam  */
alignment()2429646Ssam alignment()
2529646Ssam {
2629646Ssam 	long	space_4_Register_1;	/* register 1 */
2729646Ssam 	long	space_4_Register_0;	/* register 0 */
2829646Ssam 	struct	oprnd	space_4_decoded[4];
2929646Ssam 	long	space_4_opcode;
3029646Ssam 	long	space_4_last_operand;	/* Last operand # processed */
3129646Ssam 	long	space_4_saved_pc;
3229646Ssam 	long	space_4_saved_sp;
3329646Ssam 
3429646Ssam 	register process_info *infop;
3529646Ssam 
3629646Ssam 	infop = (process_info *)&space_4_saved_sp;
3729646Ssam 	saved_pc = pc;
3829646Ssam 	saved_sp = sp;	     			/* For possible exceptions */
3929646Ssam 
4029646Ssam 	last_operand = -1;   /* To get the operand routine going correctly */
4129646Ssam 
4229646Ssam 	opCODE = 0xff & *(char *)pc;
4329646Ssam 	pc++;
4429646Ssam 	(*Table[opCODE].routine) (infop);	/* Call relevant handler */
4529646Ssam 	/*
4629646Ssam 	 * NOTE: nothing should follow, except the return.
4729646Ssam 	 * The register variables cannot be trusted anymore,
4829646Ssam 	 * if an exception is signalled.  See 'exception.c'
4929646Ssam 	 * to understand why.
5029646Ssam 	 */
5129646Ssam }
52