]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaIntrinsics.c
3 Provide intrinsics within Oniguruma
5 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/BaseMemoryLib.h>
13 // From CryptoPkg/IntrinsicLib
16 /* Copies bytes between buffers */
17 #pragma function(memcpy)
18 void * memcpy (void *dest
, const void *src
, unsigned int count
)
20 return CopyMem (dest
, src
, (UINTN
)count
);
23 /* Sets buffers to a specified character */
24 #pragma function(memset)
25 void * memset (void *dest
, char ch
, unsigned int count
)
28 // NOTE: Here we use one base implementation for memset, instead of the direct
29 // optimized SetMem() wrapper. Because the IntrinsicLib has to be built
30 // without whole program optimization option, and there will be some
31 // potential register usage errors when calling other optimized codes.
35 // Declare the local variables that actually move the data elements as
36 // volatile to prevent the optimizer from replacing this function with
37 // the intrinsic memset()
39 volatile UINT8
*Pointer
;
41 Pointer
= (UINT8
*)dest
;
42 while (count
-- != 0) {