Browse Source

Removed old stackbottom code (non-working!)

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7495 8c9fc860-2736-0410-a75d-ab315db34111
felixf 7 years ago
parent
commit
963909505f
2 changed files with 5 additions and 13 deletions
  1. 2 0
      source/Win64.Machine.Mod
  2. 3 13
      source/Win64.Objects.Mod

+ 2 - 0
source/Win64.Machine.Mod

@@ -82,6 +82,7 @@ TYPE
 VAR
 
 	LastAddress: RECORD END;
+	stackBottom-: ADDRESS;
 
 	MMXSupport*: BOOLEAN;
 	SSESupport*: BOOLEAN;
@@ -630,6 +631,7 @@ END Init;
 
 	PROCEDURE {INITIAL, NOPAF} Start;
 	BEGIN
+		stackBottom := CurrentSP();
 		Init; (* cannot allocate variables in here *)
 	END Start;
 

+ 3 - 13
source/Win64.Objects.Mod

@@ -522,17 +522,6 @@ BEGIN (* {t # NIL & t.next = NIL & t.prev = NIL} *)
 	queue.tail := t
 END Put;
 
-(* starting address of user stack for current thread, called stack top in TIB.H *)
-PROCEDURE -StackBottom*( ): ADDRESS;
-CODE {SYSTEM.i386}
-	DB	064H
-	DB	08BH
-	DB	005H
-	DB	004H
-	DB	000H
-	DB	000H
-	DB	000H
-END StackBottom;
 
 PROCEDURE {WINAPI} ExcpFrmHandler( CONST exceptionPointers: Kernel32.ExceptionPointers): Kernel32.DWORD ;
 VAR m: Modules.Module;  eip, ebp, stack: ADDRESS;  pc, handler, fp, sp: ADDRESS;  handled: BOOLEAN;  t: Process;
@@ -583,7 +572,7 @@ BEGIN
 			
 			eip := exceptionPointers.exception.ExceptionAddress;  ebp := exceptionPointers.context.BP;
 			IF eip = 0 THEN SYSTEM.GET( exceptionPointers.context.SP, eip ) END;
-			stack := StackBottom();
+			stack := t.stackBottom;
 			LOOP
 				Trace.String( "at ebp= " );  Trace.Address(ebp);  Trace.String( "H : " );
 				m := Modules.ThisModuleByAdr( eip );
@@ -1236,7 +1225,8 @@ BEGIN
 	ASSERT(res # 0);
 	res := Kernel32.TlsSetValue(tlsIndex, SYSTEM.VAL(LONGINT, t));
 	ASSERT(res # 0);
-	t.stackBottom := StackBottom(); t.mode := Running;
+	t.stackBottom := Machine.stackBottom;
+	t.mode := Running;
 	Put( ready, t );
 	ASSERT(t.handle # 0);
 	Machine.Release(Machine.Objects);