xref: /csrg-svn/lib/libcompat/4.3/insque.c (revision 35110)
130424Smckusick /*
230424Smckusick  * Copyright (c) 1987 Regents of the University of California.
3*35110Sbostic  * All rights reserved.
4*35110Sbostic  *
5*35110Sbostic  * Redistribution and use in source and binary forms are permitted
6*35110Sbostic  * provided that the above copyright notice and this paragraph are
7*35110Sbostic  * duplicated in all such forms and that any documentation,
8*35110Sbostic  * advertising materials, and other materials related to such
9*35110Sbostic  * distribution and use acknowledge that the software was developed
10*35110Sbostic  * by the University of California, Berkeley.  The name of the
11*35110Sbostic  * University may not be used to endorse or promote products derived
12*35110Sbostic  * from this software without specific prior written permission.
13*35110Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*35110Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*35110Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1630424Smckusick  */
1730424Smckusick 
1830424Smckusick #if defined(LIBC_SCCS) && !defined(lint)
19*35110Sbostic static char sccsid[] = "@(#)insque.c	5.2 (Berkeley) 07/21/88";
20*35110Sbostic #endif /* LIBC_SCCS and not lint */
2130424Smckusick 
2230424Smckusick /*
2330424Smckusick  * insque -- vax insque instruction
2430424Smckusick  *
2530424Smckusick  * NOTE: this implementation is non-atomic!!
2630424Smckusick  */
2730424Smckusick 
2830424Smckusick struct vaxque {		/* queue format expected by VAX queue instructions */
2930424Smckusick 	struct vaxque	*vq_next;
3030424Smckusick 	struct vaxque	*vq_prev;
3130424Smckusick };
3230424Smckusick 
3330424Smckusick insque(e, prev)
3430424Smckusick 	register struct vaxque *e, *prev;
3530424Smckusick {
3630424Smckusick 	e->vq_prev = prev;
3730424Smckusick 	e->vq_next = prev->vq_next;
3830424Smckusick 	prev->vq_next->vq_prev = e;
3930424Smckusick 	prev->vq_next = e;
4030424Smckusick }
41