summaryrefslogtreecommitdiff
path: root/src/pal/src/arch/i386/activationhandlerwrapper.S
blob: 63f718e81f0960cad658e6eae372ba5e788f0797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

.intel_syntax noprefix
#include "unixasmmacros.inc"
#include "asmconstants.h"

#ifdef BIT64
// Offset of the return address from the ActivationHandler in the ActivationHandlerWrapper
.globl C_FUNC(ActivationHandlerReturnOffset)
C_FUNC(ActivationHandlerReturnOffset):
    .int LOCAL_LABEL(ActivationHandlerReturn)-C_FUNC(ActivationHandlerWrapper)

NESTED_ENTRY ActivationHandlerWrapper, _TEXT, NoHandler
    push_nonvol_reg rbp
    mov     rbp, rsp
    alloc_stack (CONTEXT_Size)
    set_cfa_register rbp, (2*8)
    mov     rdi, rsp
    int3
    call    C_FUNC(ActivationHandler)
LOCAL_LABEL(ActivationHandlerReturn):
    int3
    free_stack (CONTEXT_Size)
    pop_nonvol_reg rbp
    ret
NESTED_END ActivationHandlerWrapper, _TEXT

#endif // BIT64