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:
Chaohong guo
2018-09-17 14:26:38 +08:00
committed by lijinxia
parent 1d15b98730
commit 0306bb47c8
2 changed files with 0 additions and 177 deletions

View File

@@ -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;