xref: /original-bsd/sys/tahoe/align/Aget_long.c (revision fbcc2ded)
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_long.c	7.1 (Berkeley) 12/06/90
11  */
12 
13 #include	"align.h"
14 int get_longword (infop, address)
15 process_info	*infop;
16 char		*address;
17 /*
18 /*	Fetch the longword 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, 4);
28 	if (code == TRUE) {
29 		value = *address++;
30 		value = (value << 8) | *address++ & 0xff;
31 		value = (value << 8) | *address++ & 0xff;
32 		value = (value << 8) | *address & 0xff;
33 		return(value);
34 	} else exception (infop, ILL_ACCESS, address, code);
35 }
36