]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.asm
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / X64 / SwitchStack.asm
1 ; Copyright (c) 2004, Intel Corporation
2 ; All rights reserved. This program and the accompanying materials
3 ; are licensed and made available under the terms and conditions of the BSD License
4 ; which accompanies this distribution. The full text of the license may be found at
5 ; http://opensource.org/licenses/bsd-license.php
6 ;
7 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
8 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
9 ;
10 ; Module Name:
11 ;
12 ; SwitchStack.Asm
13 ;
14 ; Abstract:
15 ;
16 ;------------------------------------------------------------------------------
17
18 .code
19
20 ;------------------------------------------------------------------------------
21 ; Routine Description:
22 ;
23 ; Routine for switching stacks with 1 parameter
24 ;
25 ; Arguments:
26 ;
27 ; (rcx) EntryPoint - Entry point with new stack.
28 ; (rdx) Context - Parameter for entry point.
29 ; (r8) Context2 - Parameter2 for entry point.
30 ; (r9) NewStack - Pointer to new stack.
31 ;
32 ; Returns:
33 ;
34 ; None
35 ;
36 ;------------------------------------------------------------------------------
37 InternalSwitchStack PROC
38 mov rax, rcx
39 mov rcx, rdx
40 mov rdx, r8
41 lea rsp, [r9 - 20h]
42 call rax
43 InternalSwitchStack ENDP
44
45 END