Ring3: Added SysCallReturnToCore.

This commit is contained in:
Mikhail Krichanov 2024-02-09 16:09:45 +03:00
parent e5f7eb7654
commit a72b753f60
3 changed files with 11 additions and 2 deletions

View File

@ -123,6 +123,10 @@ ASM_PFX(CoreBootServices):
mov fs, ax
mov gs, ax
; Special case for SysCallReturnToCore.
cmp r10, 0
je coreReturnAddress
; Save User Stack pointers and switch to Core SysCall Stack.
mov rax, [ASM_PFX(gCoreSysCallStackTop)]
sub rax, 8
@ -229,6 +233,8 @@ ASM_PFX(CallRing3):
o64 sysret
coreReturnAddress:
mov rsp, [ASM_PFX(CoreRsp)]
mov rbp, [ASM_PFX(CoreRbp)]
ret
SECTION .data

View File

@ -28,5 +28,7 @@ ASM_PFX(_ModuleEntryPoint):
mov rdx, r9
call r8
ret
mov r10, 0
syscall

View File

@ -2014,6 +2014,7 @@ typedef struct {
} EFI_BOOT_SERVICES;
typedef enum {
SysCallReturnToCore = 0,
SysCallLocateProtocol = 1,
SysCallOpenProtocol = 2,
SysCallInstallMultipleProtocolInterfaces = 3,