[eros-cvs] cvs commit: eros/src/base/lib/domain/crt/i486 crtn.S

shap@eros.cs.jhu.edu shap@eros.cs.jhu.edu
Mon, 26 Nov 2001 00:57:35 -0500


shap        01/11/26 00:57:35

  Modified:    src/base/domain/constructor constructor.c metaconstructor.c
               src/base/domain/ipltool ipltool.c
               src/base/domain/pcc pcc.c proccre.c
               src/base/domain/spacebank spacebank.c
               src/base/lib/domain/crt libdom_setup_keeper.c
               src/base/lib/domain/crt/i486 crtn.S
  Log:
  Steps toward self-kept processes. The setup routine now exists; I just
  need to fill in the blanks for creating a self-keeper.

Revision  Changes    Path
1.44      +2 -0      eros/src/base/domain/constructor/constructor.c

Index: constructor.c
===================================================================
RCS file: /cvs/eros/src/base/domain/constructor/constructor.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- constructor.c	2001/11/15 04:15:38	1.43
+++ constructor.c	2001/11/26 05:57:34	1.44
@@ -55,6 +55,8 @@
 
 #include "constituents.h"
 
+uint32_t __rt_unkept = 1;
+
 #define KR_SCRATCH      KR_APP(0)
 #define KR_RETURNER     KR_APP(1)
 #define KR_OSTREAM      KR_APP(2)



1.32      +2 -0      eros/src/base/domain/constructor/metaconstructor.c

Index: metaconstructor.c
===================================================================
RCS file: /cvs/eros/src/base/domain/constructor/metaconstructor.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- metaconstructor.c	2001/10/07 15:45:54	1.31
+++ metaconstructor.c	2001/11/26 05:57:34	1.32
@@ -41,6 +41,8 @@
 #include <domain/Runtime.h>
 #include "constituents.h"
 
+uint32_t __rt_unkept = 1;
+
 #define DEBUG if (0)
 /* #define DEBUG if (1) */
 



1.8       +1 -0      eros/src/base/domain/ipltool/ipltool.c

Index: ipltool.c
===================================================================
RCS file: /cvs/eros/src/base/domain/ipltool/ipltool.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ipltool.c	2001/10/01 01:47:42	1.7
+++ ipltool.c	2001/11/26 05:57:34	1.8
@@ -44,6 +44,7 @@
  * do not get the space initialization behavior that normally goes
  * with small processes. */
 uint32_t __rt_small_process = 0;
+uint32_t __rt_unkept = 1;
 
 int
 main()



1.52      +2 -1      eros/src/base/domain/pcc/pcc.c

Index: pcc.c
===================================================================
RCS file: /cvs/eros/src/base/domain/pcc/pcc.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- pcc.c	2001/10/03 00:57:42	1.51
+++ pcc.c	2001/11/26 05:57:34	1.52
@@ -42,8 +42,9 @@
 #include <domain/PccKey.h>
 #include <domain/Runtime.h>
 #include <domain/domdbg.h>
-
 #include "constituents.h"
+
+uint32_t __rt_unkept = 1;
 
 #define DEBUG if (0)
 /* #define DEBUG if (1) */



1.54      +2 -0      eros/src/base/domain/pcc/proccre.c

Index: proccre.c
===================================================================
RCS file: /cvs/eros/src/base/domain/pcc/proccre.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- proccre.c	2001/11/26 05:50:21	1.53
+++ proccre.c	2001/11/26 05:57:34	1.54
@@ -61,6 +61,8 @@
 #include <domain/Runtime.h>
 #include "constituents.h"
 
+uint32_t __rt_unkept = 1;
+
 #define DEBUG if (0)
 /* #define DEBUG if (1) */
 



1.42      +2 -0      eros/src/base/domain/spacebank/spacebank.c

Index: spacebank.c
===================================================================
RCS file: /cvs/eros/src/base/domain/spacebank/spacebank.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- spacebank.c	2001/10/01 01:09:29	1.41
+++ spacebank.c	2001/11/26 05:57:34	1.42
@@ -70,6 +70,8 @@
 /**Handle the stack stuff**/
 const uint32_t __rt_stack_pointer = 0x100000;
 
+uint32_t __rt_unkept = 1;
+
 int
 main(void)
 {



1.3       +12 -12    eros/src/base/lib/domain/crt/libdom_setup_keeper.c

Index: libdom_setup_keeper.c
===================================================================
RCS file: /cvs/eros/src/base/lib/domain/crt/libdom_setup_keeper.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- libdom_setup_keeper.c	2001/09/27 02:00:31	1.2
+++ libdom_setup_keeper.c	2001/11/26 05:57:35	1.3
@@ -25,40 +25,40 @@
 #include <eros/PageKey.h>
 #include <eros/Key.h>
 #include <eros/Invoke.h>
+#include <domain/Runtime.h>
 #include <domain/ProtoSpace.h>
 #include <domain/SpaceBankKey.h>
 #include <domain/ProcessCreatorKey.h>
 #include <domain/ConstructorKey.h>
 
-#define KR_SCRATCH 11
-
 void __rt_setup_keeper() __attribute__((weak, alias("__rt_do_setup_keeper")));
 
+#define KR_KEEPER KR_APP(0)
+
 void
 __rt_do_setup_keeper()
 {
-#if 0
+  extern uint32_t __rt_unkept;
   uint32_t result;
   uint32_t keyType;
 
-  extern uint32_t __rt_self_kept;
+  if (__rt_unkept)
+    return;
 
-  process_copy(PSKR_SELF, ProcKeeper, KR_SCRATCH);
-  process_copy(PSKR_SELF, ProcSched,  PSKR_SCHED);
+  process_copy(KR_SELF, ProcKeeper, KR_KEEPER);
 
-  result = key_kt(KR_SCRATCH, &keyType, 0);
+  result = key_kt(KR_KEEPER, &keyType, 0);
 
   if (result == RC_Void)
     keyType = AKT_Void;
 
   if (keyType == AKT_ConstructorRequestor) {
-    result = constructor_request(KR_SCRATCH, PSKR_BANK, KR_SCHED,
-				 KR_VOID, KR_SCRATCH);
-    process_swap(PSKR_SELF, ProcKeeper, KR_SCRATCH, KR_VOID);
+    result = constructor_request(KR_KEEPER, KR_BANK, KR_SCHED,
+				 KR_VOID, KR_KEEPER);
+    process_swap(KR_SELF, ProcKeeper, KR_KEEPER, KR_VOID);
     return;
   }
 
-  if (keyType == AKT_Void && __rt_self_kept) {
+  if (keyType == AKT_Void) {
   }
-#endif
 }



1.15      +5 -5      eros/src/base/lib/domain/crt/i486/crtn.S

Index: crtn.S
===================================================================
RCS file: /cvs/eros/src/base/lib/domain/crt/i486/crtn.S,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- crtn.S	2001/09/22 22:31:39	1.14
+++ crtn.S	2001/11/26 05:57:35	1.15
@@ -75,12 +75,12 @@
 __rt_small_space:
 	.long	0	/* default: not a small space */
 	
-	.weak	__rt_self_kept
+	.weak	__rt_unkept
 	.align 4
-	.type	__rt_self_kept,@object
-	.size	__rt_self_kept,4
-__rt_self_kept:
-	.long	1	/* default: self-kept if no keeper present already */
+	.type	__rt_unkept,@object
+	.size	__rt_unkept,4
+__rt_unkept:
+	.long	0	/* default: should have a keeper */
 	
 #if 0
 	.weak	__rt_kept_heap