diff options
author | Olaf Hering <olh@suse.de> | 2005-08-07 23:24:38 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-08-28 20:53:31 -0400 |
commit | decd300b30e499fe6be1bbfc5650fc971de8c1fa (patch) | |
tree | ef4c2842b943b951130abcd0fdf844fcb53720fd /arch/ppc64/boot/main.c | |
parent | 02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b (diff) |
[PATCH] ppc64: make arch/ppc64/boot standalone
Make the bootheader for ppc64 independent from kernel and libc headers.
* add -nostdinc -isystem $gccincludes to not include libc headers
* declare all functions in header files, also the stuff from string.S
* declare some functions static
* use stddef.h to get size_t (hopefully ok)
* remove ppc32-types.h, only elf.h used the __NN types
With further modifications by Paul Mackerras and Stephen Rothwell.
Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/boot/main.c')
-rw-r--r-- | arch/ppc64/boot/main.c | 55 |
1 files changed, 20 insertions, 35 deletions
diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c index 199d9804f61c..99e68cfbe688 100644 --- a/arch/ppc64/boot/main.c +++ b/arch/ppc64/boot/main.c | |||
@@ -8,36 +8,28 @@ | |||
8 | * as published by the Free Software Foundation; either version | 8 | * as published by the Free Software Foundation; either version |
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | #include "ppc32-types.h" | 11 | #include <stdarg.h> |
12 | #include <stddef.h> | ||
13 | #include "elf.h" | ||
14 | #include "page.h" | ||
15 | #include "string.h" | ||
16 | #include "stdio.h" | ||
17 | #include "prom.h" | ||
12 | #include "zlib.h" | 18 | #include "zlib.h" |
13 | #include <linux/elf.h> | 19 | |
14 | #include <linux/string.h> | 20 | static void gunzip(void *, int, unsigned char *, int *); |
15 | #include <asm/processor.h> | 21 | extern void flush_cache(void *, unsigned long); |
16 | #include <asm/page.h> | 22 | |
17 | |||
18 | extern void *finddevice(const char *); | ||
19 | extern int getprop(void *, const char *, void *, int); | ||
20 | extern void printf(const char *fmt, ...); | ||
21 | extern int sprintf(char *buf, const char *fmt, ...); | ||
22 | void gunzip(void *, int, unsigned char *, int *); | ||
23 | void *claim(unsigned int, unsigned int, unsigned int); | ||
24 | void flush_cache(void *, unsigned long); | ||
25 | void pause(void); | ||
26 | extern void exit(void); | ||
27 | |||
28 | unsigned long strlen(const char *s); | ||
29 | void *memmove(void *dest, const void *src, unsigned long n); | ||
30 | void *memcpy(void *dest, const void *src, unsigned long n); | ||
31 | 23 | ||
32 | /* Value picked to match that used by yaboot */ | 24 | /* Value picked to match that used by yaboot */ |
33 | #define PROG_START 0x01400000 | 25 | #define PROG_START 0x01400000 |
34 | #define RAM_END (256<<20) // Fixme: use OF */ | 26 | #define RAM_END (256<<20) // Fixme: use OF */ |
35 | 27 | ||
36 | char *avail_ram; | 28 | static char *avail_ram; |
37 | char *begin_avail, *end_avail; | 29 | static char *begin_avail, *end_avail; |
38 | char *avail_high; | 30 | static char *avail_high; |
39 | unsigned int heap_use; | 31 | static unsigned int heap_use; |
40 | unsigned int heap_max; | 32 | static unsigned int heap_max; |
41 | 33 | ||
42 | extern char _start[]; | 34 | extern char _start[]; |
43 | extern char _vmlinux_start[]; | 35 | extern char _vmlinux_start[]; |
@@ -52,9 +44,9 @@ struct addr_range { | |||
52 | unsigned long size; | 44 | unsigned long size; |
53 | unsigned long memsize; | 45 | unsigned long memsize; |
54 | }; | 46 | }; |
55 | struct addr_range vmlinux = {0, 0, 0}; | 47 | static struct addr_range vmlinux = {0, 0, 0}; |
56 | struct addr_range vmlinuz = {0, 0, 0}; | 48 | static struct addr_range vmlinuz = {0, 0, 0}; |
57 | struct addr_range initrd = {0, 0, 0}; | 49 | static struct addr_range initrd = {0, 0, 0}; |
58 | 50 | ||
59 | static char scratch[128<<10]; /* 128kB of scratch space for gunzip */ | 51 | static char scratch[128<<10]; /* 128kB of scratch space for gunzip */ |
60 | 52 | ||
@@ -64,13 +56,6 @@ typedef void (*kernel_entry_t)( unsigned long, | |||
64 | void *); | 56 | void *); |
65 | 57 | ||
66 | 58 | ||
67 | int (*prom)(void *); | ||
68 | |||
69 | void *chosen_handle; | ||
70 | void *stdin; | ||
71 | void *stdout; | ||
72 | void *stderr; | ||
73 | |||
74 | #undef DEBUG | 59 | #undef DEBUG |
75 | 60 | ||
76 | static unsigned long claim_base = PROG_START; | 61 | static unsigned long claim_base = PROG_START; |
@@ -277,7 +262,7 @@ void zfree(void *x, void *addr, unsigned nb) | |||
277 | 262 | ||
278 | #define DEFLATED 8 | 263 | #define DEFLATED 8 |
279 | 264 | ||
280 | void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) | 265 | static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) |
281 | { | 266 | { |
282 | z_stream s; | 267 | z_stream s; |
283 | int r, i, flags; | 268 | int r, i, flags; |