blob: 92cfc54b5e70c0f2605eb88a370d392f867dc522 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/* -------------------------------------------
Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
------------------------------------------- */
#include <SCI.h>
/// @file LibSCI.cc
/// @brief Source file for the memory functions of the LibSCI.
/// @brief Copy memory region.
IMPORT_C VoidPtr MmCopyMemory(_Input VoidPtr dest, _Input VoidPtr src, _Input SizeT len)
{
if (!len ||
!dest ||
!src)
{
return nullptr;
}
for (SizeT i = 0; i < len; i++)
{
((Char*)dest)[i] = ((Char*)src)[i];
}
return dest;
}
/// @brief Fill memory region with **value**.
IMPORT_C VoidPtr MmFillMemory(_Input VoidPtr dest, _Input SizeT len, _Input UInt8 value)
{
if (!len ||
!dest)
{
return nullptr;
}
for (SizeT i = 0; i < len; i++)
{
((Char*)dest)[i] = value;
}
return dest;
}
|