1196994Sphk/*- 2196994Sphk * Copyright (c) 2001 David E. O'Brien 3196994Sphk * Copyright (c) 1990 The Regents of the University of California. 4196994Sphk * All rights reserved. 5196994Sphk * 6196994Sphk * This code is derived from software contributed to Berkeley by 7196994Sphk * William Jolitz. 8196994Sphk * 9196994Sphk * Redistribution and use in source and binary forms, with or without 10196994Sphk * modification, are permitted provided that the following conditions 11196994Sphk * are met: 12196994Sphk * 1. Redistributions of source code must retain the above copyright 13196994Sphk * notice, this list of conditions and the following disclaimer. 14196994Sphk * 2. Redistributions in binary form must reproduce the above copyright 15196994Sphk * notice, this list of conditions and the following disclaimer in the 16196994Sphk * documentation and/or other materials provided with the distribution. 17196994Sphk * 3. All advertising materials mentioning features or use of this software 18196994Sphk * must display the following acknowledgement: 19196994Sphk * This product includes software developed by the University of 20196994Sphk * California, Berkeley and its contributors. 21196994Sphk * 4. Neither the name of the University nor the names of its contributors 22196994Sphk * may be used to endorse or promote products derived from this software 23196994Sphk * without specific prior written permission. 24196994Sphk * 25196994Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26196994Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27196994Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28196994Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29196994Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30196994Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31196994Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32196994Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33196994Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34196994Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35196994Sphk * SUCH DAMAGE. 36196994Sphk * 37196994Sphk * from: @(#)param.h 5.8 (Berkeley) 6/28/91 38196994Sphk * $FreeBSD$ 39196994Sphk */ 40196994Sphk 41196994Sphk#ifndef _ARM_INCLUDE__ALIGN_H_ 42196994Sphk#define _ARM_INCLUDE__ALIGN_H_ 43196994Sphk 44196994Sphk/* 45300375Sian * Round p (pointer or byte index) up to the hardware-required alignment which 46300375Sian * is sufficient for any data type, pointer or numeric. The resulting type 47300375Sian * is equivelent to arm's uintptr_t (but is purposely spelled "unsigned" here). 48196994Sphk */ 49300701Sian#if __ARM_ARCH >= 6 50300701Sian#define _ALIGNBYTES (sizeof(int) - 1) 51300701Sian#else 52300375Sian#define _ALIGNBYTES (sizeof(long long) - 1) 53300701Sian#endif 54196994Sphk#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) 55196994Sphk 56196994Sphk#endif /* !_ARM_INCLUDE__ALIGN_H_ */ 57