diff --git a/src/kernel/core/arch/ppc/arch_cpu.c b/src/kernel/core/arch/ppc/arch_cpu.c index c4e649c724..8635583d6d 100755 --- a/src/kernel/core/arch/ppc/arch_cpu.c +++ b/src/kernel/core/arch/ppc/arch_cpu.c @@ -141,40 +141,6 @@ error: } -int -arch_cpu_user_strcpy(char *to, const char *from, addr *fault_handler) -{ - *fault_handler = (addr)&&error; - - while ((*to++ = *from++) != '\0') - ; - - *fault_handler = 0; - return 0; - -error: - *fault_handler = 0; - return B_BAD_ADDRESS; -} - - -int -arch_cpu_user_strncpy(char *to, const char *from, size_t size, addr *fault_handler) -{ - *fault_handler = (addr)&&error; - - while(size-- && (*to++ = *from++) != '\0') - ; - - *fault_handler = 0; - return 0; - -error: - *fault_handler = 0; - return B_BAD_ADDRESS; -} - - /** \brief Copies at most (\a size - 1) characters from the string in \a from to * the string in \a to, NULL-terminating the result. * diff --git a/src/kernel/core/arch/sh4/arch_cpu.c b/src/kernel/core/arch/sh4/arch_cpu.c index 621eec9d79..2d35e0260a 100755 --- a/src/kernel/core/arch/sh4/arch_cpu.c +++ b/src/kernel/core/arch/sh4/arch_cpu.c @@ -148,40 +148,6 @@ error: } -int -arch_cpu_user_strcpy(char *to, const char *from, addr *fault_handler) -{ - *fault_handler = (addr)&&error; - - while((*to++ = *from++) != '\0') - ; - - *fault_handler = 0; - - return 0; -error: - *fault_handler = 0; - return ERR_VM_BAD_USER_MEMORY; -} - - -int -arch_cpu_user_strncpy(char *to, const char *from, size_t size, addr *fault_handler) -{ - *fault_handler = (addr)&&error; - - while(size-- && (*to++ = *from++) != '\0') - ; - - *fault_handler = 0; - - return 0; -error: - *fault_handler = 0; - return ERR_VM_BAD_USER_MEMORY; -} - - int arch_cpu_user_memset(void *s, char c, size_t count, addr *fault_handler) { diff --git a/src/kernel/core/arch/x86/arch_cpu.c b/src/kernel/core/arch/x86/arch_cpu.c index 3e3290c8fe..af26ab7a80 100755 --- a/src/kernel/core/arch/x86/arch_cpu.c +++ b/src/kernel/core/arch/x86/arch_cpu.c @@ -162,48 +162,6 @@ error: } -int -arch_cpu_user_strcpy(char *to, const char *from, addr *fault_handler) -{ - *fault_handler = (addr)&&error; - - while ((*to++ = *from++) != '\0') - ; - - *fault_handler = 0; - return 0; - -error: - *fault_handler = 0; - return B_BAD_ADDRESS; -} - - -int -arch_cpu_user_strncpy(char *to, const char *from, size_t size, addr *fault_handler) -{ - *fault_handler = (addr)&&error; - - while(size-- && (*to++ = *from++) != '\0') - ; - - *fault_handler = 0; - return 0; - -error: - *fault_handler = 0; - return B_BAD_ADDRESS; -} - -/*! \brief Copies at most (\a size - 1) characters from the string in \a from to - the string in \a to, NULL-terminating the result. - - \param to Pointer to the destination C-string. - \param from Pointer to the source C-string. - \param size Size in bytes of the string buffer pointed to by \a to. - - \return strlen(\a from). -*/ int arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr *faultHandler) {