Move xbox's i2c support to a separate file, and add support of xbox's LEDs switching...
[reactos.git] / reactos / boot / freeldr / freeldr / arch / i386 / _alloca.S
1 /* stuff needed for libgcc on win32. */
2
3 /*#ifdef L_chkstk*/
4 #ifdef WIN32
5
6 .global ___chkstk
7 .global __alloca
8 ___chkstk:
9 __alloca:
10 pushl %ecx /* save temp */
11 movl %esp,%ecx /* get sp */
12 addl $0x8,%ecx /* and point to return addr */
13
14 probe: cmpl $0x1000,%eax /* > 4k ?*/
15 jb done
16
17 subl $0x1000,%ecx /* yes, move pointer down 4k*/
18 orl $0x0,(%ecx) /* probe there */
19 subl $0x1000,%eax /* decrement count */
20 jmp probe /* and do it again */
21
22 done: subl %eax,%ecx
23 orl $0x0,(%ecx) /* less that 4k, just peek here */
24
25 movl %esp,%eax
26 movl %ecx,%esp /* decrement stack */
27
28 movl (%eax),%ecx /* recover saved temp */
29 movl 4(%eax),%eax /* get return address */
30 jmp *%eax
31
32
33 #endif