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

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

Log:
  Added the pointer to struct types

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 10:31:31 2014	(r272266)
+++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc	Tue Aug 12 11:05:16 2014	(r272267)
@@ -116,7 +116,7 @@
 	// Not pkg-filtering related funcs.
 	Function *printf;
 
-	// Used structs
+	// Used structs.
 	StructType *ifnetTy;
 	StructType *in_addrTy;
 	StructType *ipTy;
@@ -129,6 +129,19 @@
 	StructType *mbufTy;
 	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;
+
 	// Load the bc for JIT compilation.
 	Module *
 	loadbc(std::string name)
@@ -170,12 +183,27 @@
 		ip_fw_insnTy = mod->getTypeByName("_ip_fw_insn");
 		ipfw_insn_ifTy = mod->getTypeByName("_ipfw_insn_if");
 		mbufTy = mod->getTypeByName("mbuf");
-#ifndef __FreeBSD__
-		ucredTy = mod->getTypeByName("bsd_ucred");
-#else
+#ifdef __FreeBSD__
 		ucredTy = mod->getTypeByName("ucred");
+#else
+		ucredTy = mod->getTypeByName("bsd_ucred");
 #endif /* __FreeBSD__ */
 
+		// Create Pointer to StructType types.
+		ipfw_dyn_rulePtrTy = PointerType::get(ipfw_dyn_ruleTy);
+		ifnetPtrTy = PointerType::get(ifnetTy);
+		in_addrPtrTy = PointerType::get(in_addrTy);
+		ipPtrTy = PointerType::get(ipTy);
+		ip_fw_argsPtrTy = PointerType::get(ip_fw_argsTy);
+		ip_fw_chainPtrTy = PointerType::get(ip_fw_chainTy);
+		ip_fwPtrTy = PointerType::get(ip_fwTy);
+		ip_fw_insnPtrTy = PointerType::get(_ip_fw_insnTy);
+		ipfw_insn_ifPtrTy = PointerType::get(_ipfw_insn_ifTy);
+		mbufPtrTy = PointerType::get(mbufTy);
+#ifdef __FreeBSD__
+		ucredPtrTy = PointerType::get(ucredTy);
+#endif
+
 		// Allocate vars.
 		match = irb.CreateAlloca(int32Ty);
 		l = irb.CreateAlloca(int32Ty);



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