mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 09:41:30 +00:00
Removed dead funcs in EFI stub module
Due to the last patches, some funcs in malloc.c and stdlib.h files for
EFI stub module are no longer used. This commit just removes them, no
other changes is being introduced. The funcs are:
emalloc/efree, calloc/malloc/free, strstr/strdup
Tracked-On:#1260
Signed-off-by: Chaohong Guo <chaohong.guo@intel.com>
Ackedr-by: Gen Zheng <gen.zheng@intel.com>
This commit is contained in:
@@ -44,13 +44,6 @@
|
||||
#ifndef __STDLIB_H__
|
||||
#define __STDLIB_H__
|
||||
|
||||
extern void *malloc(UINTN size);
|
||||
extern void free(void *buf);
|
||||
extern void *calloc(UINTN nmemb, UINTN size);
|
||||
|
||||
extern EFI_STATUS emalloc(UINTN, UINTN, EFI_PHYSICAL_ADDRESS *);
|
||||
extern EFI_STATUS __emalloc(UINTN, UINTN, EFI_PHYSICAL_ADDRESS *, EFI_MEMORY_TYPE);
|
||||
extern void efree(EFI_PHYSICAL_ADDRESS, UINTN);
|
||||
|
||||
static inline void memset(void *dstv, char ch, UINTN size)
|
||||
{
|
||||
@@ -80,39 +73,6 @@ static inline int strlen(const char *str)
|
||||
return len;
|
||||
}
|
||||
|
||||
static inline char *strstr(const char *haystack, const char *needle)
|
||||
{
|
||||
const char *p;
|
||||
const char *word = NULL;
|
||||
int len = strlen(needle);
|
||||
|
||||
if (!len)
|
||||
return NULL;
|
||||
|
||||
p = haystack;
|
||||
while (*p) {
|
||||
word = p;
|
||||
if (!strncmpa((CHAR8 *)p, (CHAR8 *)needle, len))
|
||||
break;
|
||||
p++;
|
||||
word = NULL;
|
||||
}
|
||||
|
||||
return (char *)word;
|
||||
}
|
||||
|
||||
static inline char *strdup(const char *src)
|
||||
{
|
||||
int len;
|
||||
char *dst;
|
||||
|
||||
len = strlen(src);
|
||||
dst = malloc(len + 1);
|
||||
if (dst)
|
||||
memcpy(dst, src, len + 1);
|
||||
return dst;
|
||||
}
|
||||
|
||||
static inline CHAR16 *strstr_16(CHAR16 *haystack, CHAR16 *needle)
|
||||
{
|
||||
CHAR16 *p;
|
||||
|
||||
Reference in New Issue
Block a user