xref: /original-bsd/sys/tahoe/align/Aget_word.c (revision f71c8376)
1 /*-
2  * Copyright (c) 1986 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Computer Consoles Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)Aget_word.c	7.1 (Berkeley) 12/06/90
11  */
12 
13 #include	"align.h"
14 int get_word (infop, address)
15 process_info	*infop;
16 char		*address;
17 /*
18 /*	Fetch the word at the given 'address' from memory.
19 /*	Caveat: It's quite difficult to find a pte reference
20 /*		fault.  So I took the easy way out and just signal
21 /*		an illegal access.
22 /*
23 /**************************************************/
24 {
25 	register long code, value;
26 
27 	code = readable(infop, address, 2);
28 	if (code == TRUE) {
29 		value = *address++ << 8;
30 		value = value | *address & 0xff;
31 		return(value);
32 	} else exception (infop, ILL_ACCESS, address, code);
33 }
34