2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * PURPOSE: Implementation of _chkstk and _alloca_probe
5 * PROGRAMMERS Richard Henderson <rth@redhat.com>
6 * Kai Tietz <kai.tietz@onevision.com>
7 * Timo Kreuzer (timo.kreuzer@reactos.org)
10 /* INCLUDES ******************************************************************/
13 #define PAGE_SIZE 4096
15 /* CODE **********************************************************************/
24 push rcx /* save temps */
30 cmp rax, PAGE_SIZE /* > 4k ?*/
31 lea rcx, [rsp + 24] /* point past return addr */
35 sub rcx, PAGE_SIZE /* yes, move pointer down 4k */
36 or byte ptr [rcx], 0 /* probe there */
37 sub rax, PAGE_SIZE /* decrement count */
40 ja l_MoreThanAPage /* and do it again */
44 or byte ptr [rcx], 0 /* less than 4k, just peek here */