From 0834d3c9ccecba5048bd0c7db315268c241671a9 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Tue, 16 Nov 1993 04:50:02 +0000 Subject: [PATCH] Teach psbtobin and bintopsb how to relocate the compiled code utilities vector correctly. --- v7/src/microcode/bintopsb.c | 15 ++++++++++++++- v7/src/microcode/psbtobin.c | 18 +++++++++++++++++- v8/src/microcode/bintopsb.c | 15 ++++++++++++++- v8/src/microcode/psbtobin.c | 18 +++++++++++++++++- 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/v7/src/microcode/bintopsb.c b/v7/src/microcode/bintopsb.c index f238b342a..543d73051 100644 --- a/v7/src/microcode/bintopsb.c +++ b/v7/src/microcode/bintopsb.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: bintopsb.c,v 9.62 1993/11/09 16:47:01 gjr Exp $ +$Id: bintopsb.c,v 9.63 1993/11/16 04:50:02 gjr Exp $ Copyright (c) 1987-1993 Massachusetts Institute of Technology @@ -2128,6 +2128,19 @@ DEFUN_VOID (do_it) Heap_Objects_Start = (Heap_Start + Heap_Count); Mem_Base[(Heap_Start - NROOTS) + 0] = dumped_utilities; + if (dumped_utilities != SHARP_F) + { + /* This knows the format of the utilities vector. */ + SCHEME_OBJECT * uv = (relocate (dumped_utilities)); + unsigned long len = (OBJECT_DATUM (uv[0])); + + uv[len - 1] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 1]) + / (sizeof (SCHEME_OBJECT)))); + uv[len - 0] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 0]) + / (sizeof (SCHEME_OBJECT)))); + } Mem_Base[(Heap_Start - NROOTS) + 1] = (OBJECT_NEW_TYPE (TC_CELL, Dumped_Object)); Scan = (Heap_Start - NROOTS); diff --git a/v7/src/microcode/psbtobin.c b/v7/src/microcode/psbtobin.c index 1f765cd8f..8aca694c0 100644 --- a/v7/src/microcode/psbtobin.c +++ b/v7/src/microcode/psbtobin.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: psbtobin.c,v 9.54 1993/11/11 22:19:06 cph Exp $ +$Id: psbtobin.c,v 9.55 1993/11/16 04:49:56 gjr Exp $ Copyright (c) 1987-1993 Massachusetts Institute of Technology @@ -1120,6 +1120,7 @@ DEFUN_VOID (Read_Header_and_Allocate) .bin (and .psb) files can contain multiple objects. */ + compiler_utilities = SHARP_F; READ_HEADER_NO_ERROR ("Portable Version", "%ld", Portable_Version, ok); if (! ok) return (-1); @@ -1388,6 +1389,21 @@ DEFUN_VOID (do_it) DEBUGGING (fprintf (stderr, "Primitive_Table_Size = %ld\n", (primitive_table_end - primitive_table))); + if (Dumped_Compiler_Utilities != 0) + { + /* This knows the format of the utilities vector. */ + SCHEME_OBJECT * uv = (Relocate (Dumped_Compiler_Utilities)); + unsigned long len = uv[0]; + + uv[len - 1] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 1]) + * (sizeof (SCHEME_OBJECT)))); + uv[len - 0] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 0]) + * (sizeof (SCHEME_OBJECT)))); + compiler_utilities = (MAKE_POINTER_OBJECT (TC_COMPILED_CODE_BLOCK, uv)); + } + /* Is there a Pure/Constant block? */ if ((Const_Objects == 0) && (Const_Count == 0) diff --git a/v8/src/microcode/bintopsb.c b/v8/src/microcode/bintopsb.c index f238b342a..543d73051 100644 --- a/v8/src/microcode/bintopsb.c +++ b/v8/src/microcode/bintopsb.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: bintopsb.c,v 9.62 1993/11/09 16:47:01 gjr Exp $ +$Id: bintopsb.c,v 9.63 1993/11/16 04:50:02 gjr Exp $ Copyright (c) 1987-1993 Massachusetts Institute of Technology @@ -2128,6 +2128,19 @@ DEFUN_VOID (do_it) Heap_Objects_Start = (Heap_Start + Heap_Count); Mem_Base[(Heap_Start - NROOTS) + 0] = dumped_utilities; + if (dumped_utilities != SHARP_F) + { + /* This knows the format of the utilities vector. */ + SCHEME_OBJECT * uv = (relocate (dumped_utilities)); + unsigned long len = (OBJECT_DATUM (uv[0])); + + uv[len - 1] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 1]) + / (sizeof (SCHEME_OBJECT)))); + uv[len - 0] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 0]) + / (sizeof (SCHEME_OBJECT)))); + } Mem_Base[(Heap_Start - NROOTS) + 1] = (OBJECT_NEW_TYPE (TC_CELL, Dumped_Object)); Scan = (Heap_Start - NROOTS); diff --git a/v8/src/microcode/psbtobin.c b/v8/src/microcode/psbtobin.c index 1f765cd8f..8aca694c0 100644 --- a/v8/src/microcode/psbtobin.c +++ b/v8/src/microcode/psbtobin.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: psbtobin.c,v 9.54 1993/11/11 22:19:06 cph Exp $ +$Id: psbtobin.c,v 9.55 1993/11/16 04:49:56 gjr Exp $ Copyright (c) 1987-1993 Massachusetts Institute of Technology @@ -1120,6 +1120,7 @@ DEFUN_VOID (Read_Header_and_Allocate) .bin (and .psb) files can contain multiple objects. */ + compiler_utilities = SHARP_F; READ_HEADER_NO_ERROR ("Portable Version", "%ld", Portable_Version, ok); if (! ok) return (-1); @@ -1388,6 +1389,21 @@ DEFUN_VOID (do_it) DEBUGGING (fprintf (stderr, "Primitive_Table_Size = %ld\n", (primitive_table_end - primitive_table))); + if (Dumped_Compiler_Utilities != 0) + { + /* This knows the format of the utilities vector. */ + SCHEME_OBJECT * uv = (Relocate (Dumped_Compiler_Utilities)); + unsigned long len = uv[0]; + + uv[len - 1] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 1]) + * (sizeof (SCHEME_OBJECT)))); + uv[len - 0] = ((SCHEME_OBJECT) + (((unsigned long) uv[len - 0]) + * (sizeof (SCHEME_OBJECT)))); + compiler_utilities = (MAKE_POINTER_OBJECT (TC_COMPILED_CODE_BLOCK, uv)); + } + /* Is there a Pure/Constant block? */ if ((Const_Objects == 0) && (Const_Count == 0) -- 2.25.1