xref: /csrg-svn/sys/tahoe/align/Aget_byte.c (revision 45699)
1*45699Sbostic /*	Aget_byte.c	1.2	90/12/04	*/
229609Ssam 
3*45699Sbostic #include	"align.h"
429609Ssam int get_byte (infop, address)
529609Ssam process_info	*infop;
629609Ssam char		*address;
729609Ssam /*
829609Ssam /*	Fetch the byte at the given 'address' from memory.
929609Ssam /*	Caveat: It's quite difficult to find a pte reference
1029609Ssam /*		fault.  So I took the easy way out and just signal
1129609Ssam /*		an illegal access.
1229609Ssam /*
1329609Ssam /**************************************************/
1429609Ssam {
1529609Ssam 	register long code;
1629609Ssam 
1729609Ssam 	code = readable(infop, (long)address, 1);
1829609Ssam 	if ( code == TRUE ) {
1929609Ssam 		return(*address);
2029609Ssam 	} else exception (infop, ILL_ACCESS, address, code);
2129609Ssam }
22