Xil_MemCmp - Xil_MemCmp - 2026.1 English - UG643

Standalone Library Documentation: BSP and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2026-06-23
Version
2026.1 English

This function compares Len bytes from memory1 and memory2. This function is a secure implementation of memcmp.

Prototype

s32 Xil_MemCmp(const void *Buf1Ptr, const void *Buf2Ptr, u32 Len);

Parameters

The following table lists the Xil_MemCmp function arguments.

Table 1. Xil_MemCmp Arguments
Type Member Description
const void * Buf1Ptr is pointer to memory1
const void * Buf2Ptr is pointer to memory2
u32 Len is number of byets to be compared

Returns

0 if contents of both the memory regions are same, -1 if first non-matching character has lower value in Buf1Ptr 1 if first non-matching character is greater value in Buf1Ptr