/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident	"$Header: sysmacros.h 1.9 89/08/07 $"

#ifndef	_SYS_SYSMACROS_H_

/* $Log:	sysmacros.h,v $
 */

/* major part of a device */
#define	major(x)	((int)(((unsigned)(x)>>16)&0xFFFF))

/* minor part of a device */
#define	minor(x)	((int)((x)&0xFFFF))

/* make a device number */
#define	makedev(x,y)	((dev_t)(((x)<<16) | (y)))

/*
 * The following macros are used by streams.  They are used in
 * processing of copyin/copyout of user data for which a canonical
 * format is known.
 */

#ifdef i386
#define	SALIGN(p)		(char *)(((int)p+1) & ~1)
#define	IALIGN(p)		(char *)(((int)p+3) & ~3)
#define	LALIGN(p)		(char *)(((int)p+3) & ~3)
#endif /* i386 */

#define SNEXT(p)		(char *)((int)p + sizeof (short))
#define INEXT(p)		(char *)((int)p + sizeof (int))
#define LNEXT(p)		(char *)((int)p + sizeof (long))

/* change disk unit numbers into minor numbers */
#define unittominor(x)	((x)<<8)
#define minortounit(x)	((x)>>8)

/* change minor numbers into disk partition numbers */
#define minortopart(x)	((x)&0xFF)

/* other macros defined in param.h, vmmac.h */

#define	_SYS_SYSMACROS_H_
#endif	/* _SYS_SYSMACROS_H_ */
