Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2014 11:15:16 GMT
From:      dpl@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r272268 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw
Message-ID:  <201408121115.s7CBFGnW014714@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dpl
Date: Tue Aug 12 11:15:15 2014
New Revision: 272268
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272268

Log:
  Corrected some wrong allocas and the PointerTypes names.

Modified:
  soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc

Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc
==============================================================================
--- soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc	Tue Aug 12 11:05:16 2014	(r272267)
+++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc	Tue Aug 12 11:15:15 2014	(r272268)
@@ -62,7 +62,7 @@
 	Value *retval;
 
 	// Packet matching variables.
-	Value *mbuf;
+	Value *m;
 	Value *ip;
 	Value *ucred;
 	Value *ucred_lookup;
@@ -130,17 +130,17 @@
 	StructType *ucredTy;
 
 	// Pointer to structs type.
-	PointerType *ifnetTy;
-	PointerType *in_addrTy;
-	PointerType *ipTy;
-	PointerType *ip_fw_argsTy;
-	PointerType *ip_fw_chainTy;
-	PointerType *ip_fwTy;
-	PointerType *ip_fw_insnTy;
-	PointerType *ipfw_dyn_ruleTy;
-	PointerType *ipfw_insn_ifTy;
-	PointerType *mbufTy;
-	PointerType *ucredTy;
+	PointerType *ifnetPtrTy;
+	PointerType *in_addrPtrTy;
+	PointerType *ipPtrTy;
+	PointerType *ip_fw_argsPtrTy;
+	PointerType *ip_fw_chainPtrTy;
+	PointerType *ip_fwPtrTy;
+	PointerType *ip_fw_insnPtrTy;
+	PointerType *ipfw_dyn_rulePtrTy;
+	PointerType *ipfw_insn_ifPtrTy;
+	PointerType *mbufPtrTy;
+	PointerType *ucredPtrTy;
 
 	// Load the bc for JIT compilation.
 	Module *
@@ -214,20 +214,22 @@
 		retval = irb.CreateAlloca(int32Ty);
 		irb.CreateStore(ConstantInt::get(int32Ty, 0), retval);
 
-		mbuf = irb.CreateAlloca(mbufTy); // Init: args->m
+		m = irb.CreateAlloca(mbufPtrTy); // Init: args->m
 		// ip = mtod(m, struct ip *)
 		// #define	mtod(m, t)	((t)((m)->m_data))
-		ip = irb.CreateAlloca(ipTy);
+		ip = irb.CreateAlloca(ipPtrTy);
 
-		ucred = irb.CreateAlloca(ucredTy); // Init: NULL if type ucred.
 #ifdef __FreeBSD__
+		ucred = irb.CreateAlloca(ucredPtrTy); // Init: NULL if type ucred.
 		irb.CreateStore(ConstantPointerNull::get(null), ucred);
+#else
+		ucred = irb.CreateAlloca(ucredTy); // Init: NULL if type ucred.
 #endif
 
 		ucred_lookup = irb.CreateAlloca(int32Ty);
 		irb.CreateStore(ConstantInt::get(int32Ty, 0), ucred_lookup);
 
-		oif = irb.CreateAlloca(ifnetTy); // Init: args->oif
+		oif = irb.CreateAlloca(ifnetPtrTy); // Init: args->oif
 
 		hlen = irb.CreateAlloca(int32Ty);
 		irb.CreateStore(ConstantInt::get(int32Ty, 0), hlen);
@@ -259,7 +261,7 @@
 		dyn_dir = irb.CreateAlloca(int32Ty);
 		irb.CreateStore(ConstantInt::get(int32Ty, MATCH_UNKNOWN), dyn_dir);
 
-		q = irb.CreateAlloca(ipfw_dyn_ruleTy);
+		q = irb.CreateAlloca(ipfw_dyn_rulePtrTy);
 		irb.CreateStore(ConstantPointerNull::get(null), q);
 
 		// There are no (void *), we use i8*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408121115.s7CBFGnW014714>