vm: fix a null dereference on out-of-memory
[minix.git] / lib / libc / arch / x86_64 / gen / flt_rounds.S
blob1b23501cde144f266e5bb03e90fb64de09c7aece
1 /*      $NetBSD: flt_rounds.S,v 1.2 2002/06/06 23:04:35 fvdl Exp $      */
3 /*
4  * Written by J.T. Conklin, Apr 4, 1995
5  * Public domain.
6  */
8 #include <machine/asm.h>
10         .text
11         _ALIGN_TEXT
12 _map:
13         .byte 1         /* round to nearest */
14         .byte 3         /* round to negative infinity */
15         .byte 2         /* round to positive infinity */
16         .byte 0         /* round to zero */
18 ENTRY(__flt_rounds)
19         fnstcw -4(%rsp)
20         movl -4(%rsp),%eax
21         shrl $10,%eax
22         andl $3,%eax
23 #ifdef PIC
24         leaq PIC_GOT(_map),%rcx
25         movb (%rcx,%rax,1),%al
26 #else
27         movb _map(,%rax,1),%al
28 #endif
29         ret