]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/libsrc/standalone_v4_2/src/xil_types.h
c9c1730180ba4e2fd6ee4fcc978b42c9791af793
[freertos] / FreeRTOS / Demo / MicroBlaze_Kintex7_EthernetLite / BSP / microblaze_0 / libsrc / standalone_v4_2 / src / xil_types.h
1 /******************************************************************************
2 *
3 * Copyright (C) 2009 - 2014 Xilinx, Inc.  All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * Use of the Software is limited solely to applications:
16 * (a) running on a Xilinx device, or
17 * (b) that interact with a Xilinx device through a bus or interconnect.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * Except as contained in this notice, the name of the Xilinx shall not be used
28 * in advertising or otherwise to promote the sale, use or other dealings in
29 * this Software without prior written authorization from Xilinx.
30 *
31 ******************************************************************************/
32 /*****************************************************************************/
33 /**
34 *
35 * @file xil_types.h
36 *
37 * This file contains basic types for Xilinx software IP.
38
39 *
40 * <pre>
41 * MODIFICATION HISTORY:
42 *
43 * Ver   Who    Date   Changes
44 * ----- ---- -------- -------------------------------------------------------
45 * 1.00a hbm  07/14/09 First release
46 * 3.03a sdm  05/30/11 Added Xuint64 typedef and XUINT64_MSW/XUINT64_LSW macros
47 * 4.2   srt  07/03/14 Use standard definitions from stdint.h
48 * </pre>
49 *
50 ******************************************************************************/
51
52 #ifndef XIL_TYPES_H     /* prevent circular inclusions */
53 #define XIL_TYPES_H     /* by using protection macros */
54
55 #include <stdint.h>
56 #include <stddef.h>
57
58 /************************** Constant Definitions *****************************/
59
60 #ifndef TRUE
61 #  define TRUE          1
62 #endif
63
64 #ifndef FALSE
65 #  define FALSE         0
66 #endif
67
68 #ifndef NULL
69 #define NULL            0
70 #endif
71
72 #define XIL_COMPONENT_IS_READY     0x11111111  /**< component has been initialized */
73 #define XIL_COMPONENT_IS_STARTED   0x22222222  /**< component has been started */
74
75 /** @name New types
76  * New simple types.
77  * @{
78  */
79 #ifndef __KERNEL__
80 #ifndef XBASIC_TYPES_H
81 /**
82  * guarded against xbasic_types.h.
83  */
84 typedef uint8_t u8;
85 typedef uint16_t u16;
86 typedef uint32_t u32;
87
88 #define __XUINT64__
89 typedef struct
90 {
91         u32 Upper;
92         u32 Lower;
93 } Xuint64;
94
95
96 /*****************************************************************************/
97 /**
98 * Return the most significant half of the 64 bit data type.
99 *
100 * @param    x is the 64 bit word.
101 *
102 * @return   The upper 32 bits of the 64 bit word.
103 *
104 * @note     None.
105 *
106 ******************************************************************************/
107 #define XUINT64_MSW(x) ((x).Upper)
108
109 /*****************************************************************************/
110 /**
111 * Return the least significant half of the 64 bit data type.
112 *
113 * @param    x is the 64 bit word.
114 *
115 * @return   The lower 32 bits of the 64 bit word.
116 *
117 * @note     None.
118 *
119 ******************************************************************************/
120 #define XUINT64_LSW(x) ((x).Lower)
121
122 #endif /* XBASIC_TYPES_H */
123
124 /**
125  * xbasic_types.h does not typedef s* or u64
126  */
127 typedef uint64_t u64;
128
129 typedef int8_t s8;
130 typedef int16_t s16;
131 typedef int32_t s32;
132 typedef int64_t s64;
133 typedef intptr_t INTPTR;
134 typedef uintptr_t UINTPTR;
135 typedef ptrdiff_t PTRDIFF; 
136
137 #if !defined(LONG) || !defined(ULONG)
138 typedef long LONG;
139 typedef unsigned long ULONG;
140 #endif
141
142 #define ULONG64_HI_MASK 0xFFFFFFFF00000000
143 #define ULONG64_LO_MASK ~ULONG64_HI_MASK
144
145
146 #else
147 #include <linux/types.h>
148 #endif
149
150
151 /**
152  * This data type defines an interrupt handler for a device.
153  * The argument points to the instance of the component
154  */
155 typedef void (*XInterruptHandler) (void *InstancePtr);
156
157 /**
158  * This data type defines an exception handler for a processor.
159  * The argument points to the instance of the component
160  */
161 typedef void (*XExceptionHandler) (void *InstancePtr);
162
163 /*@}*/
164
165
166 /************************** Constant Definitions *****************************/
167
168 #ifndef TRUE
169 #define TRUE            1
170 #endif
171
172 #ifndef FALSE
173 #define FALSE           0
174 #endif
175
176 #ifndef NULL
177 #define NULL            0
178 #endif
179
180 #endif  /* end of protection macro */