Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Most filter programs in the kernel need 3 scratch re...
details: https://anonhg.NetBSD.org/src/rev/42c499a0cf09
branches: trunk
changeset: 330422:42c499a0cf09
user: alnsn <alnsn%NetBSD.org@localhost>
date: Tue Jul 08 11:30:31 2014 +0000
description:
Most filter programs in the kernel need 3 scratch registers.
diffstat:
sys/net/bpfjit.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 6aaeaa794840 -r 42c499a0cf09 sys/net/bpfjit.c
--- a/sys/net/bpfjit.c Tue Jul 08 11:13:24 2014 +0000
+++ b/sys/net/bpfjit.c Tue Jul 08 11:30:31 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpfjit.c,v 1.21 2014/07/05 11:13:13 alnsn Exp $ */
+/* $NetBSD: bpfjit.c,v 1.22 2014/07/08 11:30:31 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.21 2014/07/05 11:13:13 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpfjit.c,v 1.22 2014/07/08 11:30:31 alnsn Exp $");
#else
-__RCSID("$NetBSD: bpfjit.c,v 1.21 2014/07/05 11:13:13 alnsn Exp $");
+__RCSID("$NetBSD: bpfjit.c,v 1.22 2014/07/08 11:30:31 alnsn Exp $");
#endif
#include <sys/types.h>
@@ -251,6 +251,14 @@
{
sljit_si rv = 2;
+#ifdef _KERNEL
+ /*
+ * Most kernel programs load packet bytes and they generate
+ * m_xword/m_xhalf/m_xbyte() calls with three arguments.
+ */
+ rv = 3;
+#endif
+
if (hints & BJ_HINT_LDW)
rv = 3; /* uses BJ_TMP2REG */
Home |
Main Index |
Thread Index |
Old Index