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] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/* lib.c
2
 *
3
 *  This file contains the implementation of functions that are unresolved
4
 *  in the bootloader.  Unfortunately it  shall not use any object code
5
 *  from newlib or rtems  because they are not compiled with the right option!!!
6
 *
7
 *  You've been warned!!!.
8
 *
9
 *  CopyRight (C) 1998, 1999 valette@crf.canon.fr
10
 *
11
 *  The license and distribution terms for this file may be
12
 *  found in found in the file LICENSE in this distribution or at
13
 *  http://www.OARcorp.com/rtems/license.html.
14
 *
15
 *  $Id: lib.c,v 1.2 2001-09-27 12:01:06 chris Exp $
16
 */
17
 
18
 
19
void* memset(void *p, int c, unsigned int n)
20
{
21
  char *q =p;
22
  for(; n>0; --n) *q++=c;
23
  return p;
24
}
25
 
26
void* memcpy(void *dst, const void * src, unsigned int n)
27
{
28
  unsigned char *d=dst;
29
  const unsigned char *s=src;
30
 
31
  while(n-- > 0) *d++=*s++;
32
  return dst;
33
}
34
 
35
char* strcat(char * dest, const char * src)
36
{
37
  char *tmp = dest;
38
 
39
  while (*dest)
40
    dest++;
41
  while ((*dest++ = *src++) != '\0')
42
    ;
43
  return tmp;
44
}
45
 
46
int strlen(const char* string)
47
{
48
  register int i = 0;
49
 
50
  while (string[i] != '\0')
51
    ++i;
52
  return i;
53
}

powered by: WebSVN 2.1.0

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