libpynq  (release 5EID0-2023 version 0.3.0 of 2024-04-25 09:42 )
xil_types.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2010 - 2021 Xilinx, Inc. All rights reserved.
3  * Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
4  * SPDX-License-Identifier: MIT
5  ******************************************************************************/
6 
7 /*****************************************************************************/
34 #ifndef XIL_TYPES_H /* prevent circular inclusions */
35 #define XIL_TYPES_H /* by using protection macros */
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 #include <stddef.h>
42 #include <stdint.h>
43 
44 /************************** Constant Definitions *****************************/
45 
46 #define XST_SUCCESS 0L
47 #define XST_FAILURE 1L
48 #ifndef TRUE
49 #define TRUE 1U
50 #endif
51 
52 #ifndef FALSE
53 #define FALSE 0U
54 #endif
55 
56 #ifndef NULL
57 #define NULL 0U
58 #endif
59 
60 #define XIL_COMPONENT_IS_READY \
61  0x11111111U
66 #define XIL_COMPONENT_IS_STARTED \
67  0x22222222U
72 /* @name New types
73  * New simple types.
74  * @{
75  */
76 #ifndef __KERNEL__
77 #ifndef XBASIC_TYPES_H
78 /*
79  * guarded against xbasic_types.h.
80  */
81 typedef uint8_t u8;
82 typedef uint16_t u16;
83 typedef uint32_t u32;
85 #define __XUINT64__
86 typedef struct {
87  u32 Upper;
88  u32 Lower;
89 } Xuint64;
90 
91 /*****************************************************************************/
100 #define XUINT64_MSW(x) ((x).Upper)
101 
102 /*****************************************************************************/
111 #define XUINT64_LSW(x) ((x).Lower)
112 
113 #endif /* XBASIC_TYPES_H */
114 
115 /*
116  * xbasic_types.h does not typedef s* or u64
117  */
119 typedef char char8;
120 typedef int8_t s8;
121 typedef int16_t s16;
122 typedef int32_t s32;
123 typedef int64_t s64;
124 typedef uint64_t u64;
125 typedef int sint32;
126 
127 #if defined(__MICROBLAZE__) && !defined(__arch64__) && \
128  (XPAR_MICROBLAZE_ADDR_SIZE > 32)
129 typedef uint64_t UINTPTR;
130 typedef int64_t INTPTR;
131 #else
132 typedef uintptr_t UINTPTR;
133 typedef intptr_t INTPTR;
134 #endif
135 
136 typedef ptrdiff_t PTRDIFF;
138 #if !defined(LONG) || !defined(ULONG)
139 typedef long LONG;
140 typedef unsigned long ULONG;
141 #endif
142 
143 #define ULONG64_HI_MASK 0xFFFFFFFF00000000U
144 #define ULONG64_LO_MASK ~ULONG64_HI_MASK
145 
146 #else
147 #include <linux/types.h>
148 #endif
149 
155 typedef void (*XInterruptHandler)(void *InstancePtr);
156 
161 typedef void (*XExceptionHandler)(void *InstancePtr);
162 
172 #if defined(__aarch64__) || defined(__arch64__)
173 #define UPPER_32_BITS(n) ((u32)(((n) >> 16) >> 16))
174 #else
175 #define UPPER_32_BITS(n) 0U
176 #endif
177 
182 #define LOWER_32_BITS(n) ((u32)(n))
183 
189 #if defined(__aarch64__) || defined(__arch64__)
190 #define LEFT_SHIFT_BY_32_BITS(n) (u64)(((u64)n) << 32)
191 #else
192 #define LEFT_SHIFT_BY_32_BITS(n) 0U
193 #endif
194 
195 /************************** Constant Definitions *****************************/
196 
197 #ifndef TRUE
198 #define TRUE 1U
199 #endif
200 
201 #ifndef FALSE
202 #define FALSE 0U
203 #endif
204 
205 #ifndef NULL
206 #define NULL 0U
207 #endif
208 
209 #ifdef __cplusplus
210 }
211 #endif
212 
213 #endif /* end of protection macro */
214