summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2012-01-26 16:35:09 +0000
committerken <ken@FreeBSD.org>2012-01-26 16:35:09 +0000
commit7f685c218aab7dcffad6119b6e3741a0b71a2e97 (patch)
treed7ac881e15cd62a22e0e8f7d9e34f5708762e482 /sys/kern
parent709d732d543664ea423f0de76539e97df592cf5c (diff)
downloadFreeBSD-src-7f685c218aab7dcffad6119b6e3741a0b71a2e97.zip
FreeBSD-src-7f685c218aab7dcffad6119b6e3741a0b71a2e97.tar.gz
Xen netback driver rewrite.
share/man/man4/Makefile, share/man/man4/xnb.4, sys/dev/xen/netback/netback.c, sys/dev/xen/netback/netback_unit_tests.c: Rewrote the netback driver for xen to attach properly via newbus and work properly in both HVM and PVM mode (only HVM is tested). Works with the in-tree FreeBSD netfront driver or the Windows netfront driver from SuSE. Has not been extensively tested with a Linux netfront driver. Does not implement LRO, TSO, or polling. Includes unit tests that may be run through sysctl after compiling with XNB_DEBUG defined. sys/dev/xen/blkback/blkback.c, sys/xen/interface/io/netif.h: Comment elaboration. sys/kern/uipc_mbuf.c: Fix page fault in kernel mode when calling m_print() on a null mbuf. Since m_print() is only used for debugging, there are no performance concerns for extra error checking code. sys/kern/subr_scanf.c: Add the "hh" and "ll" width specifiers from C99 to scanf(). A few callers were already using "ll" even though scanf() was handling it as "l". Submitted by: Alan Somers <alans@spectralogic.com> Submitted by: John Suykerbuyk <johns@spectralogic.com> Sponsored by: Spectra Logic MFC after: 1 week Reviewed by: ken
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_scanf.c21
-rw-r--r--sys/kern/uipc_mbuf.c5
2 files changed, 23 insertions, 3 deletions
diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c
index 0814953..824e392 100644
--- a/sys/kern/subr_scanf.c
+++ b/sys/kern/subr_scanf.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#define POINTER 0x10 /* weird %p pointer (`fake hex') */
#define NOSKIP 0x20 /* do not skip blanks */
#define QUAD 0x400
+#define SHORTSHORT 0x4000 /** hh: char */
/*
* The following are used in numeric conversions only:
@@ -160,13 +161,23 @@ literal:
flags |= SUPPRESS;
goto again;
case 'l':
- flags |= LONG;
+ if (flags & LONG){
+ flags &= ~LONG;
+ flags |= QUAD;
+ } else {
+ flags |= LONG;
+ }
goto again;
case 'q':
flags |= QUAD;
goto again;
case 'h':
- flags |= SHORT;
+ if (flags & SHORT){
+ flags &= ~SHORT;
+ flags |= SHORTSHORT;
+ } else {
+ flags |= SHORT;
+ }
goto again;
case '0': case '1': case '2': case '3': case '4':
@@ -235,7 +246,9 @@ literal:
nconversions++;
if (flags & SUPPRESS) /* ??? */
continue;
- if (flags & SHORT)
+ if (flags & SHORTSHORT)
+ *va_arg(ap, char *) = nread;
+ else if (flags & SHORT)
*va_arg(ap, short *) = nread;
else if (flags & LONG)
*va_arg(ap, long *) = nread;
@@ -510,6 +523,8 @@ literal:
if (flags & POINTER)
*va_arg(ap, void **) =
(void *)(uintptr_t)res;
+ else if (flags & SHORTSHORT)
+ *va_arg(ap, char *) = res;
else if (flags & SHORT)
*va_arg(ap, short *) = res;
else if (flags & LONG)
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 871132c..620246b 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1410,6 +1410,11 @@ m_print(const struct mbuf *m, int maxlen)
int pdata;
const struct mbuf *m2;
+ if (m == NULL) {
+ printf("mbuf: %p\n", m);
+ return;
+ }
+
if (m->m_flags & M_PKTHDR)
len = m->m_pkthdr.len;
else
OpenPOWER on IntegriCloud