1285431Szbb/*- 2285431Szbb******************************************************************************** 3285431SzbbCopyright (C) 2015 Annapurna Labs Ltd. 4285431Szbb 5285431SzbbThis file may be licensed under the terms of the Annapurna Labs Commercial 6285431SzbbLicense Agreement. 7285431Szbb 8285431SzbbAlternatively, this file can be distributed under the terms of the GNU General 9285431SzbbPublic License V2 as published by the Free Software Foundation and can be 10285431Szbbfound at http://www.gnu.org/licenses/gpl-2.0.html 11285431Szbb 12285431SzbbAlternatively, redistribution and use in source and binary forms, with or 13285431Szbbwithout modification, are permitted provided that the following conditions are 14285431Szbbmet: 15285431Szbb 16285431Szbb * Redistributions of source code must retain the above copyright notice, 17285431Szbbthis list of conditions and the following disclaimer. 18285431Szbb 19285431Szbb * Redistributions in binary form must reproduce the above copyright 20285431Szbbnotice, this list of conditions and the following disclaimer in 21285431Szbbthe documentation and/or other materials provided with the 22285431Szbbdistribution. 23285431Szbb 24285431SzbbTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25285431SzbbANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26285431SzbbWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27285431SzbbDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 28285431SzbbANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29285431Szbb(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30285431SzbbLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 31285431SzbbANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32285431Szbb(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33285431SzbbSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34285431Szbb 35285431Szbb*******************************************************************************/ 36285431Szbb 37285431Szbb/** 38285431Szbb * @defgroup group_services Platform Services API 39285431Szbb * @{ 40285431Szbb * @file plat_api/sample/al_hal_plat_types.h 41285431Szbb * 42285431Szbb */ 43285431Szbb 44285431Szbb#ifndef __PLAT_TYPES_H__ 45285431Szbb#define __PLAT_TYPES_H__ 46285431Szbb 47285431Szbb#include <sys/cdefs.h> 48285431Szbb#include <sys/param.h> 49285431Szbb#include <machine/bus.h> 50285431Szbb#include <sys/bus.h> 51285431Szbb 52285431Szbb/* *INDENT-OFF* */ 53285431Szbb#ifdef __cplusplus 54285431Szbbextern "C" { 55285431Szbb#endif 56285431Szbb/* *INDENT-ON* */ 57285431Szbb 58285431Szbb/* Basic data types */ 59285431Szbbtypedef int al_bool; /** boolean */ 60285431Szbb#define AL_TRUE 1 61285431Szbb#define AL_FALSE 0 62285431Szbb 63285431Szbb 64285431Szbb/* define types */ 65285431Szbb#ifndef AL_HAVE_TYPES 66285431Szbbtypedef unsigned char uint8_t; /** unsigned 8 bits */ 67285431Szbbtypedef unsigned short uint16_t; /** unsigned 16 bits */ 68285431Szbbtypedef unsigned int uint32_t; /** unsigned 32 bits */ 69285431Szbbtypedef unsigned long long uint64_t; /** unsigned 64 bits */ 70285431Szbb 71285431Szbbtypedef signed char int8_t; /** signed 8 bits */ 72285431Szbbtypedef short int int16_t; /** signed 16 bits */ 73285431Szbbtypedef signed int int32_t; /** signed 32 bits */ 74285431Szbb 75285431Szbb/** An unsigned int that is guaranteed to be the same size as a pointer */ 76285431Szbb/** C99 standard */ 77285431Szbbtypedef unsigned long uintptr_t; 78285431Szbb#endif 79285431Szbb 80285431Szbb 81285431Szbb/** in LPAE mode, the address address is 40 bit, we extend it to 64 bit */ 82285431Szbbtypedef uint64_t al_phys_addr_t; 83285431Szbb 84285431Szbb/** this defines the cpu endiancess. */ 85285431Szbb#define PLAT_ARCH_IS_LITTLE() AL_TRUE 86285431Szbb 87285431Szbb/* *INDENT-OFF* */ 88285431Szbb#ifdef __cplusplus 89285431Szbb} 90285431Szbb#endif 91285431Szbb/* *INDENT-ON* */ 92285431Szbb/** @} end of Platform Services API group */ 93285431Szbb 94285431Szbb#endif /* __PLAT_TYPES_H__ */ 95