mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 22:54:51 +02:00
Ring3: Fixed bug in IA32 SetPosition() and Open().
This commit is contained in:
parent
2f5a386490
commit
044a40c898
@ -143,6 +143,29 @@ EFI_STATUS
|
|||||||
IN UINTN Argument5
|
IN UINTN Argument5
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typedef
|
||||||
|
EFI_STATUS
|
||||||
|
(EFIAPI *FUNCTION_6)(
|
||||||
|
IN UINTN Argument1,
|
||||||
|
IN UINTN Argument2,
|
||||||
|
IN UINTN Argument3,
|
||||||
|
IN UINTN Argument4,
|
||||||
|
IN UINTN Argument5,
|
||||||
|
IN UINTN Argument6
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef
|
||||||
|
EFI_STATUS
|
||||||
|
(EFIAPI *FUNCTION_7)(
|
||||||
|
IN UINTN Argument1,
|
||||||
|
IN UINTN Argument2,
|
||||||
|
IN UINTN Argument3,
|
||||||
|
IN UINTN Argument4,
|
||||||
|
IN UINTN Argument5,
|
||||||
|
IN UINTN Argument6,
|
||||||
|
IN UINTN Argument7
|
||||||
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
Ring3Call (
|
Ring3Call (
|
||||||
@ -156,6 +179,8 @@ Ring3Call (
|
|||||||
FUNCTION_3 Function3;
|
FUNCTION_3 Function3;
|
||||||
FUNCTION_4 Function4;
|
FUNCTION_4 Function4;
|
||||||
FUNCTION_5 Function5;
|
FUNCTION_5 Function5;
|
||||||
|
FUNCTION_6 Function6;
|
||||||
|
FUNCTION_7 Function7;
|
||||||
|
|
||||||
switch (Data->NumberOfArguments) {
|
switch (Data->NumberOfArguments) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -182,6 +207,14 @@ Ring3Call (
|
|||||||
Function5 = (FUNCTION_5)Data->EntryPoint;
|
Function5 = (FUNCTION_5)Data->EntryPoint;
|
||||||
Status = Function5 (Data->Arguments[0], Data->Arguments[1], Data->Arguments[2], Data->Arguments[3], Data->Arguments[4]);
|
Status = Function5 (Data->Arguments[0], Data->Arguments[1], Data->Arguments[2], Data->Arguments[3], Data->Arguments[4]);
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
Function6 = (FUNCTION_6)Data->EntryPoint;
|
||||||
|
Status = Function6 (Data->Arguments[0], Data->Arguments[1], Data->Arguments[2], Data->Arguments[3], Data->Arguments[4], Data->Arguments[5]);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
Function7 = (FUNCTION_7)Data->EntryPoint;
|
||||||
|
Status = Function7 (Data->Arguments[0], Data->Arguments[1], Data->Arguments[2], Data->Arguments[3], Data->Arguments[4], Data->Arguments[5], Data->Arguments[6]);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Status = EFI_UNSUPPORTED;
|
Status = EFI_UNSUPPORTED;
|
||||||
break;
|
break;
|
||||||
|
@ -322,12 +322,27 @@ CoreFileSetPosition (
|
|||||||
|
|
||||||
File = (RING3_EFI_FILE_PROTOCOL *)This;
|
File = (RING3_EFI_FILE_PROTOCOL *)This;
|
||||||
|
|
||||||
|
#if defined (MDE_CPU_X64)
|
||||||
return GoToRing3 (
|
return GoToRing3 (
|
||||||
2,
|
2,
|
||||||
(VOID *)mRing3FileProtocol.SetPosition,
|
(VOID *)mRing3FileProtocol.SetPosition,
|
||||||
File->Ring3File,
|
File->Ring3File,
|
||||||
Position
|
Position
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (MDE_CPU_IA32)
|
||||||
|
//
|
||||||
|
// UINT64 Position is passed as 2 double words on stack.
|
||||||
|
//
|
||||||
|
return GoToRing3 (
|
||||||
|
3,
|
||||||
|
(VOID *)mRing3FileProtocol.SetPosition,
|
||||||
|
File->Ring3File,
|
||||||
|
Position
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
@ -582,6 +597,7 @@ CoreFileOpen (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (MDE_CPU_X64)
|
||||||
Status = GoToRing3 (
|
Status = GoToRing3 (
|
||||||
5,
|
5,
|
||||||
(VOID *)mRing3FileProtocol.Open,
|
(VOID *)mRing3FileProtocol.Open,
|
||||||
@ -591,6 +607,22 @@ CoreFileOpen (
|
|||||||
OpenMode,
|
OpenMode,
|
||||||
Attributes
|
Attributes
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (MDE_CPU_IA32)
|
||||||
|
//
|
||||||
|
// UINT64 OpenMode and Attributes are each passed as 2 double words on stack.
|
||||||
|
//
|
||||||
|
Status = GoToRing3 (
|
||||||
|
7,
|
||||||
|
(VOID *)mRing3FileProtocol.Open,
|
||||||
|
File->Ring3File,
|
||||||
|
Ring3NewHandle,
|
||||||
|
Ring3FileName,
|
||||||
|
OpenMode,
|
||||||
|
Attributes
|
||||||
|
);
|
||||||
|
#endif
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
*NewHandle = NULL;
|
*NewHandle = NULL;
|
||||||
CoreFreePages (Ring3Pages, PagesNumber);
|
CoreFreePages (Ring3Pages, PagesNumber);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user