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

Last change on this file since 116633f was 116633f, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:45:20

2003-09-04 Joel Sherrill <joel@…>

  • bootloader/bootldr.h, bootloader/em86.c, bootloader/em86real.S, bootloader/exception.S, bootloader/head.S, bootloader/lib.c, bootloader/misc.c, bootloader/mm.c, bootloader/pci.c, clock/p_clock.c, console/console.c, console/consoleIo.h, console/inch.c, console/keyboard.h, console/polled_io.c, include/bsp.h, irq/i8259.c, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, motorola/motorola.c, motorola/motorola.h, openpic/openpic.c, openpic/openpic.h, pci/pci.c, residual/residual.c, start/start.S, startup/bspstart.c, vectors/vectors.h, vectors/vectors_init.c: URL for license changed.
  • 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.rtems.com/license/LICENSE.
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.