X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Nt32Pkg%2FSec%2FStackX64.asm;fp=Nt32Pkg%2FSec%2FStackX64.asm;h=0000000000000000000000000000000000000000;hp=565acfa8b66ed3ac1b74fd67c2d4dff4f5f03603;hb=7afa0cea8f2ccedc231f1208609148a38c958a64;hpb=4d5d7812786db947e476b4d850698b465d0e2d99 diff --git a/Nt32Pkg/Sec/StackX64.asm b/Nt32Pkg/Sec/StackX64.asm deleted file mode 100644 index 565acfa8b6..0000000000 --- a/Nt32Pkg/Sec/StackX64.asm +++ /dev/null @@ -1,104 +0,0 @@ -;------------------------------------------------------------------------------ -; -; Copyright (c) 2013, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Module Name: -; -; Stack.asm -; -; Abstract: -; -; Switch the stack from temporary memory to permenent memory. -; -;------------------------------------------------------------------------------ - - .code - -;------------------------------------------------------------------------------ -; VOID -; EFIAPI -; SecSwitchStack ( -; UINT32 TemporaryMemoryBase, -; UINT32 PermenentMemoryBase -; ); -;------------------------------------------------------------------------------ -SecSwitchStack PROC - mov [rsp + 08h], rcx - mov [rsp + 10h], rdx - - ; - ; Save three register: eax, ebx, ecx - ; - push rax - push rbx - push rcx - push rdx - - ; - ; !!CAUTION!! this function address's is pushed into stack after - ; migration of whole temporary memory, so need save it to permenent - ; memory at first! - ; - - mov rbx, [rsp + 28h] ; Save the first parameter - mov rcx, [rsp + 30h] ; Save the second parameter - - ; - ; Save this function's return address into permenent memory at first. - ; Then, Fixup the esp point to permenent memory - ; - mov rax, rsp - sub rax, rbx - add rax, rcx - mov rdx, qword ptr [rsp] ; copy pushed register's value to permenent memory - mov qword ptr [rax], rdx - mov rdx, qword ptr [rsp + 8] - mov qword ptr [rax + 8], rdx - mov rdx, qword ptr [rsp + 10h] - mov qword ptr [rax + 10h], rdx - mov rdx, qword ptr [rsp + 18h] - mov qword ptr [rax + 18h], rdx - mov rdx, qword ptr [rsp + 20h] ; Update this function's return address into permenent memory - mov qword ptr [rax + 20h], rdx - mov rsp, rax ; From now, esp is pointed to permenent memory - - ; - ; Fixup the ebp point to permenent memory - ; - mov rax, rbp - sub rax, rbx - add rax, rcx - mov rbp, rax ; From now, ebp is pointed to permenent memory - - pop rdx - pop rcx - pop rbx - pop rax - ret -SecSwitchStack ENDP - -;------------------------------------------------------------------------------ -; VOID -; EFIAPI -; PeiSwitchStacks ( -; IN SWITCH_STACK_ENTRY_POINT EntryPoint, -; IN VOID *Context1, OPTIONAL -; IN VOID *Context2, OPTIONAL -; IN VOID *Context3, OPTIONAL -; IN VOID *NewStack -; ) -;------------------------------------------------------------------------------ -PeiSwitchStacks PROC - mov rax, rcx - mov rcx, rdx - mov rdx, r8 - mov r8, r9 - mov rsp, [rsp + 28h] - sub rsp, 20h - call rax - jmp $ - ret -PeiSwitchStacks ENDP - - END