mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 14:44:28 +02:00
MdeModulePkg/RegularExpressionDxe: Optimize the code infrastructure
OnigurumaIntrinsics.c is now not used. So the implement of function 'memcpy' is now not., which causes build failure with CLANG9 and XCODE. I remove OnigurumaIntrinsics.c and move the necessary function implement to OnigurumaUefiPort.c/h. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
parent
f2cdb268ef
commit
8b680e4af1
@ -1,48 +0,0 @@
|
|||||||
/** @file
|
|
||||||
|
|
||||||
Provide intrinsics within Oniguruma
|
|
||||||
|
|
||||||
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
|
|
||||||
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
|
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include <Library/BaseMemoryLib.h>
|
|
||||||
|
|
||||||
//
|
|
||||||
// From CryptoPkg/IntrinsicLib
|
|
||||||
//
|
|
||||||
|
|
||||||
/* Copies bytes between buffers */
|
|
||||||
#pragma function(memcpy)
|
|
||||||
void * memcpy (void *dest, const void *src, unsigned int count)
|
|
||||||
{
|
|
||||||
return CopyMem (dest, src, (UINTN)count);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sets buffers to a specified character */
|
|
||||||
#pragma function(memset)
|
|
||||||
void * memset (void *dest, char ch, unsigned int count)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// NOTE: Here we use one base implementation for memset, instead of the direct
|
|
||||||
// optimized SetMem() wrapper. Because the IntrinsicLib has to be built
|
|
||||||
// without whole program optimization option, and there will be some
|
|
||||||
// potential register usage errors when calling other optimized codes.
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// Declare the local variables that actually move the data elements as
|
|
||||||
// volatile to prevent the optimizer from replacing this function with
|
|
||||||
// the intrinsic memset()
|
|
||||||
//
|
|
||||||
volatile UINT8 *Pointer;
|
|
||||||
|
|
||||||
Pointer = (UINT8 *)dest;
|
|
||||||
while (count-- != 0) {
|
|
||||||
*(Pointer++) = ch;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dest;
|
|
||||||
}
|
|
@ -86,3 +86,13 @@ void * realloc (void *ptr, size_t size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* memcpy (void *dest, const void *src, unsigned int count)
|
||||||
|
{
|
||||||
|
return CopyMem (dest, src, (UINTN)count);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* memset (void *dest, char ch, unsigned int count)
|
||||||
|
{
|
||||||
|
return SetMem (dest, ch, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -96,6 +96,8 @@ int EFIAPI sprintf_s (char *str, size_t sizeOfBuffer, char const *fmt, ...);
|
|||||||
int strlen(const char* str);
|
int strlen(const char* str);
|
||||||
void* malloc(size_t size);
|
void* malloc(size_t size);
|
||||||
void* realloc(void *ptr, size_t size);
|
void* realloc(void *ptr, size_t size);
|
||||||
|
void* memcpy (void *dest, const void *src, unsigned int count);
|
||||||
|
void* memset (void *dest, char ch, unsigned int count);
|
||||||
|
|
||||||
#define exit(n) ASSERT(FALSE);
|
#define exit(n) ASSERT(FALSE);
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
RegularExpressionDxe.h
|
RegularExpressionDxe.h
|
||||||
OnigurumaUefiPort.h
|
OnigurumaUefiPort.h
|
||||||
OnigurumaUefiPort.c
|
OnigurumaUefiPort.c
|
||||||
OnigurumaIntrinsics.c | MSFT
|
|
||||||
|
|
||||||
# Wrapper header files start #
|
# Wrapper header files start #
|
||||||
stdio.h
|
stdio.h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user