Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/arm/chkstk.S
35291 views
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.1// See https://llvm.org/LICENSE.txt for license information.2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception34#include "../assembly.h"56// __chkstk routine7// This routine is windows specific.8// http://msdn.microsoft.com/en-us/library/ms648426.aspx910// This clobbers the register r12, and the condition codes, and uses r5 and r611// as temporaries by backing them up and restoring them afterwards.12// Does not modify any memory or the stack pointer.1314// movw r4, #256 // Number of bytes of stack, in units of 4 byte15// bl __chkstk16// sub.w sp, sp, r41718#define PAGE_SIZE 40961920.p2align 221DEFINE_COMPILERRT_FUNCTION(__chkstk)22lsl r4, r4, #223mov r12, sp24push {r5, r6}25mov r5, r4261:27sub r12, r12, #PAGE_SIZE28subs r5, r5, #PAGE_SIZE29ldr r6, [r12]30bgt 1b3132pop {r5, r6}33bx lr34END_COMPILERRT_FUNCTION(__chkstk)353637