summaryrefslogtreecommitdiff
path: root/OvmfPkg
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/AcpiPlatformDxe/Qemu.c58
-rw-r--r--OvmfPkg/AcpiTables/Dsdt.asl46
-rw-r--r--OvmfPkg/AcpiTables/Facp.aslc46
-rw-r--r--OvmfPkg/AcpiTables/Platform.h34
-rw-r--r--OvmfPkg/Include/IndustryStandard/LinuxBzimage.h6
-rw-r--r--OvmfPkg/Include/Library/LoadLinuxLib.h22
-rw-r--r--OvmfPkg/Include/Library/QemuFwCfgLib.h21
-rw-r--r--OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.S19
-rw-r--r--OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.asm21
-rw-r--r--OvmfPkg/Library/LoadLinuxLib/Linux.c52
-rw-r--r--OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h11
-rw-r--r--OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.S67
-rw-r--r--OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.asm69
-rw-r--r--OvmfPkg/Library/PlatformBdsLib/QemuKernel.c7
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S22
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm26
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c51
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S19
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm22
-rw-r--r--OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c8
-rw-r--r--OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf2
-rw-r--r--OvmfPkg/OvmfPkgIa32.fdf6
-rw-r--r--OvmfPkg/OvmfPkgIa32X64.fdf6
-rw-r--r--OvmfPkg/OvmfPkgX64.fdf6
-rw-r--r--OvmfPkg/README1
-rwxr-xr-xOvmfPkg/build.sh32
-rwxr-xr-xOvmfPkg/create-release.py1
27 files changed, 577 insertions, 104 deletions
diff --git a/OvmfPkg/AcpiPlatformDxe/Qemu.c b/OvmfPkg/AcpiPlatformDxe/Qemu.c
index 35d667fe..8a6ecf75 100644
--- a/OvmfPkg/AcpiPlatformDxe/Qemu.c
+++ b/OvmfPkg/AcpiPlatformDxe/Qemu.c
@@ -200,16 +200,20 @@ typedef struct {
} FIRMWARE_DATA;
typedef struct {
- UINT8 NameOp;
- UINT8 RootChar;
- UINT8 NameChar[4];
- UINT8 PackageOp;
- UINT8 PkgLength;
- UINT8 NumElements;
- UINT8 DWordPrefix;
- UINT8 Pm1aCntSlpTyp;
- UINT8 Pm1bCntSlpTyp;
- UINT8 Reserved[2];
+ UINT8 BytePrefix;
+ UINT8 ByteValue;
+} AML_BYTE;
+
+typedef struct {
+ UINT8 NameOp;
+ UINT8 RootChar;
+ UINT8 NameChar[4];
+ UINT8 PackageOp;
+ UINT8 PkgLength;
+ UINT8 NumElements;
+ AML_BYTE Pm1aCntSlpTyp;
+ AML_BYTE Pm1bCntSlpTyp;
+ AML_BYTE Reserved[2];
} SYSTEM_STATE_PACKAGE;
#pragma pack()
@@ -326,12 +330,14 @@ GetSuspendStates (
'\\', // RootChar
{ '_', 'S', 'x', '_' }, // NameChar[4]
0x12, // PackageOp
- 0x07, // PkgLength
- 0x01, // NumElements
- 0x0c, // DWordPrefix
- 0x00, // Pm1aCntSlpTyp
- 0x00, // Pm1bCntSlpTyp -- we don't support it
- { 0x00, 0x00 } // Reserved
+ 0x0A, // PkgLength
+ 0x04, // NumElements
+ { 0x0A, 0x00 }, // Pm1aCntSlpTyp
+ { 0x0A, 0x00 }, // Pm1bCntSlpTyp -- we don't support it
+ { // Reserved[2]
+ { 0x0A, 0x00 },
+ { 0x0A, 0x00 }
+ }
};
RETURN_STATUS Status;
FIRMWARE_CONFIG_ITEM FwCfgItem;
@@ -343,13 +349,13 @@ GetSuspendStates (
//
*SuspendToRamSize = sizeof Template;
CopyMem (SuspendToRam, &Template, sizeof Template);
- SuspendToRam->NameChar[2] = '3'; // S3
- SuspendToRam->Pm1aCntSlpTyp = 1; // PIIX4: STR
+ SuspendToRam->NameChar[2] = '3'; // S3
+ SuspendToRam->Pm1aCntSlpTyp.ByteValue = 1; // PIIX4: STR
*SuspendToDiskSize = sizeof Template;
CopyMem (SuspendToDisk, &Template, sizeof Template);
- SuspendToDisk->NameChar[2] = '4'; // S4
- SuspendToDisk->Pm1aCntSlpTyp = 2; // PIIX4: POSCL
+ SuspendToDisk->NameChar[2] = '4'; // S4
+ SuspendToDisk->Pm1aCntSlpTyp.ByteValue = 2; // PIIX4: POSCL
//
// check for overrides
@@ -368,16 +374,20 @@ GetSuspendStates (
// value to be written to the PM control register's SUS_TYP bits.
//
if (SystemStates[3] & BIT7) {
- SuspendToRam->Pm1aCntSlpTyp = SystemStates[3] & (BIT2 | BIT1 | BIT0);
- DEBUG ((DEBUG_INFO, "ACPI S3 value: %d\n", SuspendToRam->Pm1aCntSlpTyp));
+ SuspendToRam->Pm1aCntSlpTyp.ByteValue =
+ SystemStates[3] & (BIT2 | BIT1 | BIT0);
+ DEBUG ((DEBUG_INFO, "ACPI S3 value: %d\n",
+ SuspendToRam->Pm1aCntSlpTyp.ByteValue));
} else {
*SuspendToRamSize = 0;
DEBUG ((DEBUG_INFO, "ACPI S3 disabled\n"));
}
if (SystemStates[4] & BIT7) {
- SuspendToDisk->Pm1aCntSlpTyp = SystemStates[4] & (BIT2 | BIT1 | BIT0);
- DEBUG ((DEBUG_INFO, "ACPI S4 value: %d\n", SuspendToDisk->Pm1aCntSlpTyp));
+ SuspendToDisk->Pm1aCntSlpTyp.ByteValue =
+ SystemStates[4] & (BIT2 | BIT1 | BIT0);
+ DEBUG ((DEBUG_INFO, "ACPI S4 value: %d\n",
+ SuspendToDisk->Pm1aCntSlpTyp.ByteValue));
} else {
*SuspendToDiskSize = 0;
DEBUG ((DEBUG_INFO, "ACPI S4 disabled\n"));
diff --git a/OvmfPkg/AcpiTables/Dsdt.asl b/OvmfPkg/AcpiTables/Dsdt.asl
index 12a4f142..519a3125 100644
--- a/OvmfPkg/AcpiTables/Dsdt.asl
+++ b/OvmfPkg/AcpiTables/Dsdt.asl
@@ -203,10 +203,28 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 4) {
Package () {0x0000FFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00},
Package () {0x0000FFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00},
- Package () {0x0001FFFF, 0x00, 0x00, 0x09},
//
- // list of IRQs occupied thus far: 9
+ // Bus 0, Device 1, Pin 0 (INTA) is special; it corresponds to the
+ // internally generated SCI (System Control Interrupt), which is
+ // always routed to GSI 9. By setting the third (= Source) field to
+ // zero, we could use the fourth (= Source Index) field to hardwire
+ // the pin to GSI 9 directly.
+ //
+ // That way however, in accordance with the ACPI spec's description
+ // of SCI, the interrupt would be treated as "active low,
+ // shareable, level", and that doesn't match qemu.
//
+ // In QemuInstallAcpiMadtTable() [OvmfPkg/AcpiPlatformDxe/Qemu.c]
+ // we install an Interrupt Override Structure for the identity
+ // mapped IRQ#9 / GSI 9 (the corresponding bit being set in
+ // Pcd8259LegacyModeEdgeLevel), which describes the correct
+ // polarity (active high). As a consequence, some OS'en (eg. Linux)
+ // override the default (active low) polarity originating from the
+ // _PRT; others (eg. FreeBSD) don't. Therefore we need a separate
+ // link device just to specify a polarity that matches the MADT.
+ //
+ Package () {0x0001FFFF, 0x00, \_SB.PCI0.LPC.LNKS, 0x00},
+
Package () {0x0001FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00},
Package () {0x0001FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00},
Package () {0x0001FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00},
@@ -292,6 +310,30 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 4) {
Name (_ADR, 0x00010000)
//
+ // The SCI cannot be rerouted or disabled with PIRQRC[A:D]; we only
+ // need this link device in order to specify the polarity.
+ //
+ Device (LNKS) {
+ Name (_HID, EISAID("PNP0C0F"))
+ Name (_UID, 0)
+
+ Name (_STA, 0xB) // 0x1: device present
+ // 0x2: enabled and decoding resources
+ // 0x8: functioning properly
+
+ Method (_SRS, 1, NotSerialized) { /* no-op */ }
+ Method (_DIS, 0, NotSerialized) { /* no-op */ }
+
+ Name (_PRS, ResourceTemplate () {
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 9 }
+ //
+ // list of IRQs occupied thus far: 9
+ //
+ })
+ Method (_CRS, 0, NotSerialized) { Return (_PRS) }
+ }
+
+ //
// PCI Interrupt Routing Configuration Registers, PIRQRC[A:D]
//
OperationRegion (PRR0, PCI_Config, 0x60, 0x04)
diff --git a/OvmfPkg/AcpiTables/Facp.aslc b/OvmfPkg/AcpiTables/Facp.aslc
index b48af760..df35285c 100644
--- a/OvmfPkg/AcpiTables/Facp.aslc
+++ b/OvmfPkg/AcpiTables/Facp.aslc
@@ -1,6 +1,7 @@
/** @file
FACP Table
+ Copyright (c) 2013, Red Hat, Inc.
Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are
licensed and made available under the terms and conditions of the BSD License
@@ -14,11 +15,11 @@
#include "Platform.h"
-EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
+EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
{
- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE),
- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
+ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
+ sizeof (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE),
+ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
0, // to make sum of entire table == 0
{EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field
EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
@@ -28,8 +29,8 @@ EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
},
0, // Physical addesss of FACS
0, // Physical address of DSDT
- INT_MODEL, // System Interrupt Model
- RESERVED, // reserved
+ RESERVED, // System Interrupt Model in ACPI 1.0, eliminated in 2.0
+ EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED, // Preferred PM profile
SCI_INT_VECTOR, // System vector of SCI interrupt
SMI_CMD_IO_PORT, // Port address of SMI command port
ACPI_ENABLE, // value to write to port smi_cmd to enable ACPI
@@ -37,20 +38,20 @@ EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
S4BIOS_REQ, // Value to write to SMI CMD port to enter the S4BIOS state
0, // PState control
PM1a_EVT_BLK, // Port address of Power Mgt 1a Event Reg Blk
- PM1b_EVT_BLK, // Port address of Power Mgt 1b Event Reg Blk
+ 0, // Power Mgt 1b Event Reg Blk unsupported
PM1a_CNT_BLK, // Port address of Power Mgt 1a Ctrl Reg Blk
- PM1b_CNT_BLK, // Port address of Power Mgt 1b Ctrl Reg Blk
- PM2_CNT_BLK, // Port address of Power Mgt 2 Ctrl Reg Blk
+ 0, // Power Mgt 1b Ctrl Reg Blk unsupported
+ 0, // Power Mgt 2 Ctrl Reg Blk unsupported
PM_TMR_BLK, // Port address of Power Mgt Timer Ctrl Reg Blk
GPE0_BLK, // Port addr of General Purpose Event 0 Reg Blk
- GPE1_BLK, // Port addr of General Purpose Event 1 Reg Blk
+ 0, // General Purpose Event 1 Reg Blk unsupported
PM1_EVT_LEN, // Byte Length of ports at pm1X_evt_blk
PM1_CNT_LEN, // Byte Length of ports at pm1X_cnt_blk
- PM2_CNT_LEN, // Byte Length of ports at pm2_cnt_blk
+ 0, // Power Mgt 2 Ctrl Reg Blk unsupported
PM_TM_LEN, // Byte Length of ports at pm_tm_blk
GPE0_BLK_LEN, // Byte Length of ports at gpe0_blk
- GPE1_BLK_LEN, // Byte Length of ports at gpe1_blk
- GPE1_BASE, // offset in gpe model where gpe1 events start
+ 0, // General Purpose Event 1 Reg Blk unsupported
+ 0, // General Purpose Event 1 Reg Blk unsupported
0, // _CST support
P_LVL2_LAT, // worst case HW latency to enter/exit C2 state
P_LVL3_LAT, // worst case HW latency to enter/exit C3 state
@@ -61,10 +62,23 @@ EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
DAY_ALRM, // index to day-of-month alarm in RTC CMOS RAM
MON_ALRM, // index to month-of-year alarm in RTC CMOS RAM
CENTURY, // index to century in RTC CMOS RAM
- 0x00, // Boot architecture flag
- 0x00, // Boot architecture flag
+ 0x0000, // Boot architecture flag (16-bit)
RESERVED, // reserved
- FLAG
+ FLAG, // Fixed feature flags
+ GAS2_IO(RESET_REG, 1), // Extended address of the Reset Register
+ RESET_VALUE, // Value for the Reset Register to reset the system
+ { RESERVED }, // reserved[3]
+ 0, // 64-bit physical addesss of FACS, set at installation
+ 0, // 64-bit physical addesss of DSDT, set at installation
+
+ GAS2_IO(PM1a_EVT_BLK, PM1_EVT_LEN), // Ext. addr. of PM 1a Event Reg Blk
+ { 0 }, // PM 1b Event Reg Blk unsupported
+ GAS2_IO(PM1a_CNT_BLK, PM1_CNT_LEN), // Ext. addr. of PM 1a Ctrl Reg Blk
+ { 0 }, // PM 1b Ctrl Reg Blk unsupported
+ { 0 }, // PM 2 Ctrl Reg Blk unsupported
+ GAS2_IO(PM_TMR_BLK, PM_TM_LEN), // Ext. addr. of PM Timer Ctrl Reg Blk
+ GAS2_IO(GPE0_BLK, GPE0_BLK_LEN), // Ext. addr. of GPE 0 Reg Blk
+ { 0 } // GPE 1 Reg Blk unsupported
};
diff --git a/OvmfPkg/AcpiTables/Platform.h b/OvmfPkg/AcpiTables/Platform.h
index e8fae3c8..d96b8472 100644
--- a/OvmfPkg/AcpiTables/Platform.h
+++ b/OvmfPkg/AcpiTables/Platform.h
@@ -1,6 +1,7 @@
/** @file
Platform specific defines for constructing ACPI tables
+ Copyright (c) 2012, 2013, Red Hat, Inc.
Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are
licensed and made available under the terms and conditions of the BSD License
@@ -23,31 +24,23 @@
//
#define EFI_ACPI_OEM_ID 'O','V','M','F',' ',' ' // OEMID 6 bytes long
#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('O','V','M','F','E','D','K','2') // OEM table id 8 bytes long
-#define EFI_ACPI_OEM_REVISION 0x20120804
+#define EFI_ACPI_OEM_REVISION 0x20130221
#define EFI_ACPI_CREATOR_ID SIGNATURE_32('O','V','M','F')
-#define EFI_ACPI_CREATOR_REVISION 0x00000098
+#define EFI_ACPI_CREATOR_REVISION 0x00000099
-#define INT_MODEL 0x01
#define SCI_INT_VECTOR 0x0009
#define SMI_CMD_IO_PORT 0xB2
#define ACPI_ENABLE 0xF1
#define ACPI_DISABLE 0xF0
#define S4BIOS_REQ 0x00
#define PM1a_EVT_BLK 0x0000b000
-#define PM1b_EVT_BLK 0x00000000
#define PM1a_CNT_BLK 0x0000b004
-#define PM1b_CNT_BLK 0x00000000
-#define PM2_CNT_BLK 0x00000000
#define PM_TMR_BLK 0x0000b008
#define GPE0_BLK 0x0000afe0
-#define GPE1_BLK 0x00000000
#define PM1_EVT_LEN 0x04
#define PM1_CNT_LEN 0x02
-#define PM2_CNT_LEN 0x00
#define PM_TM_LEN 0x04
#define GPE0_BLK_LEN 0x04
-#define GPE1_BLK_LEN 0x00
-#define GPE1_BASE 0x00
#define RESERVED 0x00
#define P_LVL2_LAT 0x0065
#define P_LVL3_LAT 0x03E9
@@ -58,7 +51,24 @@
#define DAY_ALRM 0x00
#define MON_ALRM 0x00
#define CENTURY 0x00
-#define FLAG EFI_ACPI_1_0_WBINVD | EFI_ACPI_1_0_PROC_C1 | EFI_ACPI_1_0_SLP_BUTTON | EFI_ACPI_1_0_RTC_S4
+#define FLAG (EFI_ACPI_2_0_WBINVD | \
+ EFI_ACPI_2_0_PROC_C1 | \
+ EFI_ACPI_2_0_SLP_BUTTON | \
+ EFI_ACPI_2_0_RTC_S4 | \
+ EFI_ACPI_2_0_RESET_REG_SUP)
+#define RESET_REG 0xCF9
+#define RESET_VALUE (BIT2 | BIT1) // PIIX3 Reset CPU + System Reset
-#endif
+//
+// Byte-aligned IO port register block initializer for
+// EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE
+//
+#define GAS2_IO(Base, Size) { \
+ EFI_ACPI_2_0_SYSTEM_IO, /* AddressSpaceId */ \
+ (Size) * 8, /* RegisterBitWidth */ \
+ 0, /* RegisterBitOffset */ \
+ 0, /* Reserved */ \
+ (Base) /* Address */ \
+ }
+#endif
diff --git a/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h b/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h
index d16b112f..b83b7916 100644
--- a/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h
+++ b/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -15,7 +15,6 @@
#define __LINUX_BZIMAGE_H__
#define BOOTSIG 0x1FE
-#define SETUP_VERSION 0x206
#define SETUP_HDR 0x53726448 /* 0x53726448 == "HdrS" */
#define E820_RAM 1
@@ -55,7 +54,8 @@ struct setup_header {
UINT32 ramdisk_max; /* Highest legal initrd address */
UINT32 kernel_alignment; /* Physical addr alignment required for kernel */
UINT8 relocatable_kernel; /* Whether kernel is relocatable or not */
- UINT8 _pad2[3];
+ UINT8 min_alignment;
+ UINT16 xloadflags;
UINT32 cmdline_size;
UINT32 hardware_subarch;
UINT64 hardware_subarch_data;
diff --git a/OvmfPkg/Include/Library/LoadLinuxLib.h b/OvmfPkg/Include/Library/LoadLinuxLib.h
index d1064d23..36ee352e 100644
--- a/OvmfPkg/Include/Library/LoadLinuxLib.h
+++ b/OvmfPkg/Include/Library/LoadLinuxLib.h
@@ -1,7 +1,7 @@
/** @file
Load/boot UEFI Linux.
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -95,6 +95,26 @@ LoadLinuxAllocateKernelSetupPages (
/**
+ Clears the uninitialised space before and after the struct setup_header
+ in the kernel setup image. The kernel requires that these be zeroed
+ unless explicitly initialised, so this function should be called after
+ the setup_header has been copied in from a bzImage, before setting up
+ anything else.
+
+ @param[in] KernelSetup - The kernel setup image
+
+ @retval EFI_SUCCESS - The Linux kernel setup was successfully initialized
+ @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
+ @retval EFI_UNSUPPORTED - The Linux kernel is not supported
+
+**/
+EFI_STATUS
+EFIAPI
+LoadLinuxInitializeKernelSetup (
+ IN VOID *KernelSetup
+ );
+
+/**
Allocates pages for the kernel.
@param[in] KernelSetup - The kernel setup image
diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h
index 3776d79e..9d023777 100644
--- a/OvmfPkg/Include/Library/QemuFwCfgLib.h
+++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h
@@ -1,7 +1,7 @@
/** @file
QEMU/KVM Firmware Configuration access
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -103,6 +103,25 @@ QemuFwCfgReadBytes (
/**
+ Writes firmware configuration bytes from a buffer
+
+ If called multiple times, then the data written will
+ continue at the offset of the firmware configuration
+ item where the previous write ended.
+
+ @param[in] Size - Size in bytes to write
+ @param[in] Buffer - Buffer to read data from
+
+**/
+VOID
+EFIAPI
+QemuFwCfgWriteBytes (
+ IN UINTN Size,
+ IN VOID *Buffer
+ );
+
+
+/**
Reads a UINT8 firmware configuration value
@return Value of Firmware Configuration item read
diff --git a/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.S b/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.S
index b8cd4ca5..f7440f74 100644
--- a/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.S
+++ b/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -13,6 +13,7 @@
#------------------------------------------------------------------------------
ASM_GLOBAL ASM_PFX(JumpToKernel)
+ASM_GLOBAL ASM_PFX(JumpToUefiKernel)
#------------------------------------------------------------------------------
# VOID
@@ -27,3 +28,19 @@ ASM_PFX(JumpToKernel):
calll 0x4(%esp)
ret
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# JumpToUefiKernel (
+# EFI_HANDLE ImageHandle,
+# EFI_SYSTEM_TABLE *SystemTable,
+# VOID *KernelBootParams,
+# VOID *KernelStart
+# );
+#------------------------------------------------------------------------------
+ASM_PFX(JumpToUefiKernel):
+ movl 0xc(%esp), %eax
+ movl 0x264(%eax), %eax
+ addl 0x10(%esp), %eax
+ jmp %eax
+
diff --git a/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.asm b/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.asm
index a8f3965f..21d0c4e7 100644
--- a/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.asm
+++ b/OvmfPkg/Library/LoadLinuxLib/Ia32/JumpToKernel.asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
;
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
@@ -32,4 +32,23 @@ JumpToKernel PROC
JumpToKernel ENDP
+;------------------------------------------------------------------------------
+; VOID
+; EFIAPI
+; JumpToUefiKernel (
+; EFI_HANDLE ImageHandle,
+; EFI_SYSTEM_TABLE *SystemTable,
+; VOID *KernelBootParams,
+; VOID *KernelStart
+; );
+;------------------------------------------------------------------------------
+JumpToUefiKernel PROC
+
+ mov eax, [esp + 12]
+ mov eax, [eax + 264h]
+ add eax, [esp + 16]
+ jmp eax
+
+JumpToUefiKernel ENDP
+
END
diff --git a/OvmfPkg/Library/LoadLinuxLib/Linux.c b/OvmfPkg/Library/LoadLinuxLib/Linux.c
index 96c985bc..c714225e 100644
--- a/OvmfPkg/Library/LoadLinuxLib/Linux.c
+++ b/OvmfPkg/Library/LoadLinuxLib/Linux.c
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -60,7 +60,8 @@ LoadLinuxCheckKernelSetup (
if ((Bp->hdr.signature != 0xAA55) || // Check boot sector signature
(Bp->hdr.header != SETUP_HDR) ||
- (Bp->hdr.version < 0x205) // We only support relocatable kernels
+ (Bp->hdr.version < 0x205) || // We only support relocatable kernels
+ (!Bp->hdr.relocatable_kernel)
) {
return EFI_UNSUPPORTED;
} else {
@@ -118,6 +119,34 @@ LoadLinuxAllocateKernelSetupPages (
}
}
+EFI_STATUS
+EFIAPI
+LoadLinuxInitializeKernelSetup (
+ IN VOID *KernelSetup
+ )
+{
+ EFI_STATUS Status;
+ UINTN SetupEnd;
+ struct boot_params *Bp;
+
+ Status = BasicKernelSetupCheck (KernelSetup);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ Bp = (struct boot_params*) KernelSetup;
+
+ SetupEnd = 0x202 + (Bp->hdr.jump & 0xff);
+
+ //
+ // Clear all but the setup_header
+ //
+ ZeroMem (KernelSetup, 0x1f1);
+ ZeroMem (((UINT8 *)KernelSetup) + SetupEnd, 4096 - SetupEnd);
+ DEBUG ((EFI_D_INFO, "Cleared kernel setup 0-0x1f1, 0x%x-0x1000\n", SetupEnd));
+
+ return EFI_SUCCESS;
+}
VOID*
EFIAPI
@@ -575,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;
@@ -606,7 +632,7 @@ LoadLinux (
Bp = (struct boot_params *) KernelSetup;
- if (Bp->hdr.version < 0x205) {
+ if (Bp->hdr.version < 0x205 || !Bp->hdr.relocatable_kernel) {
//
// We only support relocatable kernels
//
@@ -615,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 ();
diff --git a/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h b/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h
index f8697972..045cbf9b 100644
--- a/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h
+++ b/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h
@@ -1,7 +1,7 @@
/** @file
Boot UEFI Linux.
- Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -37,6 +37,15 @@ JumpToKernel (
);
VOID
+EFIAPI
+JumpToUefiKernel (
+ EFI_HANDLE ImageHandle,
+ EFI_SYSTEM_TABLE *SystemTable,
+ VOID *KernelBootParams,
+ VOID *KernelStart
+ );
+
+VOID
InitLinuxDescriptorTables (
VOID
);
diff --git a/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.S b/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.S
index 9ae755b0..056e3c01 100644
--- a/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.S
+++ b/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -13,6 +13,7 @@
#------------------------------------------------------------------------------
ASM_GLOBAL ASM_PFX(JumpToKernel)
+ASM_GLOBAL ASM_PFX(JumpToUefiKernel)
#------------------------------------------------------------------------------
# VOID
@@ -23,8 +24,68 @@ ASM_GLOBAL ASM_PFX(JumpToKernel)
# );
#------------------------------------------------------------------------------
ASM_PFX(JumpToKernel):
+
+ // Set up for executing kernel. BP in %esi, entry point on the stack
+ // (64-bit when the 'ret' will use it as 32-bit, but we're little-endian)
+ movq %rdx, %rsi
+ pushq %rcx
+
+ // Jump into the compatibility mode CS
+ pushq $0x10
+ leaq 1f(%rip), %rax
+ pushq %rax
+ .byte 0x48, 0xcb // retfq
+
+1: // Now in compatibility mode
+.code32
+ movl $0x18, %eax
+ movl %eax, %ds
+ movl %eax, %es
+ movl %eax, %fs
+ movl %eax, %gs
+ movl %eax, %ss
+
+ // Disable paging
+ movl %cr0, %eax
+ btcl $31, %eax
+ movl %eax, %cr0
+
+ // Disable long mode in EFER
+ movl $0x0c0000080, %ecx
+ rdmsr
+ btcl $8, %eax
+ wrmsr
+
+ // Disable PAE
+ movl %cr4, %eax
+ btcl $5, %eax
+ movl %eax, %cr4
+
+ // Zero registers and 'return' to kernel
+ xorl %ebp, %ebp
+ xorl %edi, %edi
+ xorl %ebx, %ebx
+ ret
+.code64
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# JumpToUefiKernel (
+# EFI_HANDLE ImageHandle, // rcx
+# EFI_SYSTEM_TABLE *SystemTable, // rdx
+# VOID *KernelBootParams, // r8
+# VOID *KernelStart // r9
+# );
+#------------------------------------------------------------------------------
+ASM_PFX(JumpToUefiKernel):
+ movq %rcx, %rdi
movq %rdx, %rsi
- addq $0x200, %rcx
- callq %rcx
+ movq %r8, %rdx
+ xor %rax, %rax
+ movl 0x264(%r8), %eax
+ addq %rax, %r9
+ addq $0x200, %r9
+ callq %r9
ret
diff --git a/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.asm b/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.asm
index ed53321c..fc07eab6 100644
--- a/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.asm
+++ b/OvmfPkg/Library/LoadLinuxLib/X64/JumpToKernel.asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
;
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
@@ -24,11 +24,72 @@
;------------------------------------------------------------------------------
JumpToKernel PROC
+ ; Set up for executing kernel. BP in %esi, entry point on the stack
+ ; (64-bit when the 'ret' will use it as 32-bit, but we're little-endian)
+ mov rsi, rdx
+ push rcx
+
+ ; Jump into the compatibility mode CS
+ push 10h
+ lea rax, @F
+ push rax
+ DB 048h, 0cbh ; retfq
+
+@@:
+ ; Now in compatibility mode.
+
+ DB 0b8h, 018h, 000h, 000h, 000h ; movl $0x18, %eax
+ DB 08eh, 0d8h ; movl %eax, %ds
+ DB 08eh, 0c0h ; movl %eax, %es
+ DB 08eh, 0e0h ; movl %eax, %fs
+ DB 08eh, 0e8h ; movl %eax, %gs
+ DB 08eh, 0d0h ; movl %eax, %ss
+
+ ; Disable paging
+ DB 00fh, 020h, 0c0h ; movl %cr0, %eax
+ DB 00fh, 0bah, 0f8h, 01fh ; btcl $31, %eax
+ DB 00fh, 022h, 0c0h ; movl %eax, %cr0
+
+ ; Disable long mode in EFER
+ DB 0b9h, 080h, 000h, 000h, 0c0h ; movl $0x0c0000080, %ecx
+ DB 00fh, 032h ; rdmsr
+ DB 00fh, 0bah, 0f8h, 008h ; btcl $8, %eax
+ DB 00fh, 030h ; wrmsr
+
+ ; Disable PAE
+ DB 00fh, 020h, 0e0h ; movl %cr4, %eax
+ DB 00fh, 0bah, 0f8h, 005h ; btcl $5, %eax
+ DB 00fh, 022h, 0e0h ; movl %eax, %cr4
+
+ DB 031h, 0edh ; xor %ebp, %ebp
+ DB 031h, 0ffh ; xor %edi, %edi
+ DB 031h, 0dbh ; xor %ebx, %ebx
+ DB 0c3h ; ret
+
+JumpToKernel ENDP
+
+;------------------------------------------------------------------------------
+; VOID
+; EFIAPI
+; JumpToUefiKernel (
+; EFI_HANDLE ImageHandle, // rcx
+; EFI_SYSTEM_TABLE *SystemTable, // rdx
+; VOID *KernelBootParams // r8
+; VOID *KernelStart, // r9
+; );
+;------------------------------------------------------------------------------
+JumpToUefiKernel PROC
+
+ mov rdi, rcx
mov rsi, rdx
- add rcx, 200h
- call rcx
+ mov rdx, r8
+ xor rax, rax
+ mov eax, [r8 + 264h]
+ add r9, rax
+ add r9, 200h
+ call r9
ret
-JumpToKernel ENDP
+JumpToUefiKernel ENDP
END
diff --git a/OvmfPkg/Library/PlatformBdsLib/QemuKernel.c b/OvmfPkg/Library/PlatformBdsLib/QemuKernel.c
index fa8bcbc9..47ebed9f 100644
--- a/OvmfPkg/Library/PlatformBdsLib/QemuKernel.c
+++ b/OvmfPkg/Library/PlatformBdsLib/QemuKernel.c
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -78,6 +78,11 @@ TryRunningQemuKernel (
goto FreeAndReturn;
}
+ Status = LoadLinuxInitializeKernelSetup (SetupBuf);
+ if (EFI_ERROR (Status)) {
+ goto FreeAndReturn;
+ }
+
KernelInitialSize = LoadLinuxGetKernelSize (SetupBuf, KernelSize);
if (KernelInitialSize == 0) {
Status = EFI_UNSUPPORTED;
diff --git a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S
index a32b2c60..c2735d2c 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S
+++ b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -30,3 +30,23 @@ rep insb
popl %edi
ret
+
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# IoWriteFifo8 (
+# IN UINTN Port,
+# IN UINTN Size,
+# IN VOID *Buffer
+# );
+#------------------------------------------------------------------------------
+ASM_GLOBAL ASM_PFX(IoWriteFifo8)
+ASM_PFX(IoWriteFifo8):
+ movw 4(%esp), %dx
+ movl 8(%esp), %ecx
+ pushl %esi
+ movl 16(%esp), %esi
+rep outsb
+ popl %esi
+ ret
+
diff --git a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm
index e46af81e..f7d65c49 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm
+++ b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -29,12 +29,34 @@ IoReadFifo8 PROC
mov dx, [esp + 4]
mov ecx, [esp + 8]
push edi
- mov edx, [esp + 16]
+ mov edi, [esp + 16]
rep insb
pop edi
ret
IoReadFifo8 ENDP
+
+;------------------------------------------------------------------------------
+; VOID
+; EFIAPI
+; IoWriteFifo8 (
+; IN UINTN Port,
+; IN UINTN Size,
+; IN VOID *Buffer
+; );
+;------------------------------------------------------------------------------
+IoWriteFifo8 PROC
+
+ mov dx, [esp + 4]
+ mov ecx, [esp + 8]
+ push esi
+ mov esi, [esp + 16]
+rep outsb
+ pop esi
+ ret
+
+IoWriteFifo8 ENDP
+
END
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
index 8caab42e..7e5ea00b 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -50,6 +50,32 @@ IoReadFifo8 (
OUT VOID *Buffer
);
+/**
+ Writes an 8-bit I/O port fifo from a block of memory.
+
+ Writes the 8-bit I/O fifo port specified by Port.
+
+ The port is written Count times, and the data are obtained
+ from the provided Buffer.
+
+ This function must guarantee that all I/O read and write operations are
+ serialized.
+
+ If 8-bit I/O port operations are not supported, then ASSERT().
+
+ @param Port The I/O port to read.
+ @param Count The number of times to read I/O port.
+ @param Buffer The buffer to store the read data into.
+
+**/
+VOID
+EFIAPI
+IoWriteFifo8 (
+ IN UINTN Port,
+ IN UINTN Count,
+ OUT VOID *Buffer
+ );
+
/**
Returns a boolean indicating if the firmware configuration interface
@@ -132,6 +158,29 @@ QemuFwCfgReadBytes (
}
}
+/**
+ Write firmware configuration bytes from a buffer
+
+ If called multiple times, then the data written will
+ continue at the offset of the firmware configuration
+ item where the previous write ended.
+
+ @param[in] Size - Size in bytes to write
+ @param[in] Buffer - Buffer to read data from
+
+**/
+VOID
+EFIAPI
+QemuFwCfgWriteBytes (
+ IN UINTN Size,
+ IN VOID *Buffer
+ )
+{
+ if (mQemuFwCfgSupported) {
+ IoWriteFifo8 (0x511, Size, Buffer);
+ }
+}
+
/**
Reads a UINT8 firmware configuration value
diff --git a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S
index b1125ed7..69167b70 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S
+++ b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -28,3 +28,20 @@ rep insb
mov %r8, %rdi # restore rdi
ret
+#------------------------------------------------------------------------------
+# VOID
+# EFIAPI
+# IoWriteFifo8 (
+# IN UINTN Port, // rcx
+# IN UINTN Size, // rdx
+# IN VOID *Buffer // r8
+# );
+#------------------------------------------------------------------------------
+ASM_GLOBAL ASM_PFX(IoWriteFifo8)
+ASM_PFX(IoWriteFifo8):
+ xchg %rcx, %rdx
+ xchg %r8, %rsi # rdi: buffer address; r8: save rsi
+rep outsb
+ mov %r8, %rsi # restore rsi
+ ret
+
diff --git a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm
index c60ad2c5..47ac158f 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm
+++ b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -32,5 +32,25 @@ rep insb
IoReadFifo8 ENDP
+
+;------------------------------------------------------------------------------
+; VOID
+; EFIAPI
+; IoWriteFifo8 (
+; IN UINTN Port, // rcx
+; IN UINTN Size, // rdx
+; IN VOID *Buffer // r8
+; );
+;------------------------------------------------------------------------------
+IoWriteFifo8 PROC
+
+ xchg rcx, rdx
+ xchg rsi, r8 ; rdi: buffer address; r8: save rdi
+rep outsb
+ mov rsi, r8 ; restore rdi
+ ret
+
+IoWriteFifo8 ENDP
+
END
diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
index 52406add..d075fbef 100644
--- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -17,6 +17,7 @@
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
+#include <Library/TimerLib.h>
VOID
AcpiPmControl (
@@ -45,7 +46,11 @@ ResetCold (
VOID
)
{
- IoWrite8 (0x64, 0xfe);
+ IoWrite8 (0xCF9, BIT2 | BIT1); // 1st choice: PIIX3 RCR, RCPU|SRST
+ MicroSecondDelay (50);
+
+ IoWrite8 (0x64, 0xfe); // 2nd choice: keyboard controller
+ CpuDeadLoop ();
}
/**
@@ -62,6 +67,7 @@ ResetWarm (
)
{
IoWrite8 (0x64, 0xfe);
+ CpuDeadLoop ();
}
/**
diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
index 0694b4dd..c4d8ce54 100644
--- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
@@ -35,4 +35,4 @@
[LibraryClasses]
DebugLib
IoLib
-
+ TimerLib
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 36c97566..8861980b 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -46,12 +46,12 @@ FV = SECFV
[FD.MEMFD]
BaseAddress = 0x800000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase
-Size = 0x600000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
+Size = 0x800000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
ErasePolarity = 1
BlockSize = 0x10000
-NumBlocks = 0x60
+NumBlocks = 0x80
-0x0|0x600000
+0x0|0x800000
FV = MAINFV
################################################################################
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index a762dc9f..93a36b7c 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -46,12 +46,12 @@ FV = SECFV
[FD.MEMFD]
BaseAddress = 0x800000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase
-Size = 0x600000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
+Size = 0x800000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
ErasePolarity = 1
BlockSize = 0x10000
-NumBlocks = 0x60
+NumBlocks = 0x80
-0x0|0x600000
+0x0|0x800000
FV = MAINFV
################################################################################
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index fcdac031..d023cb19 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -46,12 +46,12 @@ FV = SECFV
[FD.MEMFD]
BaseAddress = 0x800000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase
-Size = 0x600000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
+Size = 0x800000|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
ErasePolarity = 1
BlockSize = 0x10000
-NumBlocks = 0x60
+NumBlocks = 0x80
-0x0|0x600000
+0x0|0x800000
FV = MAINFV
################################################################################
diff --git a/OvmfPkg/README b/OvmfPkg/README
index 8db4cac0..0c0a81a6 100644
--- a/OvmfPkg/README
+++ b/OvmfPkg/README
@@ -52,6 +52,7 @@ these binary outputs:
* OVMF.FD
- Please note! This filename has changed. Older releases used OVMF.Fv.
* OvmfVideo.rom
+ - This file is not built separately any longer, starting with svn r13520.
More information on building OVMF can be found at:
diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
index 61b3ff85..f64ea915 100755
--- a/OvmfPkg/build.sh
+++ b/OvmfPkg/build.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -58,15 +58,20 @@ case `uname` in
echo Cygwin not fully supported yet.
;;
Darwin*)
- Major=$(uname -r | cut -f 1 -d '.')
- if [[ $Major == 9 ]]
- then
+ Major=$(uname -r | cut -f 1 -d '.')
+ case $Major in
+ 10)
+ TARGET_TOOLS=XCODE32
+ ;;
+ 1[12])
+ TARGET_TOOLS=XCLANG
+ ;;
+ *)
echo OvmfPkg requires Snow Leopard or later OS
exit 1
- else
- TARGET_TOOLS=XCODE32
- fi
- ;;
+ ;;
+ esac
+ ;;
Linux*)
gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
case $gcc_version in
@@ -134,7 +139,16 @@ done
case $PROCESSOR in
IA32)
Processor=Ia32
- QEMU_COMMAND=qemu
+ if [ -x `which qemu-system-i386` ]; then
+ QEMU_COMMAND=qemu-system-i386
+ elif [ -x `which qemu-system-x86_64` ]; then
+ QEMU_COMMAND=qemu-system-x86_64
+ elif [ -x `which qemu` ]; then
+ QEMU_COMMAND=qemu
+ else
+ echo Unable to find QEMU for IA32 architecture!
+ exit 1
+ fi
;;
X64)
Processor=X64
diff --git a/OvmfPkg/create-release.py b/OvmfPkg/create-release.py
index 508c0919..6a6017a9 100755
--- a/OvmfPkg/create-release.py
+++ b/OvmfPkg/create-release.py
@@ -227,7 +227,6 @@ def create_zip(arch):
'FV'
)
zipf.write(os.path.join(FV_DIR, 'OVMF.fd'), 'OVMF.fd')
- zipf.write(os.path.join(FV_DIR, 'OvmfVideo.rom'), 'OvmfVideo.rom')
zipf.close()
print '[done]'