diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-12-23 16:37:19 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-11-17 15:10:44 +0800 |
commit | a0bb3ea9ffb503450ab3f58674323424ec8b9f91 (patch) | |
tree | a7ac5108331bcb858634d4767342a7757a69c21b | |
parent | 01a518a4a1d52e60439fabbf8db620fc95649f09 (diff) | |
download | coreboot-a0bb3ea9ffb503450ab3f58674323424ec8b9f91.tar.xz |
locate_hob
-rw-r--r-- | src/northbridge/intel/haswell/mrc.asm | 71 | ||||
-rw-r--r-- | src/northbridge/intel/haswell/mrc_end_of_pei.asm | 4 | ||||
-rw-r--r-- | src/northbridge/intel/haswell/mrc_init_memory.asm | 4 | ||||
-rw-r--r-- | src/northbridge/intel/haswell/pei_svc.c | 21 |
4 files changed, 27 insertions, 73 deletions
diff --git a/src/northbridge/intel/haswell/mrc.asm b/src/northbridge/intel/haswell/mrc.asm index 354f93fc78..66e462e6bd 100644 --- a/src/northbridge/intel/haswell/mrc.asm +++ b/src/northbridge/intel/haswell/mrc.asm @@ -59,7 +59,7 @@ global ref_fffcd4a4 global ref_fffcd4e4 global fcn_fffa10df -global fcn_fffa11b3 +extern locate_hob global fcn_fffa1d20 global fcn_fffa56ac global fcn_fffa782c @@ -1439,73 +1439,6 @@ pop esi pop ebp ret -fcn_fffa11b3: -push ebp -mov ebp, esp -push edi -mov edi, edx -push esi -lea ecx, [ebp - 0x1c] -push ebx -mov ebx, eax -lea esp, [esp - 0x24] -mov eax, dword [0xff7d7538] -mov edx, dword [eax] -push ecx -push eax -call dword [edx + 0x30] ; ucall -add esp, 0x10 -jmp short loc_fffa1216 ; jmp 0xfffa1216 - -loc_fffa11d5: -cmp di, 0xfffffffffffffffe -je short loc_fffa11e1 ; je 0xfffa11e1 -cmp word [ecx + 4], di -jne short loc_fffa1211 ; jne 0xfffa1211 - -loc_fffa11e1: -mov edx, dword [ebx + 4] -cmp dword [ecx + 0x10], edx -mov eax, dword [ecx + 0xc] -jne short loc_fffa1206 ; jne 0xfffa1206 -cmp eax, dword [ebx] -jne short loc_fffa1206 ; jne 0xfffa1206 -mov esi, dword [ecx + 0x14] -mov eax, dword [ecx + 0x18] -xor esi, dword [ebx + 8] -xor eax, dword [ebx + 0xc] -or esi, eax -sete al -movzx eax, al -jmp short loc_fffa1208 ; jmp 0xfffa1208 - -loc_fffa1206: -xor eax, eax - -loc_fffa1208: -test eax, eax -je short loc_fffa1211 ; je 0xfffa1211 -lea eax, [ecx + 4] -jmp short loc_fffa121f ; jmp 0xfffa121f - -loc_fffa1211: -mov eax, dword [ecx] -mov dword [ebp - 0x1c], eax - -loc_fffa1216: -mov ecx, dword [ebp - 0x1c] -test ecx, ecx -jne short loc_fffa11d5 ; jne 0xfffa11d5 -xor eax, eax - -loc_fffa121f: -lea esp, [ebp - 0xc] -pop ebx -pop esi -pop edi -pop ebp -ret - fcn_fffa1d20: push ebp @@ -4137,7 +4070,7 @@ mov eax, dword [0xff7d7538] call mrc_init_memory mov edx, 0xfffe mov eax, mEfiMemoryRestoreDataGuid ; mov eax, 0xfffcd4c4 -call fcn_fffa11b3 ; call 0xfffa11b3 +call locate_hob add esp, 0x10 test eax, eax jne short loc_fffa5573 ; jne 0xfffa5573 diff --git a/src/northbridge/intel/haswell/mrc_end_of_pei.asm b/src/northbridge/intel/haswell/mrc_end_of_pei.asm index abec0e7c09..5e60c2c596 100644 --- a/src/northbridge/intel/haswell/mrc_end_of_pei.asm +++ b/src/northbridge/intel/haswell/mrc_end_of_pei.asm @@ -6,7 +6,7 @@ global ref_fffcd560 extern haswell_stepping extern haswell_family_model extern ref_fffcd4a4 -extern fcn_fffa11b3 +extern locate_hob extern PeiServiceGetBootMode extern gEfiPeiReadOnlyVariablePpiGuid @@ -33,7 +33,7 @@ call haswell_stepping call haswell_family_model mov edx, 4 mov eax, ref_fffcd4a4 ; mov eax, 0xfffcd4a4 -call fcn_fffa11b3 ; call 0xfffa11b3 +call locate_hob test eax, eax je short loc_fffa124f ; je 0xfffa124f mov byte [eax + 0x49], 0 diff --git a/src/northbridge/intel/haswell/mrc_init_memory.asm b/src/northbridge/intel/haswell/mrc_init_memory.asm index 43416e8f11..27aa201d14 100644 --- a/src/northbridge/intel/haswell/mrc_init_memory.asm +++ b/src/northbridge/intel/haswell/mrc_init_memory.asm @@ -11,7 +11,7 @@ extern ref_fffcd4a4 extern ref_fffcd4e4 extern fcn_fffa10df -extern fcn_fffa11b3 +extern locate_hob extern fcn_fffa1d20 extern fcn_fffa56ac extern fcn_fffa782c @@ -294,7 +294,7 @@ mov edi, 2 loc_fffc1f53: mov edx, 4 mov eax, ref_fffcd4a4 ; mov eax, 0xfffcd4a4 -call fcn_fffa11b3 ; call 0xfffa11b3 +call locate_hob test eax, eax je short loc_fffc1f77 ; je 0xfffc1f77 mov dl, byte [eax + 0x21] diff --git a/src/northbridge/intel/haswell/pei_svc.c b/src/northbridge/intel/haswell/pei_svc.c index 290c9eaaa0..d0ce344a75 100644 --- a/src/northbridge/intel/haswell/pei_svc.c +++ b/src/northbridge/intel/haswell/pei_svc.c @@ -154,3 +154,24 @@ void init_pei_svc(EFI_PEI_SERVICES *sv) sv->ReportStatusCode = dummy_func; sv->CpuIo = &gCpuIoPpi; } + +EFI_HOB_DATA * __attribute((regparm(2))) +locate_hob(EFI_GUID *guid, uint16_t v); +EFI_HOB_DATA * __attribute((regparm(2))) +locate_hob(EFI_GUID *guid, uint16_t v) +{ + EFI_HOB *hoblist; + const EFI_PEI_SERVICES **pps = *gpPei; + + (*pps)->GetHobList(pps, (void**)&hoblist); + + for (EFI_HOB *hb = hoblist; hb != NULL; hb = hb->next) { + if (v != 0xfffe) { + hb->hobdata.htype = v; + continue; + } + if (memcmp(&hb->hobdata.data[1], guid, 16) == 0) + return &hb->hobdata; + } + return NULL; +} |