OvmfPkg: drop PlatformBootManagerLibGrub
Not used any more, remove. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
81dc0d8b4c
commit
6fb2760dc8
File diff suppressed because it is too large
Load Diff
|
@ -1,185 +0,0 @@
|
||||||
/** @file
|
|
||||||
Platform BDS customizations include file.
|
|
||||||
|
|
||||||
Copyright (C) 2020 James Bottomley, IBM Corporation.
|
|
||||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
BdsPlatform.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Head file for BDS Platform specific code
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#ifndef _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
|
|
||||||
#define _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
|
|
||||||
|
|
||||||
#include <PiDxe.h>
|
|
||||||
|
|
||||||
#include <IndustryStandard/Pci.h>
|
|
||||||
#include <IndustryStandard/Acpi.h>
|
|
||||||
#include <IndustryStandard/SmBios.h>
|
|
||||||
#include <IndustryStandard/PeImage.h>
|
|
||||||
#include <IndustryStandard/Virtio095.h>
|
|
||||||
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/BaseMemoryLib.h>
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
|
||||||
#include <Library/MemoryAllocationLib.h>
|
|
||||||
#include <Library/BaseLib.h>
|
|
||||||
#include <Library/PcdLib.h>
|
|
||||||
#include <Library/PciLib.h>
|
|
||||||
#include <Library/UefiBootManagerLib.h>
|
|
||||||
#include <Library/BootLogoLib.h>
|
|
||||||
#include <Library/HobLib.h>
|
|
||||||
#include <Library/UefiLib.h>
|
|
||||||
#include <Library/DxeServicesTableLib.h>
|
|
||||||
#include <Library/DevicePathLib.h>
|
|
||||||
#include <Library/IoLib.h>
|
|
||||||
|
|
||||||
#include <Protocol/Decompress.h>
|
|
||||||
#include <Protocol/PciIo.h>
|
|
||||||
#include <Protocol/FirmwareVolume2.h>
|
|
||||||
#include <Protocol/SimpleFileSystem.h>
|
|
||||||
#include <Protocol/PciRootBridgeIo.h>
|
|
||||||
#include <Protocol/DxeSmmReadyToLock.h>
|
|
||||||
#include <Protocol/LoadedImage.h>
|
|
||||||
|
|
||||||
#include <Guid/Acpi.h>
|
|
||||||
#include <Guid/SmBios.h>
|
|
||||||
#include <Guid/HobList.h>
|
|
||||||
#include <Guid/GlobalVariable.h>
|
|
||||||
#include <Guid/EventGroup.h>
|
|
||||||
#include <Guid/DebugAgentGuid.h>
|
|
||||||
|
|
||||||
#include <OvmfPlatforms.h>
|
|
||||||
|
|
||||||
extern EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[];
|
|
||||||
extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode;
|
|
||||||
extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode;
|
|
||||||
extern UART_DEVICE_PATH gUartDeviceNode;
|
|
||||||
extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode;
|
|
||||||
|
|
||||||
#define PCI_DEVICE_PATH_NODE(Func, Dev) \
|
|
||||||
{ \
|
|
||||||
{ \
|
|
||||||
HARDWARE_DEVICE_PATH, \
|
|
||||||
HW_PCI_DP, \
|
|
||||||
{ \
|
|
||||||
(UINT8) (sizeof (PCI_DEVICE_PATH)), \
|
|
||||||
(UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \
|
|
||||||
} \
|
|
||||||
}, \
|
|
||||||
(Func), \
|
|
||||||
(Dev) \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define PNPID_DEVICE_PATH_NODE(PnpId) \
|
|
||||||
{ \
|
|
||||||
{ \
|
|
||||||
ACPI_DEVICE_PATH, \
|
|
||||||
ACPI_DP, \
|
|
||||||
{ \
|
|
||||||
(UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
|
|
||||||
(UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
|
|
||||||
}, \
|
|
||||||
}, \
|
|
||||||
EISA_PNP_ID((PnpId)), \
|
|
||||||
0 \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define gPciIsaBridge \
|
|
||||||
PCI_DEVICE_PATH_NODE(0, 0x1f)
|
|
||||||
|
|
||||||
#define gP2PBridge \
|
|
||||||
PCI_DEVICE_PATH_NODE(0, 0x1e)
|
|
||||||
|
|
||||||
#define gPnpPs2Keyboard \
|
|
||||||
PNPID_DEVICE_PATH_NODE(0x0303)
|
|
||||||
|
|
||||||
#define gPnp16550ComPort \
|
|
||||||
PNPID_DEVICE_PATH_NODE(0x0501)
|
|
||||||
|
|
||||||
#define gUart \
|
|
||||||
{ \
|
|
||||||
{ \
|
|
||||||
MESSAGING_DEVICE_PATH, \
|
|
||||||
MSG_UART_DP, \
|
|
||||||
{ \
|
|
||||||
(UINT8) (sizeof (UART_DEVICE_PATH)), \
|
|
||||||
(UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \
|
|
||||||
} \
|
|
||||||
}, \
|
|
||||||
0, \
|
|
||||||
115200, \
|
|
||||||
8, \
|
|
||||||
1, \
|
|
||||||
1 \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define gPcAnsiTerminal \
|
|
||||||
{ \
|
|
||||||
{ \
|
|
||||||
MESSAGING_DEVICE_PATH, \
|
|
||||||
MSG_VENDOR_DP, \
|
|
||||||
{ \
|
|
||||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)), \
|
|
||||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
|
|
||||||
} \
|
|
||||||
}, \
|
|
||||||
DEVICE_PATH_MESSAGING_PC_ANSI \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define gEndEntire \
|
|
||||||
{ \
|
|
||||||
END_DEVICE_PATH_TYPE, \
|
|
||||||
END_ENTIRE_DEVICE_PATH_SUBTYPE, \
|
|
||||||
{ \
|
|
||||||
END_DEVICE_PATH_LENGTH, \
|
|
||||||
0 \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define PCI_CLASS_SCC 0x07
|
|
||||||
#define PCI_SUBCLASS_SERIAL 0x00
|
|
||||||
#define PCI_IF_16550 0x02
|
|
||||||
#define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)
|
|
||||||
#define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE, 0)
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
|
||||||
UINTN ConnectType;
|
|
||||||
} PLATFORM_CONSOLE_CONNECT_ENTRY;
|
|
||||||
|
|
||||||
#define CONSOLE_OUT BIT0
|
|
||||||
#define CONSOLE_IN BIT1
|
|
||||||
#define STD_ERROR BIT2
|
|
||||||
extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[];
|
|
||||||
extern PLATFORM_CONSOLE_CONNECT_ENTRY gXenPlatformConsole[];
|
|
||||||
|
|
||||||
//
|
|
||||||
// Platform BDS Functions
|
|
||||||
//
|
|
||||||
|
|
||||||
VOID
|
|
||||||
PlatformInitializeConsole (
|
|
||||||
IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Loads and boots UEFI Linux via the FwCfg interface.
|
|
||||||
|
|
||||||
@retval EFI_NOT_FOUND - The Linux kernel was not found
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
TryRunningQemuKernel (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
|
|
|
@ -1,73 +0,0 @@
|
||||||
## @file
|
|
||||||
# Platform BDS customizations library.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2020 James Bottomley, IBM Corporation.
|
|
||||||
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
|
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
#
|
|
||||||
##
|
|
||||||
|
|
||||||
[Defines]
|
|
||||||
INF_VERSION = 0x00010005
|
|
||||||
BASE_NAME = PlatformBootManagerLibGrub
|
|
||||||
FILE_GUID = 3a8f8431-f0c9-4c95-8a1d-04445c582d4e
|
|
||||||
MODULE_TYPE = DXE_DRIVER
|
|
||||||
VERSION_STRING = 1.0
|
|
||||||
LIBRARY_CLASS = PlatformBootManagerLib|DXE_DRIVER
|
|
||||||
|
|
||||||
#
|
|
||||||
# The following information is for reference only and not required by the build tools.
|
|
||||||
#
|
|
||||||
# VALID_ARCHITECTURES = X64
|
|
||||||
#
|
|
||||||
|
|
||||||
[Sources]
|
|
||||||
BdsPlatform.c
|
|
||||||
QemuKernel.c
|
|
||||||
PlatformData.c
|
|
||||||
BdsPlatform.h
|
|
||||||
|
|
||||||
[Packages]
|
|
||||||
MdePkg/MdePkg.dec
|
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
|
||||||
SourceLevelDebugPkg/SourceLevelDebugPkg.dec
|
|
||||||
OvmfPkg/OvmfPkg.dec
|
|
||||||
SecurityPkg/SecurityPkg.dec
|
|
||||||
ShellPkg/ShellPkg.dec
|
|
||||||
|
|
||||||
[LibraryClasses]
|
|
||||||
BaseLib
|
|
||||||
MemoryAllocationLib
|
|
||||||
UefiBootServicesTableLib
|
|
||||||
UefiRuntimeServicesTableLib
|
|
||||||
BaseMemoryLib
|
|
||||||
DebugLib
|
|
||||||
PcdLib
|
|
||||||
UefiBootManagerLib
|
|
||||||
BootLogoLib
|
|
||||||
DevicePathLib
|
|
||||||
PciLib
|
|
||||||
QemuLoadImageLib
|
|
||||||
UefiLib
|
|
||||||
PlatformBmPrintScLib
|
|
||||||
Tcg2PhysicalPresenceLib
|
|
||||||
|
|
||||||
[Pcd]
|
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
|
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## CONSUMES
|
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits ## CONSUMES
|
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity ## CONSUMES
|
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits ## CONSUMES
|
|
||||||
|
|
||||||
[Protocols]
|
|
||||||
gEfiPciRootBridgeIoProtocolGuid
|
|
||||||
gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
|
|
||||||
gEfiLoadedImageProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
|
|
||||||
gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
|
|
||||||
|
|
||||||
[Guids]
|
|
||||||
gEfiEndOfDxeEventGroupGuid
|
|
||||||
gEfiGlobalVariableGuid
|
|
||||||
gRootBridgesConnectedEventGroupGuid
|
|
||||||
gUefiShellFileGuid
|
|
||||||
gGrubFileGuid
|
|
|
@ -1,212 +0,0 @@
|
||||||
/** @file
|
|
||||||
Defined the platform specific device path which will be used by
|
|
||||||
platform Bbd to perform the platform policy connect.
|
|
||||||
|
|
||||||
Copyright (C) 2020 James Bottomley, IBM Corporation.
|
|
||||||
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include "BdsPlatform.h"
|
|
||||||
#include <Guid/QemuRamfb.h>
|
|
||||||
#include <Guid/SerialPortLibVendor.h>
|
|
||||||
|
|
||||||
//
|
|
||||||
// Vendor UART Device Path structure
|
|
||||||
//
|
|
||||||
#pragma pack (1)
|
|
||||||
typedef struct {
|
|
||||||
VENDOR_DEVICE_PATH VendorHardware;
|
|
||||||
UART_DEVICE_PATH Uart;
|
|
||||||
VENDOR_DEVICE_PATH TerminalType;
|
|
||||||
EFI_DEVICE_PATH_PROTOCOL End;
|
|
||||||
} VENDOR_UART_DEVICE_PATH;
|
|
||||||
#pragma pack ()
|
|
||||||
|
|
||||||
//
|
|
||||||
// USB Keyboard Device Path structure
|
|
||||||
//
|
|
||||||
#pragma pack (1)
|
|
||||||
typedef struct {
|
|
||||||
USB_CLASS_DEVICE_PATH Keyboard;
|
|
||||||
EFI_DEVICE_PATH_PROTOCOL End;
|
|
||||||
} USB_KEYBOARD_DEVICE_PATH;
|
|
||||||
#pragma pack ()
|
|
||||||
|
|
||||||
//
|
|
||||||
// QemuRamfb Device Path structure
|
|
||||||
//
|
|
||||||
#pragma pack (1)
|
|
||||||
typedef struct {
|
|
||||||
VENDOR_DEVICE_PATH Vendor;
|
|
||||||
ACPI_ADR_DEVICE_PATH AcpiAdr;
|
|
||||||
EFI_DEVICE_PATH_PROTOCOL End;
|
|
||||||
} VENDOR_RAMFB_DEVICE_PATH;
|
|
||||||
#pragma pack ()
|
|
||||||
|
|
||||||
ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard;
|
|
||||||
ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort;
|
|
||||||
UART_DEVICE_PATH gUartDeviceNode = gUart;
|
|
||||||
VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Platform specific keyboard device path
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// Debug Agent UART Device Path
|
|
||||||
//
|
|
||||||
VENDOR_UART_DEVICE_PATH gDebugAgentUartDevicePath = {
|
|
||||||
{
|
|
||||||
{
|
|
||||||
HARDWARE_DEVICE_PATH,
|
|
||||||
HW_VENDOR_DP,
|
|
||||||
{
|
|
||||||
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
|
|
||||||
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
EFI_DEBUG_AGENT_GUID,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
MESSAGING_DEVICE_PATH,
|
|
||||||
MSG_UART_DP,
|
|
||||||
{
|
|
||||||
(UINT8)(sizeof (UART_DEVICE_PATH)),
|
|
||||||
(UINT8)((sizeof (UART_DEVICE_PATH)) >> 8)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
0, // Reserved
|
|
||||||
0, // BaudRate - Default
|
|
||||||
0, // DataBits - Default
|
|
||||||
0, // Parity - Default
|
|
||||||
0, // StopBits - Default
|
|
||||||
},
|
|
||||||
gPcAnsiTerminal,
|
|
||||||
gEndEntire
|
|
||||||
};
|
|
||||||
|
|
||||||
STATIC USB_KEYBOARD_DEVICE_PATH gUsbKeyboardDevicePath = {
|
|
||||||
{
|
|
||||||
{
|
|
||||||
MESSAGING_DEVICE_PATH,
|
|
||||||
MSG_USB_CLASS_DP,
|
|
||||||
{
|
|
||||||
(UINT8)sizeof (USB_CLASS_DEVICE_PATH),
|
|
||||||
(UINT8)(sizeof (USB_CLASS_DEVICE_PATH) >> 8)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
0xFFFF, // VendorId: any
|
|
||||||
0xFFFF, // ProductId: any
|
|
||||||
3, // DeviceClass: HID
|
|
||||||
1, // DeviceSubClass: boot
|
|
||||||
1 // DeviceProtocol: keyboard
|
|
||||||
},
|
|
||||||
gEndEntire
|
|
||||||
};
|
|
||||||
|
|
||||||
STATIC VENDOR_RAMFB_DEVICE_PATH gQemuRamfbDevicePath = {
|
|
||||||
{
|
|
||||||
{
|
|
||||||
HARDWARE_DEVICE_PATH,
|
|
||||||
HW_VENDOR_DP,
|
|
||||||
{
|
|
||||||
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
|
|
||||||
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
QEMU_RAMFB_GUID,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
ACPI_DEVICE_PATH,
|
|
||||||
ACPI_ADR_DP,
|
|
||||||
{
|
|
||||||
(UINT8)(sizeof (ACPI_ADR_DEVICE_PATH)),
|
|
||||||
(UINT8)((sizeof (ACPI_ADR_DEVICE_PATH)) >> 8)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ACPI_DISPLAY_ADR (
|
|
||||||
1, // DeviceIdScheme
|
|
||||||
0, // HeadId
|
|
||||||
0, // NonVgaOutput
|
|
||||||
1, // BiosCanDetect
|
|
||||||
0, // VendorInfo
|
|
||||||
ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL, // Type
|
|
||||||
0, // Port
|
|
||||||
0 // Index
|
|
||||||
),
|
|
||||||
},
|
|
||||||
gEndEntire
|
|
||||||
};
|
|
||||||
|
|
||||||
STATIC VENDOR_UART_DEVICE_PATH gXenConsoleDevicePath = {
|
|
||||||
{
|
|
||||||
{
|
|
||||||
HARDWARE_DEVICE_PATH,
|
|
||||||
HW_VENDOR_DP,
|
|
||||||
{
|
|
||||||
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
|
|
||||||
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
EDKII_SERIAL_PORT_LIB_VENDOR_GUID
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
MESSAGING_DEVICE_PATH,
|
|
||||||
MSG_UART_DP,
|
|
||||||
{
|
|
||||||
(UINT8)(sizeof (UART_DEVICE_PATH)),
|
|
||||||
(UINT8)((sizeof (UART_DEVICE_PATH)) >> 8)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
0,
|
|
||||||
FixedPcdGet64 (PcdUartDefaultBaudRate),
|
|
||||||
FixedPcdGet8 (PcdUartDefaultDataBits),
|
|
||||||
FixedPcdGet8 (PcdUartDefaultParity),
|
|
||||||
FixedPcdGet8 (PcdUartDefaultStopBits),
|
|
||||||
},
|
|
||||||
gPcAnsiTerminal,
|
|
||||||
gEndEntire
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Predefined platform default console device path
|
|
||||||
//
|
|
||||||
PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
|
|
||||||
{
|
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *)&gDebugAgentUartDevicePath,
|
|
||||||
(CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *)&gUsbKeyboardDevicePath,
|
|
||||||
CONSOLE_IN
|
|
||||||
},
|
|
||||||
{
|
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *)&gQemuRamfbDevicePath,
|
|
||||||
CONSOLE_OUT
|
|
||||||
},
|
|
||||||
{
|
|
||||||
NULL,
|
|
||||||
0
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
PLATFORM_CONSOLE_CONNECT_ENTRY gXenPlatformConsole[] = {
|
|
||||||
{
|
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *)&gXenConsoleDevicePath,
|
|
||||||
(CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
NULL,
|
|
||||||
0
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Predefined platform connect sequence
|
|
||||||
//
|
|
||||||
EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[] = { NULL };
|
|
|
@ -1,55 +0,0 @@
|
||||||
/** @file
|
|
||||||
|
|
||||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include <Uefi.h>
|
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/QemuLoadImageLib.h>
|
|
||||||
#include <Library/ReportStatusCodeLib.h>
|
|
||||||
#include <Library/UefiLib.h>
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
TryRunningQemuKernel (
|
|
||||||
VOID
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_STATUS Status;
|
|
||||||
EFI_HANDLE KernelImageHandle;
|
|
||||||
|
|
||||||
Status = QemuLoadKernelImage (&KernelImageHandle);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Signal the EVT_SIGNAL_READY_TO_BOOT event
|
|
||||||
//
|
|
||||||
EfiSignalEventReadyToBoot ();
|
|
||||||
|
|
||||||
REPORT_STATUS_CODE (
|
|
||||||
EFI_PROGRESS_CODE,
|
|
||||||
(EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Start the image.
|
|
||||||
//
|
|
||||||
Status = QemuStartKernelImage (&KernelImageHandle);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
DEBUG ((
|
|
||||||
DEBUG_ERROR,
|
|
||||||
"%a: QemuStartKernelImage(): %r\n",
|
|
||||||
__func__,
|
|
||||||
Status
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
QemuUnloadKernelImage (KernelImageHandle);
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
Loading…
Reference in New Issue