From 510a1ab1e9d9cfbb2bdba9cb08ff5cf433f0b243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 23 Feb 2004 05:18:51 +0000 Subject: [PATCH] Removed arch_cpu_user_strncpy()/strcpy(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6698 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/arch/ppc/arch_cpu.c | 34 ----------------------- src/kernel/core/arch/sh4/arch_cpu.c | 34 ----------------------- src/kernel/core/arch/x86/arch_cpu.c | 42 ----------------------------- 3 files changed, 110 deletions(-) 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) {