source: rtems/c/src/lib/libbsp/powerpc/shared/bootloader/lib.c @ df49c60

4.104.114.84.95
Last change on this file since df49c60 was acc25ee, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 2, 1999 at 2:31:19 PM

Merged of mcp750 and mvme2307 BSP by Eric Valette <valette@…>.
As part of this effort, the mpc750 libcpu code is now shared with the
ppc6xx.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/* 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$
16 */
17
18
19void* 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
26void* 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                                                     
35char* 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
46int strlen(const char* string)
47{
48  register int i = 0;
49
50  while (string[i] != '\0')
51    ++i;
52  return i;
53}
Note: See TracBrowser for help on using the repository browser.