main.c (6a923216aac01d0f3eeea606377b81541f1a2773) | main.c (fae59c39e885148acf42320fe0d4ebf4cb3e9231) |
---|---|
1/* 2 * Copyright (C) Paul Mackerras 1997. 3 * 4 * Updates for PPC64 by Todd Inglett, Dave Engebretsen & Peter Bergner. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 122 unchanged lines hidden (view full) --- 131 */ 132 printf("Allocating 0x%lx bytes for kernel ...\n\r", ei.memsize); 133 134 if (platform_ops.vmlinux_alloc) { 135 addr = platform_ops.vmlinux_alloc(ei.memsize); 136 } else { 137 if ((unsigned long)_start < ei.memsize) 138 fatal("Insufficient memory for kernel at address 0!" | 1/* 2 * Copyright (C) Paul Mackerras 1997. 3 * 4 * Updates for PPC64 by Todd Inglett, Dave Engebretsen & Peter Bergner. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 122 unchanged lines hidden (view full) --- 131 */ 132 printf("Allocating 0x%lx bytes for kernel ...\n\r", ei.memsize); 133 134 if (platform_ops.vmlinux_alloc) { 135 addr = platform_ops.vmlinux_alloc(ei.memsize); 136 } else { 137 if ((unsigned long)_start < ei.memsize) 138 fatal("Insufficient memory for kernel at address 0!" |
139 " (_start=%lx)\n\r", _start); | 139 " (_start=%p)\n\r", _start); |
140 } 141 142 /* Finally, gunzip the kernel */ 143 printf("gunzipping (0x%p <- 0x%p:0x%p)...", addr, 144 vmlinuz_addr, vmlinuz_addr+vmlinuz_size); 145 /* discard up to the actual load data */ 146 gunzip_discard(&gzstate, ei.elfoffset - sizeof(elfheader)); 147 len = gunzip_finish(&gzstate, addr, ei.memsize); | 140 } 141 142 /* Finally, gunzip the kernel */ 143 printf("gunzipping (0x%p <- 0x%p:0x%p)...", addr, 144 vmlinuz_addr, vmlinuz_addr+vmlinuz_size); 145 /* discard up to the actual load data */ 146 gunzip_discard(&gzstate, ei.elfoffset - sizeof(elfheader)); 147 len = gunzip_finish(&gzstate, addr, ei.memsize); |
148 printf("done 0x%lx bytes\n\r", len); | 148 printf("done 0x%x bytes\n\r", len); |
149 150 flush_cache(addr, ei.loadsize); 151 152 return (struct addr_range){addr, ei.memsize}; 153} 154 155static struct addr_range prep_initrd(struct addr_range vmlinux, 156 unsigned long initrd_addr, --- 27 unchanged lines hidden (view full) --- 184 void *old_addr = (void *)initrd_addr; 185 186 printf("Allocating 0x%lx bytes for initrd ...\n\r", 187 initrd_size); 188 initrd_addr = (unsigned long)malloc(initrd_size); 189 if (! initrd_addr) 190 fatal("Can't allocate memory for initial " 191 "ramdisk !\n\r"); | 149 150 flush_cache(addr, ei.loadsize); 151 152 return (struct addr_range){addr, ei.memsize}; 153} 154 155static struct addr_range prep_initrd(struct addr_range vmlinux, 156 unsigned long initrd_addr, --- 27 unchanged lines hidden (view full) --- 184 void *old_addr = (void *)initrd_addr; 185 186 printf("Allocating 0x%lx bytes for initrd ...\n\r", 187 initrd_size); 188 initrd_addr = (unsigned long)malloc(initrd_size); 189 if (! initrd_addr) 190 fatal("Can't allocate memory for initial " 191 "ramdisk !\n\r"); |
192 printf("Relocating initrd 0x%p <- 0x%p (0x%lx bytes)\n\r", | 192 printf("Relocating initrd 0x%lx <- 0x%p (0x%lx bytes)\n\r", |
193 initrd_addr, old_addr, initrd_size); 194 memmove((void *)initrd_addr, old_addr, initrd_size); 195 } 196 197 printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd_addr)); 198 199 /* Tell the kernel initrd address via device tree */ 200 devp = finddevice("/chosen"); --- 101 unchanged lines hidden --- | 193 initrd_addr, old_addr, initrd_size); 194 memmove((void *)initrd_addr, old_addr, initrd_size); 195 } 196 197 printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd_addr)); 198 199 /* Tell the kernel initrd address via device tree */ 200 devp = finddevice("/chosen"); --- 101 unchanged lines hidden --- |