Xil_SMemCmp_CT - Xil_SMemCmp_CT - 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. Note that this function compares till end to make it execute in constant time irrespective of the content of input memory.

Sets the destination memory of given length with given data

Prototype

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

Parameters

The following table lists the Xil_SMemCmp_CT function arguments.

Table 1. Xil_SMemCmp_CT 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 mismatch XST_INVALID_PARAM - Invalid inputs