Re: [PATCH 6/7] setup.c: clean up initrd related code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Franck Bui-Huu wrote:
> Thiemo Seufer wrote:
>> Franck Bui-Huu wrote:
>>> Atsushi,
>>>
>>> Franck Bui-Huu wrote:
>>>> Signed-off-by: Franck Bui-Huu <fbuihuu@xxxxxxxxx>
>>>> ---
>>> [snip]
>>>> @@ -176,24 +174,34 @@ static unsigned long __init init_initrd(
>>> [snip]
>>>>  	end = (unsigned long)&_end;
>>>>  	tmp = PAGE_ALIGN(end) - sizeof(u32) * 2;
>>>>  	if (tmp < end)
>>>>  		tmp += PAGE_SIZE;
>>>>  
>>> Any idea on what is this code for ?
>>> It seems that a minimum gap is needed betweend the end of kernel
>>> code and initrd but I don't see why...
>> AFAIR the bootmem map is placed there.
>>
> 
> boot_mem_map[] seems to be located in bss.
> 

ok I think I got it...

Actually sizeof(u32) * 2 is the place reserved for the initrd header
and this header is right before initrd itself.

	initrd_header[0] -> magic number
	initrd_header[1] -> size of initrd
		initrd start
		    ...
		initrd end

and initrd start must be PAGE_SIZE aligned, surely because we free it
with a page granularity.

		Franck


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux