Ver código fonte

Removed obsolete WIN32 and WIN64 prefixes

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8259 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 anos atrás
pai
commit
e76d0a2fd1

+ 2 - 2
source/Compiler.Mod

@@ -576,8 +576,8 @@ BEGIN
 	(* platform definitions hard coded for the common cases -- maybe (parts of it) should be outsourced to a file ?*)
 	DoAddPlatform("Bios32","-b=AMD --bits=32 --mergeSections --objectFileExtension=.Gof --symbolFileExtension=.Sym --preciseGC --define=BIOS,NATIVE,I386");
 	DoAddPlatform("Bios64","-b=AMD --bits=64 --mergeSections --objectFileExtension=.Goff --symbolFileExtension=.Symm --preciseGC --define=BIOS,NATIVE,AMD64");
-	DoAddPlatform("Win32","-b=AMD --bits=32 --mergeSections --objectFileExtension=.GofW --symbolFileExtension=.SymW --preciseGC --trackLeave --cellsAreObjects --platformCC=WINAPI --define=WIN32,WIN,I386");
-	DoAddPlatform("Win64","-b=AMD --bits=64 --mergeSections --objectFileExtension=.GofWw --symbolFileExtension=.SymWw --preciseGC --trackLeave --cellsAreObjects --platformCC=WINAPI --define=WIN64,WIN,AMD64");
+	DoAddPlatform("Win32","-b=AMD --bits=32 --mergeSections --objectFileExtension=.GofW --symbolFileExtension=.SymW --preciseGC --trackLeave --cellsAreObjects --platformCC=WINAPI --define=WIN,I386");
+	DoAddPlatform("Win64","-b=AMD --bits=64 --mergeSections --objectFileExtension=.GofWw --symbolFileExtension=.SymWw --preciseGC --trackLeave --cellsAreObjects --platformCC=WINAPI --define=WIN,AMD64");
 	DoAddPlatform("ARM","-b=ARM --metaData=simple --objectFileExtension=.Goa --symbolFileExtension=.Sya --define=ARM");
 	DoAddPlatform("Minos","-b=ARM --objectFile=Minos --define=ARM"); 
 	DoAddPlatform("TRM","-b=TRM --objectFile=Generic --metaData=simple --objectFileExtension=.GofT --symbolFileExtension=.SymT --define=ARM");

+ 5 - 6
source/Release.Tool

@@ -112,7 +112,6 @@
 #
 #	NATIVE: BIOS / RPI / ZYNQ
 #	UNIX: LINUX / DARWIN / SOLARIS
-#	WIN: WIN32 / WIN64
 #
 # The architecture specifies the target of modules that contain inline assembly code and may be one of the following:
 #
@@ -162,7 +161,7 @@ BUILDS
 		DISABLED "FALSE"
 	}
 	Win32 {
-		INCLUDE "WIN32 WIN I386"
+		INCLUDE "WIN I386"
 		COMPILER "Compiler.Compile"
 		COMPILEOPTIONS "-p=Win32"
 		EXCLUDEPACKAGES ""
@@ -176,7 +175,7 @@ BUILDS
 		DISABLED "FALSE"
 	}
 	Win64 {
-		INCLUDE "WIN64 WIN AMD64"
+		INCLUDE "WIN AMD64"
 		COMPILER "Compiler.Compile"
 		COMPILEOPTIONS "-p=Win64"
 		EXCLUDEPACKAGES "OberonVoyager OberonAnts"
@@ -297,8 +296,8 @@ PACKAGE Kernel ARCHIVE "Kernel.zip" SOURCE "KernelSrc.zip" DESCRIPTION "A2 Kerne
 
 	BIOS & I386 & ~COOP { BIOS.I386.Machine.Mod }
 	BIOS & AMD64 & ~COOP { BIOS.AMD64.Machine.Mod }
-	WIN32 { Windows.I386.Machine.Mod }
-	WIN64 { Windows.AMD64.Machine.Mod }
+	WIN & I386 { Windows.I386.Machine.Mod }
+	WIN & AMD64 { Windows.AMD64.Machine.Mod }
 	COOP & ~ARM { Mutexes.Mod Coop.Machine.Mod }
 	COOP & ARM { Mutexes.Mod Coop.ARM.Machine.Mod }
 	UNIX & ~COOP { Unix.Machine.Mod }
@@ -1515,7 +1514,7 @@ PACKAGE Oberon ARCHIVE "Oberon.zip" SOURCE "OberonSrc.zip" DESCRIPTION "Oberon f
 
 	# Configuration
 	Configuration.Tool
-	WIN32 { Windows.Oberon.Registry.Mod }
+	WIN & I386 { Windows.Oberon.Registry.Mod }
 	NATIVE, WIN { Oberon.Configuration.Mod }
 
 # Basic Tools. NetSystem, Telnet, TextMail, ET, developer's tools, OpenType.

+ 37 - 37
source/Windows.Kernel32.Mod

@@ -211,7 +211,7 @@ TYPE
 	END;
 
 	ContextPtr*= POINTER {UNSAFE,UNTRACED} TO Context;
-	#IF WIN32 THEN
+	#IF I386 THEN
 	Context* = RECORD
 		ContextFlags*: WORDSET;
 		DR0*, DR1*, DR2*, DR3*, DR6*, DR7*: SIZE;
@@ -220,7 +220,7 @@ TYPE
 		EDI*, ESI*, EBX*, EDX*, ECX*, EAX*: ADDRESS;
 		BP*, PC*, CS*, FLAGS*, SP*, SS*: ADDRESS; (* whereas BP is EBP and SP is ESP *)
 	END;
-	#ELSIF WIN64 THEN
+	#ELSIF AMD64 THEN
 	Context*= RECORD
 		P1Home, P2Home, P3Home, P4Home, P5Home, P6Home: SIZE; 
 		
@@ -238,39 +238,39 @@ TYPE
 		remainder (* leave enough space for the rest here *): ARRAY 1024 OF CHAR;
 		
 		(*    union {
-        XMM_SAVE_AREA32 FltSave;
-        struct {
-            M128A Header[2];
-            M128A Legacy[8];
-            M128A Xmm0;
-            M128A Xmm1;
-            M128A Xmm2;
-            M128A Xmm3;
-            M128A Xmm4;
-            M128A Xmm5;
-            M128A Xmm6;
-            M128A Xmm7;
-            M128A Xmm8;
-            M128A Xmm9;
-            M128A Xmm10;
-            M128A Xmm11;
-            M128A Xmm12;
-            M128A Xmm13;
-            M128A Xmm14;
-            M128A Xmm15;
-        };
-    };
-
-    M128A VectorRegister[26];
-    DWORD64 VectorControl;
-
-    DWORD64 DebugControl;
-    DWORD64 LastBranchToRip;
-    DWORD64 LastBranchFromRip;
-    DWORD64 LastExceptionToRip;
-    DWORD64 LastExceptionFromRip;
-} CONTEXT, *PCONTEXT;
-	*)
+			XMM_SAVE_AREA32 FltSave;
+			struct {
+				M128A Header[2];
+				M128A Legacy[8];
+				M128A Xmm0;
+				M128A Xmm1;
+				M128A Xmm2;
+				M128A Xmm3;
+				M128A Xmm4;
+				M128A Xmm5;
+				M128A Xmm6;
+				M128A Xmm7;
+				M128A Xmm8;
+				M128A Xmm9;
+				M128A Xmm10;
+				M128A Xmm11;
+				M128A Xmm12;
+				M128A Xmm13;
+				M128A Xmm14;
+				M128A Xmm15;
+			};
+			};
+
+			M128A VectorRegister[26];
+			DWORD64 VectorControl;
+
+			DWORD64 DebugControl;
+			DWORD64 LastBranchToRip;
+			DWORD64 LastBranchFromRip;
+			DWORD64 LastExceptionToRip;
+			DWORD64 LastExceptionFromRip;
+		} CONTEXT, *PCONTEXT;
+		*)
 	END; 
 	#END;			
 	
@@ -1113,7 +1113,7 @@ VAR hout: HANDLE;
 	END SetTraceConsole;
 
 
-#IF WIN32 THEN
+#IF I386 THEN
 		(* The following procedure is linked as the first block in the code section of a PE32 executable file 
 			It contains the import table for the two procedures Kernel32.GetProcAddress and Kernel32.LoadLibrary that
 			are patched by the PE linker. 
@@ -1160,7 +1160,7 @@ VAR hout: HANDLE;
 			
 		END EntryPoint;
 		
-#ELSIF WIN64 THEN
+#ELSIF AMD64 THEN
 		(* The following procedure is linked as the first block in the code section of a PE32 executable file 
 			It contains the import table for the two procedures Kernel32.GetProcAddress and Kernel32.LoadLibrary that
 			are patched by the PE linker. 

+ 15 - 15
source/Windows.Objects.Mod

@@ -196,7 +196,11 @@ TYPE
 			(* stack garbage collection *)
 
 			IF Heaps.GCType= Heaps.HeuristicStackInspectionGC THEN
-			#IF WIN64 THEN
+			#IF I386 THEN
+				Heaps.Candidate( state.EDI );  Heaps.Candidate( state.ESI );
+				Heaps.Candidate( state.EBX ); Heaps.Candidate( state.EDX );
+				Heaps.Candidate( state.ECX ); Heaps.Candidate( state.EAX );
+			#ELSIF AMD64 THEN
 				Heaps.Candidate( state.RDI );  Heaps.Candidate( state.RSI );
 				Heaps.Candidate( state.RBX ); Heaps.Candidate( state.RDX );
 				Heaps.Candidate( state.RCX ); Heaps.Candidate( state.RAX );
@@ -204,10 +208,6 @@ TYPE
 				Heaps.Candidate( state.R11 ); Heaps.Candidate( state.R12 );
 				Heaps.Candidate( state.R13 ); Heaps.Candidate( state.R14 );
 				Heaps.Candidate( state.R15 );
-			#ELSIF WIN32 THEN
-				Heaps.Candidate( state.EDI );  Heaps.Candidate( state.ESI );
-				Heaps.Candidate( state.EBX ); Heaps.Candidate( state.EDX );
-				Heaps.Candidate( state.ECX ); Heaps.Candidate( state.EAX );
 			#ELSE
 				ASSERT(FALSE);
 			#END
@@ -539,7 +539,14 @@ BEGIN
 
 			Trace.String( "EXCEPTION " );  Trace.Address(exceptionPointers.exception.ExceptionCode);
 			Trace.String( " at " );  Trace.Address(exceptionPointers.exception.ExceptionAddress);
-			#IF WIN64 THEN
+			#IF I386 THEN
+				Trace.Ln();  Trace.String( "EAX " );  Trace.Hex( exceptionPointers.context.EAX, 1 );
+				Trace.String( "  EBX " );  Trace.Hex( exceptionPointers.context.EBX, 1 );  Trace.Ln();
+				Trace.String( "ECX " );  Trace.Hex( exceptionPointers.context.ECX, 1 );  Trace.String( "  EDX " );
+				Trace.Hex( exceptionPointers.context.EDX, 1 );  Trace.Ln();  Trace.String( "EDI " );
+				Trace.Hex( exceptionPointers.context.EDI, 1 );  Trace.String( "  ESI " );
+				Trace.Hex( exceptionPointers.context.ESI, 1 );  Trace.Ln();  
+			#ELSIF AMD64 THEN
 				Trace.Ln();  Trace.String( "RAX " );  Trace.Address(exceptionPointers.context.RAX);
 				Trace.String( "  RBX " );  Trace.Address(exceptionPointers.context.RBX);  Trace.Ln();
 				Trace.String( "RCX " );  Trace.Address(exceptionPointers.context.RCX);  Trace.String( "  RDX " );
@@ -556,13 +563,6 @@ BEGIN
 				Trace.String( "R14 " ); Trace.Address(exceptionPointers.context.R14);
 				Trace.String( " R15 " ); Trace.Address(exceptionPointers.context.R15);  Trace.Ln();  
 				Trace.Ln; 
-			#ELSIF WIN32 THEN
-				Trace.Ln();  Trace.String( "EAX " );  Trace.Hex( exceptionPointers.context.EAX, 1 );
-				Trace.String( "  EBX " );  Trace.Hex( exceptionPointers.context.EBX, 1 );  Trace.Ln();
-				Trace.String( "ECX " );  Trace.Hex( exceptionPointers.context.ECX, 1 );  Trace.String( "  EDX " );
-				Trace.Hex( exceptionPointers.context.EDX, 1 );  Trace.Ln();  Trace.String( "EDI " );
-				Trace.Hex( exceptionPointers.context.EDI, 1 );  Trace.String( "  ESI " );
-				Trace.Hex( exceptionPointers.context.ESI, 1 );  Trace.Ln();  
 			#ELSE 
 				-- UNIMPLEMENTED --
 			#END
@@ -1274,7 +1274,7 @@ VAR GetProcedureName*: PROCEDURE (pc: ADDRESS; VAR n: ARRAY OF CHAR; VAR spc: AD
 PROCEDURE LeaveA2*;
 VAR cur: Process; ebp,n: ADDRESS;
 BEGIN
-	#IF WIN64 THEN	
+	#IF AMD64 THEN	
 	CODE
 		PUSH RCX
 		PUSH RDX
@@ -1297,7 +1297,7 @@ BEGIN
 		IF cur.gcContext.nextPos > 255 THEN cur.gcContext.nextPos := 255 END;
 		(* IF (cur.gcContext.nextPos > 4) THEN cur.gcContext.nextPos := 2 END;*)
 	END;
-	#IF WIN64 THEN
+	#IF AMD64 THEN
 	CODE
 		POP R9
 		POP R8

+ 5 - 5
source/Windows.Traps.Mod

@@ -139,19 +139,19 @@ VAR
 				Val( "CS", int.CS );  Val( "DS", int.DS );  Val( "ES", int.ES );  Val( "SS", int.SS );
 
 				Val( "PC", int.PC );  
-				#IF WIN64 THEN
+				#IF I386 THEN
+					Val( "ESI", int.ESI );  Val( "EDI", int.EDI );  Val( "ESP", int.SP );
+					Val( "PID", p.id ); Val( "EAX", int.EAX );  Val( "EBX", int.EBX );  Val( "ECX", int.ECX );  Val( "EDX", int.EDX );
+				#ELSIF AMD64 THEN
 					Val( "ESI", int.RSI );  Val( "EDI", int.RDI );  Val( "ESP", int.SP );
 					Val( "PID", p.id ); Val( "EAX", int.RAX );  Val( "EBX", int.RBX );  Val( "ECX", int.RCX );  Val( "EDX", int.RDX );
 					Val( "ESI", int.RSI );  Val( "EDI", int.RDI );  Val( "ESP", int.SP );
-				#ELSIF WIN32 THEN
-					Val( "ESI", int.ESI );  Val( "EDI", int.EDI );  Val( "ESP", int.SP );
-					Val( "PID", p.id ); Val( "EAX", int.EAX );  Val( "EBX", int.EBX );  Val( "ECX", int.ECX );  Val( "EDX", int.EDX );
 				#ELSE
 					ASSERT(FALSE);
 				#END
 				Val( "EBP", int.BP );  Val( "FS", int.FS );  Val( "GS", int.GS );
 				Val( "TMR", Kernel.GetTicks());
-				#IF WIN32 THEN
+				#IF I386 THEN
 					IF SYSTEM.VAL( CHAR, int.DR7 ) # 0X THEN  (* some breakpoints enabled *)
 						Val( "DR0", int.DR0 );  Val( "DR1", int.DR1 );  Val( "DR2", int.DR2 );  Val( "DR3", int.DR3 );  Val( "DR6", int.DR6 );
 						Val( "DR7", int.DR7 );  w.Ln