48 extern u32 XStl_RegUpdate(u32 RegAddr, u32 RegVal);
53 #if defined(__MICROBLAZE__)
54 #define INST_SYNC mbar(0)
55 #define DATA_SYNC mbar(1)
57 #define SYNCHRONIZE_IO dmb()
58 #define INST_SYNC isb()
59 #define DATA_SYNC dsb()
62 #define SYNCHRONIZE_IO
69 #if defined(__GNUC__) || defined(__ICCARM__) || defined(__MICROBLAZE__)
72 #define INLINE __inline
88 static INLINE u8 Xil_In8(UINTPTR Addr) {
return *(
volatile u8 *)Addr; }
102 static INLINE u16 Xil_In16(UINTPTR Addr) {
return *(
volatile u16 *)Addr; }
116 static INLINE u32 Xil_In32(UINTPTR Addr) {
return *(
volatile u32 *)Addr; }
130 static INLINE u64 Xil_In64(UINTPTR Addr) {
return *(
volatile u64 *)Addr; }
145 static INLINE void Xil_Out8(UINTPTR Addr, u8 Value) {
147 volatile u8 *LocalAddr = (
volatile u8 *)Addr;
163 static INLINE void Xil_Out16(UINTPTR Addr, u16 Value) {
165 volatile u16 *LocalAddr = (
volatile u16 *)Addr;
182 static INLINE void Xil_Out32(UINTPTR Addr, u32 Value) {
184 #ifndef ENABLE_SAFETY
185 volatile u32 *LocalAddr = (
volatile u32 *)Addr;
188 XStl_RegUpdate(Addr, Value);
205 static INLINE void Xil_Out64(UINTPTR Addr, u64 Value) {
207 volatile u64 *LocalAddr = (
volatile u64 *)Addr;
227 static INLINE int Xil_SecureOut32(UINTPTR Addr, u32 Value) {
228 int Status = XST_FAILURE;
233 Xil_Out32(Addr, Value);
236 ReadReg = Xil_In32(Addr);
237 ReadRegTemp = Xil_In32(Addr);
239 if ((ReadReg == Value) && (ReadRegTemp == Value)) {
240 Status = XST_SUCCESS;
257 return (u16)(((Data & 0xFF00U) >> 8U) | ((Data & 0x00FFU) << 8U));
276 LoWord = (u16)(Data & 0x0000FFFFU);
277 HiWord = (u16)((Data & 0xFFFF0000U) >> 16U);
281 LoWord = (u16)(((LoWord & 0xFF00U) >> 8U) | ((LoWord & 0x00FFU) << 8U));
282 HiWord = (u16)(((HiWord & 0xFF00U) >> 8U) | ((HiWord & 0x00FFU) << 8U));
286 return ((((u32)LoWord) << (u32)16U) | (u32)HiWord);
289 #if defined(__MICROBLAZE__)
290 #ifdef __LITTLE_ENDIAN__
291 #define Xil_In16LE Xil_In16
292 #define Xil_In32LE Xil_In32
293 #define Xil_Out16LE Xil_Out16
294 #define Xil_Out32LE Xil_Out32
295 #define Xil_Htons Xil_EndianSwap16
296 #define Xil_Htonl Xil_EndianSwap32
297 #define Xil_Ntohs Xil_EndianSwap16
298 #define Xil_Ntohl Xil_EndianSwap32
300 #define Xil_In16BE Xil_In16
301 #define Xil_In32BE Xil_In32
302 #define Xil_Out16BE Xil_Out16
303 #define Xil_Out32BE Xil_Out32
304 #define Xil_Htons(Data) (Data)
305 #define Xil_Htonl(Data) (Data)
306 #define Xil_Ntohs(Data) (Data)
307 #define Xil_Ntohl(Data) (Data)
310 #define Xil_In16LE Xil_In16
311 #define Xil_In32LE Xil_In32
312 #define Xil_Out16LE Xil_Out16
313 #define Xil_Out32LE Xil_Out32
314 #define Xil_Htons Xil_EndianSwap16
315 #define Xil_Htonl Xil_EndianSwap32
316 #define Xil_Ntohs Xil_EndianSwap16
317 #define Xil_Ntohl Xil_EndianSwap32
320 #if defined(__MICROBLAZE__)
321 #ifdef __LITTLE_ENDIAN__
322 static INLINE u16 Xil_In16BE(UINTPTR Addr)
327 static INLINE u16 Xil_In16BE(UINTPTR Addr)
330 u16 value = Xil_In16(Addr);
331 return Xil_EndianSwap16(value);
334 #if defined(__MICROBLAZE__)
335 #ifdef __LITTLE_ENDIAN__
336 static INLINE u32 Xil_In32BE(UINTPTR Addr)
341 static INLINE u32 Xil_In32BE(UINTPTR Addr)
344 u32 value = Xil_In32(Addr);
345 return Xil_EndianSwap32(value);
348 #if defined(__MICROBLAZE__)
349 #ifdef __LITTLE_ENDIAN__
350 static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value)
355 static INLINE void Xil_Out16BE(UINTPTR Addr, u16 Value)
358 Value = Xil_EndianSwap16(Value);
359 Xil_Out16(Addr, Value);
362 #if defined(__MICROBLAZE__)
363 #ifdef __LITTLE_ENDIAN__
364 static INLINE void Xil_Out32BE(UINTPTR Addr, u32 Value)
369 static INLINE void Xil_Out32BE(UINTPTR Addr, u32 Value)
372 Value = Xil_EndianSwap32(Value);
373 Xil_Out32(Addr, Value);