xref: /titanic_41/usr/src/lib/libast/i386/include/ast/align.h (revision 721df37ded2cce623b0249cc35a872c3ce291b9b)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1985-2010 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                 Glenn Fowler <gsf@research.att.com>                  *
18 *                  David Korn <dgk@research.att.com>                   *
19 *                   Phong Vo <kpv@research.att.com>                    *
20 *                                                                      *
21 ***********************************************************************/
22 /* : : generated from /home/gisburn/ksh93/ast_ksh_20100309/build_i386_32bit/src/lib/libast/features/align.c by iffe version 2009-12-04 : : */
23 #ifndef _def_align_ast
24 #define _def_align_ast	1
25 #define _sys_types	1	/* #include <sys/types.h> ok */
26 typedef unsigned long ALIGN_INTEGRAL;
27 
28 #define ALIGN_CHUNK		8192
29 #define ALIGN_INTEGRAL		long
30 #define ALIGN_INTEGER(x)	((ALIGN_INTEGRAL)(x))
31 #define ALIGN_POINTER(x)	((char*)(x))
32 #define ALIGN_ROUND(x,y)	ALIGN_POINTER(ALIGN_INTEGER((x)+(y)-1)&~((y)-1))
33 
34 #define ALIGN_BOUND		ALIGN_BOUND2
35 #define ALIGN_ALIGN(x)		ALIGN_ALIGN2(x)
36 #define ALIGN_TRUNC(x)		ALIGN_TRUNC2(x)
37 
38 #define ALIGN_BIT1		0x1
39 #define ALIGN_BOUND1		ALIGN_BOUND2
40 #define ALIGN_ALIGN1(x)		ALIGN_ALIGN2(x)
41 #define ALIGN_TRUNC1(x)		ALIGN_TRUNC2(x)
42 #define ALIGN_CLRBIT1(x)	ALIGN_POINTER(ALIGN_INTEGER(x)&0xfffffffe)
43 #define ALIGN_SETBIT1(x)	ALIGN_POINTER(ALIGN_INTEGER(x)|0x1)
44 #define ALIGN_TSTBIT1(x)	ALIGN_POINTER(ALIGN_INTEGER(x)&0x1)
45 
46 #define ALIGN_BIT2		0x2
47 #define ALIGN_BOUND2		4
48 #define ALIGN_ALIGN2(x)		ALIGN_TRUNC2((x)+3)
49 #define ALIGN_TRUNC2(x)		ALIGN_POINTER(ALIGN_INTEGER(x)&0xfffffffc)
50 #define ALIGN_CLRBIT2(x)	ALIGN_POINTER(ALIGN_INTEGER(x)&0xfffffffd)
51 #define ALIGN_SETBIT2(x)	ALIGN_POINTER(ALIGN_INTEGER(x)|0x2)
52 #define ALIGN_TSTBIT2(x)	ALIGN_POINTER(ALIGN_INTEGER(x)&0x2)
53 
54 #endif
55