diff options
author | Vladimir Serbinenko <phcoder@gmail.com> | 2014-01-12 14:28:56 +0100 |
---|---|---|
committer | Vladimir Serbinenko <phcoder@gmail.com> | 2014-01-12 18:04:38 +0100 |
commit | c2ee6801e89b3d4f346e075a034e04716b91d0b7 (patch) | |
tree | 739aa150acc68de5ba79c913d8184bab83abc302 /src/northbridge/intel | |
parent | f3c3dae580d92feba8fe07f407c89843ea9721cc (diff) |
sandybridge: Use calls rather than asm to call to MRC.
Using asm as it's done currently is unsafe because caller-saved registers
are not declared as clobbered.
Using real call is nicer.
regparm((1)) ensures that argument is passed in %eax as expected.
Change-Id: I7449182582eaa53d4e473bc834b472edd8ee0d30
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/4675
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/northbridge/intel')
-rw-r--r-- | src/northbridge/intel/sandybridge/raminit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c index 6e5296563e..07172fc768 100644 --- a/src/northbridge/intel/sandybridge/raminit.c +++ b/src/northbridge/intel/sandybridge/raminit.c @@ -219,7 +219,7 @@ static void post_system_agent_init(struct pei_data *pei_data) void sdram_initialize(struct pei_data *pei_data) { struct sys_info sysinfo; - unsigned long entry; + int (*entry) (struct pei_data *pei_data) __attribute__ ((regparm(1))); report_platform_info(); @@ -252,13 +252,11 @@ void sdram_initialize(struct pei_data *pei_data) /* Locate and call UEFI System Agent binary. */ /* TODO make MRC blob (0xab?) defined in cbfs_core.h. */ - entry = (unsigned long)cbfs_get_file_content( + entry = cbfs_get_file_content( CBFS_DEFAULT_MEDIA, "mrc.bin", 0xab, NULL); if (entry) { int rv; - asm volatile ( - "call *%%ecx\n\t" - :"=a" (rv) : "c" (entry), "a" (pei_data)); + rv = entry (pei_data); if (rv) { switch (rv) { case -1: |