1 /*-
2 ********************************************************************************
3 Copyright (C) 2015 Annapurna Labs Ltd.
4 
5 This file may be licensed under the terms of the Annapurna Labs Commercial
6 License Agreement.
7 
8 Alternatively, this file can be distributed under the terms of the GNU General
9 Public License V2 as published by the Free Software Foundation and can be
10 found at http://www.gnu.org/licenses/gpl-2.0.html
11 
12 Alternatively, redistribution and use in source and binary forms, with or
13 without modification, are permitted provided that the following conditions are
14 met:
15 
16     *     Redistributions of source code must retain the above copyright notice,
17 this list of conditions and the following disclaimer.
18 
19     *     Redistributions in binary form must reproduce the above copyright
20 notice, this list of conditions and the following disclaimer in
21 the documentation and/or other materials provided with the
22 distribution.
23 
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
28 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31 ANY 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
33 SOFTWARE, 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
54 extern "C" {
55 #endif
56 /* *INDENT-ON* */
57 
58 /* Basic data types */
59 typedef int al_bool;		/** boolean */
60 #define AL_TRUE			1
61 #define AL_FALSE		0
62 
63 
64 /* define types */
65 #ifndef AL_HAVE_TYPES
66 typedef unsigned char uint8_t;	/** unsigned 8 bits */
67 typedef unsigned short uint16_t;	/** unsigned 16 bits */
68 typedef unsigned int uint32_t;	/** unsigned 32 bits */
69 typedef unsigned long long uint64_t;	/** unsigned 64 bits */
70 
71 typedef signed char int8_t;	/** signed 8 bits */
72 typedef short int int16_t;	/** signed 16 bits */
73 typedef 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 */
77 typedef unsigned long uintptr_t;
78 #endif
79 
80 
81 /** in LPAE mode, the address address is 40 bit, we extend it to 64 bit */
82 typedef 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