remove bcopy & bzero from archs

This commit is contained in:
jani 2002-12-19 10:37:07 +00:00
parent f946abd86b
commit 2c2fec1b0e
10 changed files with 4 additions and 114 deletions

View File

@ -154,7 +154,7 @@ low_level_output(struct netif *netif, struct pbuf *p)
time. The size of the data in each pbuf is kept in the ->len
variable. */
/* send data from(q->payload, q->len); */
bcopy(q->payload, bufptr, q->len);
memcpy(bufptr, q->payload, q->len);
bufptr += q->len;
}
@ -203,7 +203,7 @@ low_level_input(struct mintapif *mintapif)
avaliable data in the pbuf is given by the q->len
variable. */
/* read data into(q->payload, q->len); */
bcopy(bufptr, q->payload, q->len);
memcpy(q->payload, bufptr, q->len);
bufptr += q->len;
}
/* acknowledge that packet has been read(); */

View File

@ -34,7 +34,5 @@
int strlen(const char *str);
int strncmp(const char *str1, const char *str2, int len);
void bcopy(const void *src, void *dest, int len);
void bzero(void *data, int n);
#endif /* __LIB_H__ */

View File

@ -36,28 +36,4 @@
* assembler.
*/
#include "lwip/arch.h"
/*-----------------------------------------------------------------------------------*/
void
bcopy(const void *src, void *dst, unsigned int size)
{
char *csrc, *cdst;
unsigned int i;
csrc = (char *)src;
cdst = dst;
for(i = 0; i < size; ++i) {
cdst[i] = csrc[i];
}
}
/*-----------------------------------------------------------------------------------*/
void
bzero(void *s, int n)
{
for(--n ;n >= 0; --n) {
((char *)s)[n] = 0;
}
}
/*-----------------------------------------------------------------------------------*/

View File

@ -30,14 +30,10 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: lib.h,v 1.1 2002/11/29 11:03:34 likewise Exp $
* $Id: lib.h,v 1.2 2002/12/19 10:37:08 jani Exp $
*/
#ifndef __LIB_H__
#define __LIB_H__
//int strlen(const char *str);
//int strncmp(const char *str1, const char *str2, int len);
void bcopy(const void *src, void *dest, int len);
void bzero(void *data, int n);
#endif /* __LIB_H__ */

View File

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: lib.c,v 1.1 2002/11/29 11:03:34 likewise Exp $
* $Id: lib.c,v 1.2 2002/12/19 10:37:07 jani Exp $
*/
/* These are generic implementations of various library functions used
@ -71,26 +71,3 @@ ntohl(u32_t n)
}
/*-----------------------------------------------------------------------------------*/
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
void
bcopy(const void *src, void *dst, unsigned int size)
{
char *csrc, *cdst;
int i;
csrc = (char *)src;
cdst = dst;
for(i = 0; i < size; i++) {
cdst[i] = csrc[i];
}
}
/*-----------------------------------------------------------------------------------*/
void
bzero(void *s, int n)
{
for(n--; n > 0; n--) {
((char *)s)[n] = 0;
}
}
/*-----------------------------------------------------------------------------------*/

View File

@ -36,8 +36,6 @@
#ifndef _STRING_H
int strlen(const char *str);
int strncmp(const char *str1, const char *str2, int len);
void bcopy(const void *src, void *dest, int len);
void bzero(void *data, int n);
#endif /* _STRING_H */
#endif /* _STRING_H_ */

View File

@ -34,7 +34,5 @@
#include <string.h>
#define bcopy(s, d, l) memcpy(d, s, l)
#define bzero(d, l) memset(d, 0, l)
#endif /* __LIB_H__ */

View File

@ -36,28 +36,3 @@
* assembler.
*/
#if 0 /* Define to 1 if these are really needed. */
/*-----------------------------------------------------------------------------------*/
void
bcopy(const void *src, void *dst, unsigned int size)
{
char *csrc, *cdst;
unsigned int i;
csrc = (char *)src;
cdst = dst;
for(i = 0; i < size; ++i) {
cdst[i] = csrc[i];
}
}
/*-----------------------------------------------------------------------------------*/
void
bzero(void *s, int n)
{
for(--n ;n >= 0; --n) {
((char *)s)[n] = 0;
}
}
/*-----------------------------------------------------------------------------------*/
#endif /* 0 */

View File

@ -34,7 +34,5 @@
#ifndef __ARCH_LIB_H__
#define __ARCH_LIB_H__
void bcopy(const void *src, void *dest, int len);
void bzero(void *data, int n);
#endif /* __ARCH_LIB_H__ */

View File

@ -31,29 +31,3 @@
*
*/
#include "lwip/arch.h"
/*---------------------------------------------------------------------------*/
void
bcopy(const void *src, void *dst, unsigned int size)
{
unsigned int i;
for(i = 0; i < size; ++i) {
((char *)dst)[i] = ((char *) src)[i];
}
}
/*---------------------------------------------------------------------------*/
void
bzero(void *s, int n)
{
for(--n ;n >= 0; --n) {
((char *)s)[n] = 0;
}
}
/*---------------------------------------------------------------------------*/