[coreboot] [commit] r5600 - in trunk/src: cpu/x86/smm southbridge/intel/i82801dx southbridge/intel/i82801gx

Patrick Georgi patrick at georgi-clan.de
Tue Jun 1 08:33:55 CEST 2010


Am 01.06.2010 07:44, schrieb Peter Stuge:
> repository service wrote:
>> +++ trunk/src/cpu/x86/smm/Makefile.inc	Sun May 30 15:44:32 2010	(r5600)
> ..
>> +	cd $(obj)/cpu/x86/smm; $(OBJCOPY) -I binary smm -O elf32-i386 -B i386 smm_wrap.o
> 
> Could use --redefine-sym and -N to manage symbol names. An example at
> http://www.coreboot.org/Initramfs
We'd have to cope with all mangling rules that objcopy applies to the
full path. This is more robust.

And we can't use the same symbols we used to use, as the semantics of
size are different. Better use different ones, so any issue breaks the
build instead of breaking runtime.

>> +++ trunk/src/southbridge/intel/i82801dx/i82801dx_smi.c	Sun May 30 15:44:32 2010	(r5600)
> ..
>> +extern unsigned char _binary_smm_start;
>> +extern unsigned char _binary_smm_size;
> ..
>> +	memcpy((void *)0xa0000, &_binary_smm_start, (size_t)&_binary_smm_size);
> 
>> +++ trunk/src/southbridge/intel/i82801gx/i82801gx_smi.c	Sun May 30 15:44:32 2010	(r5600)
> ..
>> +	memcpy((void *)0xa0000, &_binary_smm_start, (size_t)&_binary_smm_size);
> 
> Is the pointer to _size really right?
Yes, objcopy doesn't store the size as a value in memory, but simply
stuffs another symbol into the symbol table.
We don't want the value at *(number of bytes), which is what we'd get
without the dereference.


Patrick




More information about the coreboot mailing list