Fix comments in i386.m4 and x86-64.m4 about executable stack.
authorTaylor R Campbell <campbell@mumble.net>
Thu, 7 Oct 2010 05:59:36 +0000 (05:59 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Thu, 7 Oct 2010 05:59:36 +0000 (05:59 +0000)
src/microcode/cmpauxmd/i386.m4
src/microcode/cmpauxmd/x86-64.m4

index a69527e183f2c237898c7fa50b7ba731e4751a89..7f3165c03f610e948a91405d31aa9025a6362fb1 100644 (file)
@@ -1207,35 +1207,56 @@ asm_fixnum_rsh_overflow_negative:
        OP(mov,l)       TW(IMM_DETAGGED_FIXNUM_MINUS_ONE,REG(eax))
        ret
 \f
-define_c_label(i387_read_fp_control_word)
-IF387(`        OP(cmp,l)       TW(IMM(0),ABS(EVR(i387_presence)))
-       je              i387_read_fp_control_word_lose
-       enter           IMM(4),IMM(0)
+define_c_label(sse_read_mxcsr)
+IFSSE(`        enter           IMM(4),IMM(0)
+       stmxcsr         IND(REG(esp))
+       OP(mov,l)       TW(IND(REG(esp)),REG(eax))
+       leave')
+       ret
+
+define_c_label(sse_write_mxcsr)
+IFSSE(`        ldmxcsr         LOF(4,REG(esp))')
+       ret
+
+define_c_label(x87_clear_exceptions)
+IF387(`        fnclex')
+       ret
+
+define_c_label(x87_trap_exceptions)
+IF387(`        fwait')
+       ret
+
+define_c_label(x87_read_control_word)
+IF387(`        enter           IMM(4),IMM(0)
        fnstcw          IND(REG(esp))
        OP(mov,w)       TW(IND(REG(esp)),REG(ax))
-       leave
+       leave')
        ret
-')
 
-i387_read_fp_control_word_lose:
-       OP(xor,l)       TW(REG(eax),REG(eax))
+define_c_label(x87_write_control_word)
+IF387(`        fldcw           LOF(4,REG(esp))')
        ret
 
-define_c_label(i387_write_fp_control_word)
-IF387(`        OP(cmp,l)       TW(IMM(0),ABS(EVR(i387_presence)))
-       je              i387_write_fp_control_word_lose
-       fldcw           LOF(4,REG(esp))
+define_c_label(x87_read_status_word)
+IF387(`        enter           IMM(4),IMM(0)
+       fnstsw          IND(REG(esp))
+       OP(mov,w)       TW(IND(REG(esp)),REG(ax))
+       leave')
+       ret
+
+define_c_label(x87_read_environment)
+IF387(`        OP(mov,l)       TW(LOF(4,REG(esp)),REG(eax))
+       fnstenv         IND(REG(eax))')
        ret
-')
 
-i387_write_fp_control_word_lose:
+define_c_label(x87_write_environment)
+IF387(`        OP(mov,l)       TW(LOF(4,REG(esp)),REG(eax))
+       fldenv          IND(REG(eax))')
        ret
 \f
 IFDASM(`end')
 
-# Mark the stack nonexecutable.  If we ever put code (e.g.,
-# dynamic-extent closure entry points) on the stack, this would have
-# to change.
+# Mark the C stack nonexecutable.
 
 ifdef(`__linux__', `ifdef(`__ELF__', `.section .note.GNU-stack,"",%progbits')')
 
index ff2238c5711fa4e16fd6c78efb932e20e17496a1..b70f0c6d5dd5b7ed6bdc6701eb42cfcabcea526b 100644 (file)
@@ -982,9 +982,7 @@ define_c_label(x86_64_write_mxcsr)
 \f
 IFDASM(`end')
 
-# Mark the stack nonexecutable.  If we ever put code (e.g.,
-# dynamic-extent closure entry points) on the stack, this would have
-# to change.
+# Mark the C stack nonexecutable.
 
 ifdef(`__linux__', `ifdef(`__ELF__', `.section .note.GNU-stack,"",%progbits')')