From owner-svn-soc-all@FreeBSD.ORG Thu Aug 21 11:52:19 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 822683B6 for ; Thu, 21 Aug 2014 11:52:19 +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 6DF983BF1 for ; Thu, 21 Aug 2014 11:52:19 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7LBqJmM049814 for ; Thu, 21 Aug 2014 11:52:19 GMT (envelope-from dpl@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7LBqJPd049704 for svn-soc-all@FreeBSD.org; Thu, 21 Aug 2014 11:52:19 GMT (envelope-from dpl@FreeBSD.org) Date: Thu, 21 Aug 2014 11:52:19 GMT Message-Id: <201408211152.s7LBqJPd049704@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: r272764 - 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-1 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: Thu, 21 Aug 2014 11:52:19 -0000 Author: dpl Date: Thu Aug 21 11:52:18 2014 New Revision: 272764 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272764 Log: Added boilerplate to JIT compile, and get crfree only when using FreeBSD 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 Thu Aug 21 10:54:39 2014 (r272763) +++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc Thu Aug 21 11:52:18 2014 (r272764) @@ -18,6 +18,7 @@ #include #include #include +#include #define _KERNEL extern "C" { @@ -270,7 +271,9 @@ // Functions declared at bitcode. printfFunc = mod->getFunction("printf"); ipfw_find_rule = mod->getFunction("ipfw_find_rule"); +#ifdef __FreeBSD__ crfree = mod->getFunction("crfree"); +#endif } // Allocate and initialize LLVM vars. @@ -833,11 +836,14 @@ extern "C" funcptr compile_code(struct ip_fw_args *args, struct ip_fw_chain *chain) { - ipfwJIT compiler(args, chain); - int res; int f_pos = 0; + InitializeNativeTarget(); + LLVMLinkInJIT(); + + ipfwJIT compiler(args, chain); + // Fill up needed local variables. compiler.emit_lookpkt_call();