aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/boot/main.c
diff options
context:
space:
mode:
authorOlaf Hering <olh@suse.de>2005-08-07 23:24:38 -0400
committerPaul Mackerras <paulus@samba.org>2005-08-28 20:53:31 -0400
commitdecd300b30e499fe6be1bbfc5650fc971de8c1fa (patch)
treeef4c2842b943b951130abcd0fdf844fcb53720fd /arch/ppc64/boot/main.c
parent02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b (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.c55
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> 20static void gunzip(void *, int, unsigned char *, int *);
15#include <asm/processor.h> 21extern void flush_cache(void *, unsigned long);
16#include <asm/page.h> 22
17
18extern void *finddevice(const char *);
19extern int getprop(void *, const char *, void *, int);
20extern void printf(const char *fmt, ...);
21extern int sprintf(char *buf, const char *fmt, ...);
22void gunzip(void *, int, unsigned char *, int *);
23void *claim(unsigned int, unsigned int, unsigned int);
24void flush_cache(void *, unsigned long);
25void pause(void);
26extern void exit(void);
27
28unsigned long strlen(const char *s);
29void *memmove(void *dest, const void *src, unsigned long n);
30void *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
36char *avail_ram; 28static char *avail_ram;
37char *begin_avail, *end_avail; 29static char *begin_avail, *end_avail;
38char *avail_high; 30static char *avail_high;
39unsigned int heap_use; 31static unsigned int heap_use;
40unsigned int heap_max; 32static unsigned int heap_max;
41 33
42extern char _start[]; 34extern char _start[];
43extern char _vmlinux_start[]; 35extern 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};
55struct addr_range vmlinux = {0, 0, 0}; 47static struct addr_range vmlinux = {0, 0, 0};
56struct addr_range vmlinuz = {0, 0, 0}; 48static struct addr_range vmlinuz = {0, 0, 0};
57struct addr_range initrd = {0, 0, 0}; 49static struct addr_range initrd = {0, 0, 0};
58 50
59static char scratch[128<<10]; /* 128kB of scratch space for gunzip */ 51static 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
67int (*prom)(void *);
68
69void *chosen_handle;
70void *stdin;
71void *stdout;
72void *stderr;
73
74#undef DEBUG 59#undef DEBUG
75 60
76static unsigned long claim_base = PROG_START; 61static 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
280void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) 265static 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;