Xil_SMemCmp - Xil_SMemCmp - 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 two memory regions for specified number of bytes. This function takes size of two memory regions to make sure not to read from or write to out of bound memory region.

Compares Len bytes between source and destination memory with constant time

Prototype

s32 Xil_SMemCmp(const void *Src1, const u32 Src1Size, const void *Src2, const u32 Src2Size, const u32 CmpLen);

Parameters

The following table lists the Xil_SMemCmp function arguments.

Table 1. Xil_SMemCmp Arguments
Type Member Description
const void * Src1 - Pointer to first memory range
const u32 Src1Size - Maximum size of first memory range
const void * Src2 - Pointer to second memory range
const u32 Src2Size - Maximum size of second memory range
const u32 CmpLen - Number of bytes to be compared

Returns

XST_SUCCESS - If specified number of bytes matches XST_FAILURE - If there is a mismatch found during comparison XST_INVALID_PARAM - Invalid inputs