1/*- 2******************************************************************************** 3Copyright (C) 2015 Annapurna Labs Ltd. 4 5This file may be licensed under the terms of the Annapurna Labs Commercial 6License Agreement. 7 8Alternatively, this file can be distributed under the terms of the GNU General 9Public License V2 as published by the Free Software Foundation and can be 10found at http://www.gnu.org/licenses/gpl-2.0.html 11 12Alternatively, redistribution and use in source and binary forms, with or 13without modification, are permitted provided that the following conditions are 14met: 15 16 * Redistributions of source code must retain the above copyright notice, 17this list of conditions and the following disclaimer. 18 19 * Redistributions in binary form must reproduce the above copyright 20notice, this list of conditions and the following disclaimer in 21the documentation and/or other materials provided with the 22distribution. 23 24THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 28ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 31ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 35*******************************************************************************/ 36 37/** 38 * @defgroup group_services Platform Services API 39 * @{ 40 * @file plat_api/sample/al_hal_plat_types.h 41 * 42 */ 43 44#ifndef __PLAT_TYPES_H__ 45#define __PLAT_TYPES_H__ 46 47#include <sys/cdefs.h> 48#include <sys/param.h> 49#include <machine/bus.h> 50#include <sys/bus.h> 51 52/* *INDENT-OFF* */ 53#ifdef __cplusplus 54extern "C" { 55#endif 56/* *INDENT-ON* */ 57 58/* Basic data types */ 59typedef int al_bool; /** boolean */ 60#define AL_TRUE 1 61#define AL_FALSE 0 62 63 64/* define types */ 65#ifndef AL_HAVE_TYPES 66typedef unsigned char uint8_t; /** unsigned 8 bits */ 67typedef unsigned short uint16_t; /** unsigned 16 bits */ 68typedef unsigned int uint32_t; /** unsigned 32 bits */ 69typedef unsigned long long uint64_t; /** unsigned 64 bits */ 70 71typedef signed char int8_t; /** signed 8 bits */ 72typedef short int int16_t; /** signed 16 bits */ 73typedef signed int int32_t; /** signed 32 bits */ 74 75/** An unsigned int that is guaranteed to be the same size as a pointer */ 76/** C99 standard */ 77typedef unsigned long uintptr_t; 78#endif 79 80 81/** in LPAE mode, the address address is 40 bit, we extend it to 64 bit */ 82typedef uint64_t al_phys_addr_t; 83 84/** this defines the cpu endiancess. */ 85#define PLAT_ARCH_IS_LITTLE() AL_TRUE 86 87/* *INDENT-OFF* */ 88#ifdef __cplusplus 89} 90#endif 91/* *INDENT-ON* */ 92/** @} end of Platform Services API group */ 93 94#endif /* __PLAT_TYPES_H__ */ 95