Ignore:
Timestamp:
Apr 21, 2017, 4:28:29 AM (2 months ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.18/arch/s390/boot/compressed/misc.c

    r25370 r31885  
    143143unsigned long decompress_kernel(void)
    144144{
    145         unsigned long output_addr;
    146         unsigned char *output;
     145        void *output, *kernel_end;
    147146
    148         output_addr = ((unsigned long) &_end + HEAP_SIZE + 4095UL) & -4096UL;
    149         check_ipl_parmblock((void *) 0, output_addr + SZ__bss_start);
    150         memset(&_bss, 0, &_ebss - &_bss);
    151         free_mem_ptr = (unsigned long)&_end;
    152         free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
    153         output = (unsigned char *) output_addr;
     147        output = (void *) ALIGN((unsigned long) &_end + HEAP_SIZE, PAGE_SIZE);
     148        kernel_end = output + SZ__bss_start;
     149        check_ipl_parmblock((void *) 0, (unsigned long) kernel_end);
    154150
    155151#ifdef CONFIG_BLK_DEV_INITRD
    156152        /*
    157153         * Move the initrd right behind the end of the decompressed
    158          * kernel image.
     154         * kernel image. This also prevents initrd corruption caused by
     155         * bss clearing since kernel_end will always be located behind the
     156         * current bss section..
    159157         */
    160         if (INITRD_START && INITRD_SIZE &&
    161             INITRD_START < (unsigned long) output + SZ__bss_start) {
    162                 check_ipl_parmblock(output + SZ__bss_start,
    163                                     INITRD_START + INITRD_SIZE);
    164                 memmove(output + SZ__bss_start,
    165                         (void *) INITRD_START, INITRD_SIZE);
    166                 INITRD_START = (unsigned long) output + SZ__bss_start;
     158        if (INITRD_START && INITRD_SIZE && kernel_end > (void *) INITRD_START) {
     159                check_ipl_parmblock(kernel_end, INITRD_SIZE);
     160                memmove(kernel_end, (void *) INITRD_START, INITRD_SIZE);
     161                INITRD_START = (unsigned long) kernel_end;
    167162        }
    168163#endif
     164
     165        /*
     166         * Clear bss section. free_mem_ptr and free_mem_end_ptr need to be
     167         * initialized afterwards since they reside in bss.
     168         */
     169        memset(&_bss, 0, &_ebss - &_bss);
     170        free_mem_ptr = (unsigned long) &_end;
     171        free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
    169172
    170173        puts("Uncompressing Linux... ");
Note: See TracChangeset for help on using the changeset viewer.