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