xref: /csrg-svn/sys/tahoe/align/Aget_word.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_word.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229610Ssam 
1345699Sbostic #include	"align.h"
get_word(infop,address)1429610Ssam int get_word (infop, address)
1529610Ssam process_info	*infop;
1629610Ssam char		*address;
1729610Ssam /*
1829610Ssam /*	Fetch the word 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, 2);
2829610Ssam 	if (code == TRUE) {
2929610Ssam 		value = *address++ << 8;
3029610Ssam 		value = value | *address & 0xff;
3129610Ssam 		return(value);
3229610Ssam 	} else exception (infop, ILL_ACCESS, address, code);
3329610Ssam }
34