Date: Thu, 21 Aug 2014 11:52:19 GMT From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272764 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw Message-ID: <201408211152.s7LBqJPd049704@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <llvm/IR/Value.h> #include <llvm/Support/MemoryBuffer.h> #include <llvm/Support/ErrorOr.h> +#include <llvm/Support/TargetSelect.h> #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();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408211152.s7LBqJPd049704>