blob: 01f90366f03027b1e5ee1dfd3c0aead926915017 [file] [log] [blame]
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "../assembly.h"
// __chkstk routine
// This routine is windows specific.
// This clobbers registers x16 and x17.
// Does not modify any memory or the stack pointer.
// mov x15, #256 // Number of bytes of stack, in units of 16 byte
// bl __chkstk
// sub sp, sp, x15, lsl #4
#ifdef __aarch64__
#define PAGE_SIZE 4096
.p2align 2
lsl x16, x15, #4
mov x17, sp
sub x17, x17, #PAGE_SIZE
subs x16, x16, #PAGE_SIZE
ldr xzr, [x17] 1b
#endif // __aarch64__