OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [powerpc/] [shared/] [bootloader/] [lib.c] - Rev 30

Go to most recent revision | Compare with Previous | Blame | View Log

/* lib.c
 *
 *  This file contains the implementation of functions that are unresolved
 *  in the bootloader.  Unfortunately it  shall not use any object code
 *  from newlib or rtems  because they are not compiled with the right option!!!
 *
 *  You've been warned!!!.
 *
 *  CopyRight (C) 1998, 1999 valette@crf.canon.fr
 *
 *  The license and distribution terms for this file may be
 *  found in found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *  $Id: lib.c,v 1.2 2001-09-27 12:01:06 chris Exp $
 */
 
 
void* memset(void *p, int c, unsigned int n)
{
  char *q =p;
  for(; n>0; --n) *q++=c;
  return p;
}
 
void* memcpy(void *dst, const void * src, unsigned int n)
{
  unsigned char *d=dst;
  const unsigned char *s=src;
 
  while(n-- > 0) *d++=*s++;
  return dst;
}
 
char* strcat(char * dest, const char * src)
{
  char *tmp = dest;
 
  while (*dest)
    dest++;
  while ((*dest++ = *src++) != '\0')
    ;
  return tmp;
}
 
int strlen(const char* string)
{
  register int i = 0;
 
  while (string[i] != '\0')
    ++i;
  return i;
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.