From 75361df852d0c21c346f9979e099b703d9753501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Leczkowski?= Date: Fri, 26 Jan 2024 15:58:48 +0100 Subject: [PATCH] string: remove memsetw Fixes https://github.com/phoenix-rtos/phoenix-rtos-project/issues/961 JIRA: RTOS-752 --- arch/ia32/string.c | 28 ---------------------------- include/string.h | 4 ---- 2 files changed, 32 deletions(-) diff --git a/arch/ia32/string.c b/arch/ia32/string.c index 95cdec93..e4a043ec 100644 --- a/arch/ia32/string.c +++ b/arch/ia32/string.c @@ -67,31 +67,3 @@ void *memset(void *where, int v, size_t n) return where; } - - -void *memsetw(void *where, int v, size_t n) -{ - __asm__ volatile - (" \ - cld; \ - movl %0, %%ecx; \ - movl %%ecx, %%edx; \ - andl $1, %%edx; \ - shrl $1, %%ecx; \ - \ - movl %1, %%eax; \ - andl $0x0000ffff, %%eax; \ - movl %%eax, %%ebx; \ - shll $16, %%ebx; \ - orl %%ebx, %%eax; \ - \ - movl %2, %%edi; \ - rep; stosl; \ - movl %%edx, %%ecx; \ - rep; stosw" - : "+d" (n) - : "m" (v), "m" (where) - : "eax", "ebx", "cc", "ecx", "edi" ,"memory"); - - return NULL; -} diff --git a/include/string.h b/include/string.h index 3b337df5..72494d84 100644 --- a/include/string.h +++ b/include/string.h @@ -60,10 +60,6 @@ extern void *memmove(void *dest, const void *src, size_t n); extern void *memset(void *str, int c, size_t n); -/* Copies word v (an unsigned char) to the first n characters of the string pointed to, by the argument str. */ -extern void *memsetw(void *str, int v, size_t n); - - /* Appends the string pointed to, by src to the end of the string pointed to by dest. */ extern char *strcat(char *dest, const char *src);