Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Replace the nsaveds() function with #define NSAVEDS ...



details:   https://anonhg.NetBSD.org/src/rev/ee1b77ffe62a
branches:  trunk
changeset: 342582:ee1b77ffe62a
user:      alnsn <alnsn%NetBSD.org@localhost>
date:      Tue Dec 29 21:49:58 2015 +0000

description:
Replace the nsaveds() function with #define NSAVEDS 3. No functional change.

Patch from Michael McConville.

diffstat:

 sys/net/bpfjit.c |  25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diffs (61 lines):

diff -r 36882322577e -r ee1b77ffe62a sys/net/bpfjit.c
--- a/sys/net/bpfjit.c  Tue Dec 29 17:55:23 2015 +0000
+++ b/sys/net/bpfjit.c  Tue Dec 29 21:49:58 2015 +0000
@@ -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 @@
 #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 @@
        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 @@
 #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;
 



Home | Main Index | Thread Index | Old Index