From owner-svn-soc-all@FreeBSD.ORG Tue Aug 12 11:15:17 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02FDA875 for ; Tue, 12 Aug 2014 11:15:17 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C92522DDF for ; Tue, 12 Aug 2014 11:15:16 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7CBFG5x014716 for ; Tue, 12 Aug 2014 11:15:16 GMT (envelope-from dpl@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7CBFGnW014714 for svn-soc-all@FreeBSD.org; Tue, 12 Aug 2014 11:15:16 GMT (envelope-from dpl@FreeBSD.org) Date: Tue, 12 Aug 2014 11:15:16 GMT Message-Id: <201408121115.s7CBFGnW014714@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to dpl@FreeBSD.org using -f From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272268 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 11:15:17 -0000 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*