Commit 29f1fd98 authored by rtoy's avatar rtoy
Browse files

Change how we put the FPU type into the core file. We can't use

compile-time options to do this.  The running core file has to tell
us.

lisp/save.c:
o Add extra arg to save function to indicate whether the core we're
  saving supports sse2 or not.  Non-zero means sse2.
o Put the correct indication into the core file.

lisp/save.h:
o Update declaration of save.

code/save.lisp:
o Update alien definition for save
o Pass in the extra parameter for the save routine to indicate if we
  support sse2 or not.
parent cc0e075f
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/save.lisp,v 1.57 2008/06/19 20:58:05 rtoy Exp $")
  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/save.lisp,v 1.58 2008/12/10 16:16:10 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
@@ -123,7 +123,8 @@

(alien:def-alien-routine "save" (alien:boolean)
  (file c-call:c-string)
  (initial-function (alien:unsigned #.vm:word-bits)))
  (initial-function (alien:unsigned #.vm:word-bits))
  (sse2-mode c-call:int))

#+:executable
(alien:def-alien-routine "save_executable" (alien:boolean)
@@ -292,9 +293,9 @@
	  #+:executable
	(if executable
	    (save-executable core-name initial-function)
	    (save core-name initial-function))
	    (save core-name initial-function #+sse2 1 #-sse2 0))
	#-:executable
	(save core-name initial-function))))
	(save core-name initial-function #+sse2 1 #-sse2 0))))
  nil)


+10 −9
Original line number Diff line number Diff line
/*

 $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/save.c,v 1.20 2008/11/12 15:04:24 rtoy Exp $
 $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/save.c,v 1.21 2008/12/10 16:16:11 rtoy Exp $

 This code was written as part of the CMU Common Lisp project at
 Carnegie Mellon University, and has been placed in the public domain.
@@ -101,7 +101,7 @@ dump_region(struct alloc_region *alloc_region)
#endif

boolean
save(char *filename, lispobj init_function)
save(char *filename, lispobj init_function, int sse2_mode)
{
    FILE *file;

@@ -148,18 +148,19 @@ save(char *filename, lispobj init_function)
    putw(CORE_MAGIC, file);

    putw(CORE_VERSION, file);
#ifdef i386
#if defined(i386) && defined(FEATURE_SSE2)
    putw(4, file);
#else
    putw(3, file);
#endif
    putw(version, file);
#ifdef i386
#ifdef FEATURE_SSE2

#if defined(i386) && defined(FEATURE_SSE2)
    if (sse2_mode) {
        putw(SSE2, file);
#else
    } else {
        putw(X87, file);
#endif    
    }
#endif
    
    putw(CORE_NDIRECTORY, file);
+2 −2
Original line number Diff line number Diff line
/*
 * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/save.h,v 1.3 2005/01/13 19:55:00 fgilham Exp $
 * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/save.h,v 1.4 2008/12/10 16:16:11 rtoy Rel $
 */

#ifndef _SAVE_H_
@@ -7,6 +7,6 @@

#include "core.h"

extern boolean save(char *filename, lispobj initfun);
extern boolean save(char *filename, lispobj initfun, int sse2_mode);

#endif /* _SAVE_H_ */