diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2011-07-16 01:21:36 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2011-07-16 01:21:36 +0000 |
commit | 9c39236d0d90237039c284c0832b3cc26fc10d34 (patch) | |
tree | 0feb14e87300582f96b722e65c35cd270ac9a19a /c | |
parent | 2011-07-15 Till Straumann <strauman@slac.stanford.edu> (diff) | |
download | rtems-9c39236d0d90237039c284c0832b3cc26fc10d34.tar.bz2 |
2011-07-15 Till Straumann <strauman@slac.stanford.edu>
* shared/bootloader/misc.c: Copy residual data
_before_ decompressing the kernel since the firmware
may have stored it in an area that is overwritten
by decompress_kernel().
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/ChangeLog | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/bootloader/misc.c | 16 |
2 files changed, 17 insertions, 6 deletions
diff --git a/c/src/lib/libbsp/powerpc/ChangeLog b/c/src/lib/libbsp/powerpc/ChangeLog index e9f7c9f0e1..55020ec622 100644 --- a/c/src/lib/libbsp/powerpc/ChangeLog +++ b/c/src/lib/libbsp/powerpc/ChangeLog @@ -1,5 +1,12 @@ 2011-07-15 Till Straumann <strauman@slac.stanford.edu> + * shared/bootloader/misc.c: Copy residual data + _before_ decompressing the kernel since the firmware + may have stored it in an area that is overwritten + by decompress_kernel(). + +2011-07-15 Till Straumann <strauman@slac.stanford.edu> + * shared/startup/ppc_idle.c: added an 'idle task' body which switches the CPU into power-save mode. IIRC, this cannot be used on real hardware due to errata :-( but diff --git a/c/src/lib/libbsp/powerpc/shared/bootloader/misc.c b/c/src/lib/libbsp/powerpc/shared/bootloader/misc.c index 71bacbb808..9f241c27f7 100644 --- a/c/src/lib/libbsp/powerpc/shared/bootloader/misc.c +++ b/c/src/lib/libbsp/powerpc/shared/bootloader/misc.c @@ -176,15 +176,17 @@ void decompress_kernel(int kernel_size, void * zimage_start, int len, printk("Not enough memory to uncompress the kernel."); exit(); } + + rescopy=salloc(sizeof(RESIDUAL)); + /* Let us hope that residual data is aligned on word boundary */ + *rescopy = *bd->residual; + bd->residual = (void *)PAGE_ALIGN(kernel_size); + /* Note that this clears the bss as a side effect, so some code * with ugly special case for SMP could be removed from the kernel! */ memset(parea, 0, kernel_size); printk("\nUncompressing the kernel...\n"); - rescopy=salloc(sizeof(RESIDUAL)); - /* Let us hope that residual data is aligned on word boundary */ - *rescopy = *bd->residual; - bd->residual = (void *)PAGE_ALIGN(kernel_size); gunzip(parea, kernel_size, zimage_start, &zimage_size); @@ -287,13 +289,15 @@ setup_hw(void) printk("\nModel: %s\nSerial: %s\n" "Processor/Bus frequencies (Hz): %ld/%ld\n" "Time Base Divisor: %ld\n" - "Memory Size: %lx\n", + "Memory Size: %lx\n" + "Residual: %lx (length %u)\n", vpd.PrintableModel, vpd.Serial, vpd.ProcessorHz, vpd.ProcessorBusHz, (vpd.TimeBaseDivisor ? vpd.TimeBaseDivisor : 4000), - res->TotalMemory); + res->TotalMemory, + (unsigned long)res, res->ResidualLength); /* This reconfigures all the PCI subsystem */ pci_init(); |