summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/bootloader/lib.c
blob: 242f637b5d3e5e24055f1d358487e96a163e3833 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* 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$
 */


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;
}