mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-10 21:29:20 +00:00
hv: lib: remove memchr
No one uses it and it's some duplicated with strchr. Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -21,7 +21,6 @@ union u_qword {
|
|||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
void udelay(uint32_t us);
|
void udelay(uint32_t us);
|
||||||
void *memchr(const void *void_s, int32_t c, size_t n);
|
|
||||||
int32_t strcmp(const char *s1_arg, const char *s2_arg);
|
int32_t strcmp(const char *s1_arg, const char *s2_arg);
|
||||||
int32_t strncmp(const char *s1_arg, const char *s2_arg, size_t n_arg);
|
int32_t strncmp(const char *s1_arg, const char *s2_arg, size_t n_arg);
|
||||||
char *strncpy_s(char *d_arg, size_t dmax, const char *s_arg, size_t slen_arg);
|
char *strncpy_s(char *d_arg, size_t dmax, const char *s_arg, size_t slen_arg);
|
||||||
|
@@ -259,21 +259,6 @@ void free(const void *ptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void *memchr(const void *void_s, int32_t c, size_t n)
|
|
||||||
{
|
|
||||||
uint8_t val = (uint8_t)c;
|
|
||||||
uint8_t *ptr = (uint8_t *)void_s;
|
|
||||||
uint8_t *end = ptr + n;
|
|
||||||
|
|
||||||
while (ptr < end) {
|
|
||||||
if (*ptr == val) {
|
|
||||||
return ((void *)ptr);
|
|
||||||
}
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void memcpy_erms(void *d, const void *s, size_t slen)
|
static inline void memcpy_erms(void *d, const void *s, size_t slen)
|
||||||
{
|
{
|
||||||
asm volatile ("rep; movsb"
|
asm volatile ("rep; movsb"
|
||||||
|
Reference in New Issue
Block a user