[coreboot] stage2 access to LAR

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sat Jan 26 02:45:53 CET 2008


On 25.01.2008 22:30, Stefan Reinauer wrote:
> ron minnich wrote:
>> how does stage 2 access LAR? The mem_file struct is an auto (local)
>> for stage1.
>>
>> void __attribute__((stdcall)) stage1_main(u32 bist)
>> {
>>         int ret;
>>         struct mem_file archive, result;
>>         int elfboot_mem(struct lb_memory *mem, void *where, int size);
>>         void *entry;
>>
>> You need that mem_file struct ... how do we get this made available to
>> other functions?
>>
>> Remember, you can't make it global to the file before RAM is turned
>> on ...
>>
>> Just have a global that is assigned once RAM is on?
>>   
>
> Or make it local to ..eh.. whats it called in v3? hardware_main()
>
> You can always get the mem_file filled with:
>
>        /* The len field starts behind the reset vector on x86.
>         * The start is not correct for all platforms. sc520 will
>         * need some hands on here.
>         */
>        archive.len = *(u32 *)0xfffffff4;
>        archive.start =(void *)(0UL-archive.len);

Sounds like a good solution. I think most alternatives (passing the info
from stage1) are probably going to break.

Then again, some time in the future I'd actually like to pass info from
stage1 to stage2. Introducing a void * pointer which points to a struct
on the stack of stage1 could solve that problem.

Regards,
Carl-Daniel




More information about the coreboot mailing list