summaryrefslogtreecommitdiffstats
path: root/arch/ppc/chrpboot
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-02 02:36:47 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-02 02:36:47 +0000
commit8624512aa908741ba2795200133eae0d7f4557ea (patch)
treed5d3036fccf2604f4c98dedc11e8adb929d6b52e /arch/ppc/chrpboot
parent7b8f5d6f1d45d9f9de1d26e7d3c32aa5af11b488 (diff)
Merge with 2.3.48.
Diffstat (limited to 'arch/ppc/chrpboot')
-rw-r--r--arch/ppc/chrpboot/main.c20
-rw-r--r--arch/ppc/chrpboot/piggyback.c3
2 files changed, 9 insertions, 14 deletions
diff --git a/arch/ppc/chrpboot/main.c b/arch/ppc/chrpboot/main.c
index d54a429a9..91bf4d8c4 100644
--- a/arch/ppc/chrpboot/main.c
+++ b/arch/ppc/chrpboot/main.c
@@ -10,7 +10,6 @@
#include "../coffboot/zlib.h"
#include <asm/bootinfo.h>
#include <asm/processor.h>
-#define __KERNEL__
#include <asm/page.h>
extern void *finddevice(const char *);
@@ -49,17 +48,8 @@ chrpboot(int a1, int a2, void *prom)
printf("chrpboot starting: loaded at 0x%x\n\r", &_start);
- if (initrd_len) {
- initrd_size = initrd_len;
- initrd_start = (RAM_END - initrd_size) & ~0xFFF;
- a1 = initrd_start;
- a2 = initrd_size;
- printf("initial ramdisk moving 0x%x <- 0x%x (%x bytes)\n\r", initrd_start,
- initrd_data,initrd_size);
- memcpy((char *)initrd_start, initrd_data, initrd_size);
- end_avail = (char *)initrd_start;
- } else
- end_avail = (char *) RAM_END;
+ end_avail = (char *) RAM_END;
+
im = image_data;
len = image_len;
dst = (void *) PROG_START;
@@ -98,7 +88,7 @@ chrpboot(int a1, int a2, void *prom)
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_SYSMAP;
- rec->data[0] = sysmap_data;
+ rec->data[0] = (unsigned long)sysmap_data;
rec->data[1] = sysmap_len;
rec->size = sizeof(struct bi_record) + sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
@@ -129,6 +119,10 @@ void *zalloc(void *x, unsigned items, unsigned size)
void zfree(void *x, void *addr, unsigned nb)
{
+ nb = (nb + 7) & -8;
+ if (addr == (avail_ram - nb)) {
+ avail_ram -= nb;
+ }
}
#define HEAD_CRC 2
diff --git a/arch/ppc/chrpboot/piggyback.c b/arch/ppc/chrpboot/piggyback.c
index 172025802..304bc8f11 100644
--- a/arch/ppc/chrpboot/piggyback.c
+++ b/arch/ppc/chrpboot/piggyback.c
@@ -1,8 +1,9 @@
#include <stdio.h>
+#include <unistd.h>
extern long ce_exec_config[];
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
int i, cnt, pos, len;
unsigned int cksum, val;