]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/gcc/config/i386/uwin.asm
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / gcc / config / i386 / uwin.asm
1 /* stuff needed for libgcc on win32.  */
2
3 #ifdef L_chkstk
4
5         .global __chkstk
6         .global __alloca
7 __chkstk:
8 __alloca:
9         pushl  %ecx             /* save temp */
10         movl   %esp,%ecx        /* get sp */
11         addl   $0x8,%ecx        /* and point to return addr */
12
13 probe:  cmpl   $0x1000,%eax     /* > 4k ?*/
14         jb    done              
15
16         subl   $0x1000,%ecx             /* yes, move pointer down 4k*/
17         orl    $0x0,(%ecx)              /* probe there */
18         subl   $0x1000,%eax             /* decrement count */
19         jmp    probe                    /* and do it again */
20
21 done:   subl   %eax,%ecx           
22         orl    $0x0,(%ecx)      /* less that 4k, just peek here */
23
24         movl   %esp,%eax
25         movl   %ecx,%esp        /* decrement stack */
26
27         movl   (%eax),%ecx      /* recover saved temp */
28         movl   4(%eax),%eax     /* get return address */
29         jmp    *%eax    
30
31
32 #endif