xref: /csrg-svn/sys/tahoe/align/Aput_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  *	@(#)Aput_word.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229629Ssam 
1345699Sbostic #include	"align.h"
1429629Ssam 
put_word(infop,word,where)1529629Ssam put_word (infop, word, where)
1629629Ssam register	process_info	*infop;
1729629Ssam register	char		*where;
1829629Ssam register	long		word;
1929629Ssam /*
2029629Ssam /*	Put the word at the given address in memory.
2129629Ssam /*	Caveat: It's quite difficult to find a pte reference
2229629Ssam /*		fault.  So I took the easy way out and just signal
2329629Ssam /*		an illegal access.
2429629Ssam /*
2529629Ssam /**************************************************/
2629629Ssam {
2729629Ssam 	register long code;
2829629Ssam 
2929629Ssam 	code = writeable(infop, where, 2);
3029629Ssam 	if ( code == TRUE ) {
3129629Ssam 		*where = word>>8;
3229629Ssam 		*(where+1) = word;
3329629Ssam 	} else exception (infop, ILL_ACCESS, where, code);
3429629Ssam }
35