xref: /titanic_51/usr/src/lib/libast/sparcv9/include/ast/align.h (revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1985-2008 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_20081104/build_sparc_64bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
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)&0xfffffffffffffffe)
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		16
48 #define ALIGN_ALIGN2(x)		ALIGN_TRUNC2((x)+15)
49 #define ALIGN_TRUNC2(x)		ALIGN_POINTER(ALIGN_INTEGER(x)&0xfffffffffffffff0)
50 #define ALIGN_CLRBIT2(x)	ALIGN_POINTER(ALIGN_INTEGER(x)&0xfffffffffffffffd)
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