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 | |
---|---|
|
|
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 | |
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 | } |
Note: See TracBrowser
for help on using the repository browser.