x86 SMM: Fix use with RELOCATABLE_RAMSTAGE
The value for _size was not evaluated correctly if ramstage is relocated, make the calculation runtime. While touching it, move symbol declarations to header file. Change-Id: I4402315945771acf1c86a81cac6d43f1fe99a2a2 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/17784 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
@@ -26,9 +26,6 @@
|
||||
#include <cpu/x86/smm.h>
|
||||
#include <string.h>
|
||||
|
||||
extern unsigned char _binary_smm_start;
|
||||
extern unsigned char _binary_smm_size;
|
||||
|
||||
void smm_init(void)
|
||||
{
|
||||
msr_t msr, syscfg_orig, mtrr_aseg_orig;
|
||||
@@ -63,7 +60,8 @@ void smm_init(void)
|
||||
|
||||
enable_cache();
|
||||
/* copy the real SMM handler */
|
||||
memcpy((void *)SMM_BASE, &_binary_smm_start, (size_t)&_binary_smm_size);
|
||||
memcpy((void *)SMM_BASE, _binary_smm_start,
|
||||
_binary_smm_end - _binary_smm_start);
|
||||
wbinvd();
|
||||
disable_cache();
|
||||
|
||||
|
@@ -45,9 +45,6 @@ struct smm_stub_params {
|
||||
*/
|
||||
extern unsigned char _binary_smmstub_start[];
|
||||
|
||||
/* This is the SMM handler that the stub calls. It is encoded as an rmodule. */
|
||||
extern unsigned char _binary_smm_start[];
|
||||
|
||||
/* Per CPU minimum stack size. */
|
||||
#define SMM_MINIMUM_STACK_SIZE 32
|
||||
|
||||
|
Reference in New Issue
Block a user