summaryrefslogtreecommitdiff
path: root/src/pal/src/arch/i386/context.S
blob: f8a2dca89c1196f0e10e90b9a6ead628da775587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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.

#if defined(_DEBUG)
    .text
    .globl _DBG_CheckStackAlignment

_DBG_CheckStackAlignment:
  // Prolog - at this point we are at aligned - 8 (for the call)
  pushq %rbp                        // aligned -16
  movq %rsp, %rbp

  testl $0xf,%esp      // can get away with esp even on AMD64.
  jz .+3
  int3

  // Epilog
  popq %rbp
  ret
#endif