xref: /csrg-svn/sys/tahoe/align/Aget_long.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  *	@(#)Aget_long.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229610Ssam 
1345699Sbostic #include	"align.h"
get_longword(infop,address)1429610Ssam int get_longword (infop, address)
1529610Ssam process_info	*infop;
1629610Ssam char		*address;
1729610Ssam /*
1829610Ssam /*	Fetch the longword at the given 'address' from memory.
1929610Ssam /*	Caveat: It's quite difficult to find a pte reference
2029610Ssam /*		fault.  So I took the easy way out and just signal
2129610Ssam /*		an illegal access.
2229610Ssam /*
2329610Ssam /**************************************************/
2429610Ssam {
2529610Ssam 	register long code, value;
2629610Ssam 
2729610Ssam 	code = readable(infop, address, 4);
2829610Ssam 	if (code == TRUE) {
2929610Ssam 		value = *address++;
3029610Ssam 		value = (value << 8) | *address++ & 0xff;
3129610Ssam 		value = (value << 8) | *address++ & 0xff;
3229610Ssam 		value = (value << 8) | *address & 0xff;
3329610Ssam 		return(value);
3429610Ssam 	} else exception (infop, ILL_ACCESS, address, code);
3529610Ssam }
36