Skip to content

Commit

Permalink
SysCall: Refactored out CORE_STACK and RING3_STACK.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Krichanov committed Jan 13, 2025
1 parent 0f9e888 commit 08df5dd
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 355 deletions.
16 changes: 2 additions & 14 deletions MdeModulePkg/Core/Dxe/DxeMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,6 @@ typedef struct {
UINTN UserStackTop;
} LOADED_IMAGE_PRIVATE_DATA;

typedef struct {
UINTN Argument1;
UINTN Argument2;
UINTN Argument3;
} CORE_STACK;

typedef struct {
UINTN Rip;
UINTN Arguments[];
} RING3_STACK;

#define LOADED_IMAGE_PRIVATE_DATA_FROM_THIS(a) \
CR(a, LOADED_IMAGE_PRIVATE_DATA, Info, LOADED_IMAGE_PRIVATE_DATA_SIGNATURE)

Expand Down Expand Up @@ -2737,9 +2726,8 @@ CoreBootServices (
EFI_STATUS
EFIAPI
CallBootService (
IN UINT8 Type,
IN CORE_STACK *CoreRbp,
IN RING3_STACK *UserRsp
IN UINT8 Type,
IN UINTN *UserArguments
);

VOID
Expand Down
3 changes: 1 addition & 2 deletions MdeModulePkg/Core/Dxe/SysCall/AARCH64/InitializeAARCH64.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ SysCallBootService (

Status = CallBootService (
Type,
(CORE_STACK *)CoreRbp,
(RING3_STACK *)(UINTN)Physical
(UINTN *)((UINTN)Physical + sizeof (UINTN))
);

CoreFreePages (Physical, EFI_SIZE_TO_PAGES (9 * sizeof (UINTN)));
Expand Down
3 changes: 1 addition & 2 deletions MdeModulePkg/Core/Dxe/SysCall/ARM/InitializeARM.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ SysCallBootService (

Status = CallBootService (
Type,
(CORE_STACK *)CoreRbp,
(RING3_STACK *)(UINTN)Physical
(UINTN *)((UINTN)Physical + sizeof (UINTN))
);
//
// TODO: Fix memory leak for ReturnToCore().
Expand Down
Loading

0 comments on commit 08df5dd

Please sign in to comment.