Skip to content
Snippets Groups Projects
Commit 7e6ff84a authored by dtc's avatar dtc
Browse files

Save and reset the NPX state when a primitive halt is signalled so the

monitor can use the NPX (for printing float objects), and restore the
state when returning. This may be unnecessary on Linux?
parent 07ce660f
No related branches found
No related tags found
No related merge requests found
/* x86-arch.c -*- Mode: C; comment-column: 40 -*- /* x86-arch.c -*- Mode: C; comment-column: 40 -*-
* *
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-arch.c,v 1.8 1997/11/30 12:04:37 dtc Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-arch.c,v 1.9 1998/02/19 15:19:11 dtc Exp $
* *
*/ */
...@@ -215,11 +215,16 @@ sigtrap_handler(HANDLER_ARGS) ...@@ -215,11 +215,16 @@ sigtrap_handler(HANDLER_ARGS)
break; break;
case trap_Halt: case trap_Halt:
fake_foreign_function_call(context); {
lose("%%primitive halt called; the party is over.\n"); int fpu_state[27];
undo_fake_foreign_function_call(context); fpu_save(fpu_state);
arch_skip_instruction(context); fake_foreign_function_call(context);
break; lose("%%primitive halt called; the party is over.\n");
undo_fake_foreign_function_call(context);
fpu_restore(fpu_state);
arch_skip_instruction(context);
break;
}
case trap_Error: case trap_Error:
case trap_Cerror: case trap_Cerror:
......
### x86-assem.S -*- Mode: Asm; -*- ### x86-assem.S -*- Mode: Asm; -*-
/** /**
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-assem.S,v 1.10 1998/01/19 09:01:59 dtc Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-assem.S,v 1.11 1998/02/19 15:19:10 dtc Exp $
* *
* Authors: Paul F. Werkowski <pw@snoopy.mv.com> * Authors: Paul F. Werkowski <pw@snoopy.mv.com>
* Douglas T. Crosher * Douglas T. Crosher
...@@ -232,6 +232,26 @@ Llra: ...@@ -232,6 +232,26 @@ Llra:
ret ret
.size GNAME(call_into_lisp), . - GNAME(call_into_lisp) .size GNAME(call_into_lisp), . - GNAME(call_into_lisp)
/* Support for saving and restoring the NPX state from C. */
.text
.global GNAME(fpu_save)
.type GNAME(fpu_save),@function
.align 2,0x90
GNAME(fpu_save):
movl 4(%esp),%eax
fnsave (%eax) # Save the NPX state - Resets NPX
ret
.size GNAME(fpu_save),.-GNAME(fpu_save)
.global _fpu_restore
.type _fpu_restore,@function
.align 2,0x90
GNAME(fpu_restore):
movl 4(%esp),%eax
frstor (%eax) # Restore the NPX state.
ret
.size GNAME(fpu_restore),.-GNAME(fpu_restore)
/* /*
* The undefined-function trampoline. * The undefined-function trampoline.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment