libpynq (release 5EWC0-2023 version 0.2.2 of 2023-09-24 22:22)
Loading...
Searching...
No Matches
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
38extern "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 */
81typedef uint8_t u8;
82typedef uint16_t u16;
83typedef uint32_t u32;
85#define __XUINT64__
86typedef 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 */
119typedef char char8;
120typedef int8_t s8;
121typedef int16_t s16;
122typedef int32_t s32;
123typedef int64_t s64;
124typedef uint64_t u64;
125typedef int sint32;
126
127#if defined(__MICROBLAZE__) && !defined(__arch64__) && \
128 (XPAR_MICROBLAZE_ADDR_SIZE > 32)
129typedef uint64_t UINTPTR;
130typedef int64_t INTPTR;
131#else
132typedef uintptr_t UINTPTR;
133typedef intptr_t INTPTR;
134#endif
135
136typedef ptrdiff_t PTRDIFF;
138#if !defined(LONG) || !defined(ULONG)
139typedef long LONG;
140typedef 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
155typedef void (*XInterruptHandler)(void *InstancePtr);
156
161typedef 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
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 */