Browse Source

Fixed address size issues

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8075 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 years ago
parent
commit
4f31d40b25
2 changed files with 5 additions and 5 deletions
  1. 2 2
      source/RTL8169.Mod
  2. 3 3
      source/UsbHcdi.Mod

+ 2 - 2
source/RTL8169.Mod

@@ -552,7 +552,7 @@ TYPE
 			IF adr MOD 256 = 0 THEN
 				firstRD := 0;
 			ELSE
-				firstRD := 16 - ((adr MOD 256) DIV 16);
+				firstRD := 16 - (LONGINT (adr MOD 256) DIV 16);
 			END;
 
 			IF DebugRxRing IN Debug THEN
@@ -611,7 +611,7 @@ TYPE
 			IF adr MOD 256 = 0 THEN
 				firstTD := 0;
 			ELSE
-				firstTD := 16 - ((adr MOD 256) DIV 16);
+				firstTD := 16 - (LONGINT (adr MOD 256) DIV 16);
 			END;
 			lastTD := firstTD;
 			nofFreeTx := TxRingSize - firstTD;

+ 3 - 3
source/UsbHcdi.Mod

@@ -535,7 +535,7 @@ TYPE
 			END;
 			(* TD's must be 32byte aligned for EHCI, 16byte aligned for UHCI & OHCI data structures*)
 			(* currently max qh size is below 128 bytes for EHCI, so a queue head will not cross page boundaries *)
-			pipe.qh := Align(ADDRESS OF pipe.tdBuffer[0], 128);
+			pipe.qh := Machine.Ensure32BitAddress(Align(ADDRESS OF pipe.tdBuffer[0], 128));
 			pipe.tdBase := pipe.qh + 32;
 			ASSERT((pipe.qh >= ADDRESSOF(pipe.tdBuffer[0])) & (pipe.tdBase <= ADDRESSOF(pipe.tdBuffer[pipe.tdBufferLen-1])));
 			IF ~InsertQH(pipe) THEN
@@ -659,7 +659,7 @@ TYPE
 			NEW(pipe.tdBuffer, pipe.tdBufferLen);
 			(* TD's must be 32byte aligned for EHCI data structures, 16byte for UHCI & OHCI data structures *)
 			(* currently max qh size is below 128 bytes for EHCI, so a queue head will not cross page boundaries *)
-			pipe.qh := Align(ADDRESS OF pipe.tdBuffer[0], 128);
+			pipe.qh := Machine.Ensure32BitAddress(Align(ADDRESS OF pipe.tdBuffer[0], 128));
 			pipe.tdBase := pipe.qh + 32;
 			IF Debug.StrongChecks THEN
 				ASSERT(pipe.tdBase >= ADDRESSOF(pipe.tdBuffer[0]));
@@ -1405,4 +1405,4 @@ END Cleanup;
 BEGIN
 	Modules.InstallTermHandler(Cleanup);
 	NEW(controllers, "UsbHcdi","USB host controller drivers");
-END UsbHcdi.
+END UsbHcdi.