Explorar o código

introduced procedures for getting input/output port data address

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8401 8c9fc860-2736-0410-a75d-ab315db34111
eth.morozova %!s(int64=7) %!d(string=hai) anos
pai
achega
c4e0bf3050
Modificáronse 1 ficheiros con 16 adicións e 0 borrados
  1. 16 0
      source/Zynq.AcAxisIo.Mod

+ 16 - 0
source/Zynq.AcAxisIo.Mod

@@ -100,6 +100,22 @@ VAR
 
 		RETURN TRUE;
 	END GetOutput;
+	
+	PROCEDURE GetOutputDataAddr*(out: Output): ADDRESS;
+	VAR portDesc: POINTER {UNSAFE} TO PortDesc;
+	BEGIN
+		portDesc := SYSTEM.VAL(ADDRESS,out);
+		ASSERT(portDesc # NIL);
+		RETURN portDesc.portAddr;
+	END GetOutputDataAddr;
+	
+	PROCEDURE GetInputDataAddr*(inp: Input): ADDRESS;
+	VAR portDesc: POINTER {UNSAFE} TO PortDesc;
+	BEGIN
+		portDesc := SYSTEM.VAL(ADDRESS,inp);
+		ASSERT(portDesc # NIL);
+		RETURN portDesc.portAddr+8;
+	END GetInputDataAddr;
 
 	(*
 		Acquire exclusive access to a resource