OvmfPkg LoadLinuxLib: Use kernel's EFI entry point where available
Usage of the EFI entry point was made feasible in the kernel x64 boot protocol 2.12 where a 32-bit & 64-bit entry point became well defined. http://git.kernel.org/linus/09c205af Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14132 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -604,14 +604,11 @@ SetupGraphics (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
SetupLinuxBootParams (
|
||||
IN VOID *Kernel,
|
||||
IN OUT struct boot_params *Bp
|
||||
)
|
||||
{
|
||||
SetupGraphics (Bp);
|
||||
|
||||
Bp->hdr.code32_start = (UINT32)(UINTN) Kernel;
|
||||
|
||||
SetupLinuxMemmap (Bp);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
@@ -644,7 +641,19 @@ LoadLinux (
|
||||
|
||||
InitLinuxDescriptorTables ();
|
||||
|
||||
SetupLinuxBootParams (Kernel, (struct boot_params*) KernelSetup);
|
||||
Bp->hdr.code32_start = (UINT32)(UINTN) Kernel;
|
||||
if (Bp->hdr.version >= 0x20c && Bp->hdr.handover_offset &&
|
||||
(Bp->hdr.load_flags & (sizeof (UINTN) == 4 ? BIT2 : BIT3))) {
|
||||
DEBUG ((EFI_D_INFO, "Jumping to kernel EFI handover point at ofs %x\n", Bp->hdr.handover_offset));
|
||||
|
||||
DisableInterrupts ();
|
||||
JumpToUefiKernel ((VOID*) gImageHandle, (VOID*) gST, KernelSetup, Kernel);
|
||||
}
|
||||
|
||||
//
|
||||
// Old kernels without EFI handover protocol
|
||||
//
|
||||
SetupLinuxBootParams (KernelSetup);
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Jumping to kernel\n"));
|
||||
DisableInterrupts ();
|
||||
|
Reference in New Issue
Block a user