The IA32 register definition is quit different between edk and edk2 code base, so should not use EFI_IA32_REGISTER_SET to prepare thunk call based on edk2's BaseLib.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7786 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2009-03-03 14:43:49 +00:00
parent 2f78ec7a7a
commit d0c94e5954
3 changed files with 15 additions and 13 deletions

View File

@ -599,7 +599,7 @@ BiosVideoChildHandleUninstall (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_IA32_REGISTER_SET Regs; IA32_REGISTER_SET Regs;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort; EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort;
BIOS_VIDEO_DEV *BiosVideoPrivate; BIOS_VIDEO_DEV *BiosVideoPrivate;
@ -1031,7 +1031,7 @@ BiosVideoCheckForVbe (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_IA32_REGISTER_SET Regs; IA32_REGISTER_SET Regs;
UINT16 *ModeNumberPtr; UINT16 *ModeNumberPtr;
BOOLEAN ModeFound; BOOLEAN ModeFound;
BOOLEAN EdidFound; BOOLEAN EdidFound;
@ -1092,7 +1092,7 @@ BiosVideoCheckForVbe (
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_CONTROLLER_INFORMATION; Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_CONTROLLER_INFORMATION;
gBS->SetMem (BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0); gBS->SetMem (BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0);
BiosVideoPrivate->VbeInformationBlock->VESASignature = VESA_BIOS_EXTENSIONS_VBE2_SIGNATURE; BiosVideoPrivate->VbeInformationBlock->VESASignature = VESA_BIOS_EXTENSIONS_VBE2_SIGNATURE;
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeInformationBlock); Regs.E.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeInformationBlock); Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeInformationBlock);
LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs); LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs);
@ -1126,7 +1126,7 @@ BiosVideoCheckForVbe (
Regs.X.BX = 1; Regs.X.BX = 1;
Regs.X.CX = 0; Regs.X.CX = 0;
Regs.X.DX = 0; Regs.X.DX = 0;
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeEdidDataBlock); Regs.E.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeEdidDataBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeEdidDataBlock); Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeEdidDataBlock);
LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs); LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs);
@ -1206,7 +1206,7 @@ BiosVideoCheckForVbe (
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_MODE_INFORMATION; Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_MODE_INFORMATION;
Regs.X.CX = *ModeNumberPtr; Regs.X.CX = *ModeNumberPtr;
gBS->SetMem (BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0); gBS->SetMem (BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0);
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeModeInformationBlock); Regs.E.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeModeInformationBlock); Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs); LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs);
@ -1622,7 +1622,7 @@ BiosVideoGraphicsOutputSetMode (
{ {
EFI_STATUS Status; EFI_STATUS Status;
BIOS_VIDEO_DEV *BiosVideoPrivate; BIOS_VIDEO_DEV *BiosVideoPrivate;
EFI_IA32_REGISTER_SET Regs; IA32_REGISTER_SET Regs;
BIOS_VIDEO_MODE_DATA *ModeData; BIOS_VIDEO_MODE_DATA *ModeData;
BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (This); BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (This);
@ -1705,7 +1705,7 @@ BiosVideoGraphicsOutputSetMode (
Regs.X.AX = VESA_BIOS_EXTENSIONS_SET_MODE; Regs.X.AX = VESA_BIOS_EXTENSIONS_SET_MODE;
Regs.X.BX = (UINT16) (ModeData->VbeModeNumber | VESA_BIOS_EXTENSIONS_MODE_NUMBER_LINEAR_FRAME_BUFFER); Regs.X.BX = (UINT16) (ModeData->VbeModeNumber | VESA_BIOS_EXTENSIONS_MODE_NUMBER_LINEAR_FRAME_BUFFER);
gBS->SetMem (BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0); gBS->SetMem (BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0);
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock); Regs.E.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock); Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs); LegacyBiosInt86 (BiosVideoPrivate, 0x10, &Regs);
@ -2729,7 +2729,7 @@ BiosVideoVgaMiniPortSetMode (
) )
{ {
BIOS_VIDEO_DEV *BiosVideoPrivate; BIOS_VIDEO_DEV *BiosVideoPrivate;
EFI_IA32_REGISTER_SET Regs; IA32_REGISTER_SET Regs;
if (This == NULL) { if (This == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;

View File

@ -30,7 +30,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/EdidActive.h> #include <Protocol/EdidActive.h>
#include <Protocol/EdidDiscovered.h> #include <Protocol/EdidDiscovered.h>
#include <Protocol/DevicePath.h> #include <Protocol/DevicePath.h>
#include <Protocol/LegacyBios.h>
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
@ -133,6 +132,9 @@ typedef struct {
#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
#define EFI_SEGMENT(_Adr) (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)
#define EFI_OFFSET(_Adr) (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)
// //
// Global Variables // Global Variables
// //
@ -494,7 +496,7 @@ EFIAPI
LegacyBiosInt86 ( LegacyBiosInt86 (
IN BIOS_VIDEO_DEV *BiosDev, IN BIOS_VIDEO_DEV *BiosDev,
IN UINT8 BiosInt, IN UINT8 BiosInt,
IN EFI_IA32_REGISTER_SET *Regs IN IA32_REGISTER_SET *Regs
); );
#endif #endif

View File

@ -137,7 +137,7 @@ EFIAPI
LegacyBiosInt86 ( LegacyBiosInt86 (
IN BIOS_VIDEO_DEV *BiosDev, IN BIOS_VIDEO_DEV *BiosDev,
IN UINT8 BiosInt, IN UINT8 BiosInt,
IN EFI_IA32_REGISTER_SET *Regs IN IA32_REGISTER_SET *Regs
) )
{ {
UINTN Status; UINTN Status;
@ -216,9 +216,9 @@ LegacyBiosInt86 (
Regs->E.DS = ThunkRegSet.E.DS; Regs->E.DS = ThunkRegSet.E.DS;
Regs->E.ES = ThunkRegSet.E.ES; Regs->E.ES = ThunkRegSet.E.ES;
CopyMem (&(Regs->E.EFlags), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32)); CopyMem (&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
Ret = (BOOLEAN) (Regs->E.EFlags.CF == 1); Ret = (BOOLEAN) (Regs->E.EFLAGS.Bits.CF == 1);
return Ret; return Ret;
} }