Source-Changes-HG archive

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

[src/trunk]: src/sys/net Follow argument convension of other emit_xxx() funct...



details:   https://anonhg.NetBSD.org/src/rev/8953aa260473
branches:  trunk
changeset: 333875:8953aa260473
user:      alnsn <alnsn%NetBSD.org@localhost>
date:      Thu Nov 20 14:35:01 2014 +0000

description:
Follow argument convension of other emit_xxx() functions.

diffstat:

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

diffs (53 lines):

diff -r 0f2e5aa8d65d -r 8953aa260473 sys/net/bpfjit.c
--- a/sys/net/bpfjit.c  Thu Nov 20 13:16:05 2014 +0000
+++ b/sys/net/bpfjit.c  Thu Nov 20 14:35:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpfjit.c,v 1.33 2014/11/19 19:34:43 christos Exp $     */
+/*     $NetBSD: bpfjit.c,v 1.34 2014/11/20 14:35:01 alnsn Exp $        */
 
 /*-
  * Copyright (c) 2011-2014 Alexander Nasonov.
@@ -31,9 +31,9 @@
 
 #include <sys/cdefs.h>
 #ifdef _KERNEL
-__KERNEL_RCSID(0, "$NetBSD: bpfjit.c,v 1.33 2014/11/19 19:34:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpfjit.c,v 1.34 2014/11/20 14:35:01 alnsn Exp $");
 #else
-__RCSID("$NetBSD: bpfjit.c,v 1.33 2014/11/19 19:34:43 christos Exp $");
+__RCSID("$NetBSD: bpfjit.c,v 1.34 2014/11/20 14:35:01 alnsn Exp $");
 #endif
 
 #include <sys/types.h>
@@ -1132,9 +1132,11 @@
  * divt,divw are either SLJIT_IMM,pc->k or BJ_XREG,0.
  */
 static int
-emit_moddiv(bool div, struct sljit_compiler *compiler, int divt, sljit_sw divw)
+emit_moddiv(struct sljit_compiler *compiler,
+    const struct bpf_insn *pc, int divt, sljit_sw divw)
 {
        int status;
+       const bool div = BPF_OP(pc->code) == BPF_DIV;
 
 #if BJ_XREG == SLJIT_RETURN_REG   || \
     BJ_XREG == SLJIT_SCRATCH_REG1 || \
@@ -1938,15 +1940,14 @@
                        }
 
                        if (src == BPF_X) {
-                               status = emit_moddiv(op == BPF_DIV,
-                                   compiler, BJ_XREG, 0);
+                               status = emit_moddiv(compiler, pc, BJ_XREG, 0);
                                if (status != SLJIT_SUCCESS)
                                        goto fail;
                        } else if (pc->k != 0) {
                                /* XXX: We can do better here for MOD */
                                if ((pc->k & (pc->k - 1)) || op == BPF_MOD) {
-                                   status = emit_moddiv(op == BPF_DIV,
-                                       compiler, SLJIT_IMM, (uint32_t)pc->k);
+                                       status = emit_moddiv(compiler, pc,
+                                           SLJIT_IMM, (uint32_t)pc->k);
                                } else {
                                    status = emit_pow2_division(compiler,
                                        (uint32_t)pc->k);



Home | Main Index | Thread Index | Old Index