Module Name: src Committed By: alnsn Date: Tue Dec 29 21:49:58 UTC 2015
Modified Files: src/sys/net: bpfjit.c Log Message: Replace the nsaveds() function with #define NSAVEDS 3. No functional change. Patch from Michael McConville. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/net/bpfjit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/bpfjit.c diff -u src/sys/net/bpfjit.c:1.43 src/sys/net/bpfjit.c:1.44 --- src/sys/net/bpfjit.c:1.43 Sat Feb 14 21:32:46 2015 +++ src/sys/net/bpfjit.c Tue Dec 29 21:49:58 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bpfjit.c,v 1.43 2015/02/14 21:32:46 alnsn Exp $ */ +/* $NetBSD: bpfjit.c,v 1.44 2015/12/29 21:49:58 alnsn Exp $ */ /*- * Copyright (c) 2011-2015 Alexander Nasonov. @@ -31,9 +31,9 @@ #include <sys/cdefs.h> #ifdef _KERNEL -__KERNEL_RCSID(0, "$NetBSD: bpfjit.c,v 1.43 2015/02/14 21:32:46 alnsn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bpfjit.c,v 1.44 2015/12/29 21:49:58 alnsn Exp $"); #else -__RCSID("$NetBSD: bpfjit.c,v 1.43 2015/02/14 21:32:46 alnsn Exp $"); +__RCSID("$NetBSD: bpfjit.c,v 1.44 2015/12/29 21:49:58 alnsn Exp $"); #endif #include <sys/types.h> @@ -76,6 +76,11 @@ __RCSID("$NetBSD: bpfjit.c,v 1.43 2015/0 #endif /* + * Number of saved registers to pass to sljit_emit_enter() function. + */ +#define NSAVEDS 3 + +/* * Arguments of generated bpfjit_func_t. * The first argument is reassigned upon entry * to a more frequently used buf argument. @@ -273,18 +278,6 @@ nscratches(bpfjit_hint_t hints) return rv; } -/* - * Return a number of saved registers to pass - * to sljit_emit_enter() function. - */ -static sljit_si -nsaveds(bpfjit_hint_t hints) -{ - sljit_si rv = 3; - - return rv; -} - static uint32_t read_width(const struct bpf_insn *pc) { @@ -2192,7 +2185,7 @@ bpfjit_generate_code(const bpf_ctx_t *bc #endif status = sljit_emit_enter(compiler, - 2, nscratches(hints), nsaveds(hints), sizeof(struct bpfjit_stack)); + 2, nscratches(hints), NSAVEDS, sizeof(struct bpfjit_stack)); if (status != SLJIT_SUCCESS) goto fail;