always using "function" instead of "macro".
Changed "undefined result" into "undefined behavior" for argument values
outside the valid range. Since the character table is allocated via
malloc(), it _may_ happen that it starts at a page boundary, so that
negative values for the argument result in a segmentation fault. In that
case, there is no result at all.
with spl used to protect other allocations and frees, or datastructure
element insertion and removal, in adjacent code.
It is almost unquestionably the case that some of the spl()/splx() calls
added here are superfluous, but it really seems wrong to see:
s=splfoo();
/* frob data structure */
splx(s);
pool_put(x);
and if we think we need to protect the first operation, then it is hard
to see why we should not think we need to protect the next. "Better
safe than sorry".
It is also almost unquestionably the case that I missed some pool
gets/puts from interrupt context with my strategy for finding these
calls; use of PR_NOWAIT is a strong hint that a pool may be used from
interrupt context but many callers in the kernel pass a "can wait/can't
wait" flag down such that my searches might not have found them. One
notable area that needs to be looked at is pf.
See also:
http://mail-index.netbsd.org/tech-kern/2006/07/19/0003.htmlhttp://mail-index.netbsd.org/tech-kern/2006/07/19/0009.html
sun68k/include/intr.h.
This also means now sun3 has GENERIC_SOFT_INTERRUPTS support,
so also adapt fd.c and zs.c to MI softintr(9) APIs.
(I'll also update related sources in yamt-splraiseipl branch later)
- include <m68k/cpu.h> rather than <m68k/m68k.h> in <sun68k/cpu.h>
- wrap M68K_VAC definition with #ifndef _SUN3X_ in <sun68k/cpu.h>
- move setsoftnet() macro from <sun68k/cpu.h> to <sun68k/intr.h>
- move declarations for isr_soft_request() and isr_soft_clear() from
sun2/include/intr.h to <sun68k/intr.h>
- remove extern keyword from function declarations
the LKM.
While there, rename 'rval' as 'pn_family', and make it a global variable.
The k[78]_powernow_destroy() functions have never been called because of
that...
is going to be used from within m_xhalf() and m_xword(). In using
MINDEX in those cases, we must set *err to '1' *before* calling MINDEX
just in case MINDEX does decide to 'return', and causes the function
to return 0 with an un-set err value. A consequence of this fix is
that we can cleanup a couple of (now) unneeded goto's. Problem found
by inspection whilst searching for the cause of a different panic.
Also: pavel@ noted the following:
if (merr != 0)
return 0;
was missing from after a call to m_xhalf(), so fix that too.
src/regress/sys/net/bpf/out-of-bounds now passes the regression test.
Ok'ed by pavel@.
call - which makes the code completely impossibly to follow, call fflush()
and ferror() just prior to calling fclose().
This has the advantage of actually detecting the any write errors, since
the output is block bufferred and will typically not happen during fprintf()
but only during the fclose() - where it is difficult to report.
I also singlilarly refuse to add (void) casts to every printf call in the
system - since it almost never makes any sense to look at the return value
(unless you want to know how many bytes were actually writtem).