adjust our internal state, as this implicitly resets the current
descriptor pointer.
Previously "ifconfig eqos0 down; ifconfig eqos0 up" made the interface
non-functional.
- Note that this function is only used by dumpsys().
- Don't safe the PS word; there isn't actually a spot for it in the PCB.
- Don't bother returning anything; savectx() is declared void.
order reads with respect to writes. Remove now-redundant tc_wmb()
calls before tc_syncbus().
NFC on MIPS other than removing a redundant wbflush() (tc_wmb() followed
by tc_syncbus()).
This way we don't pollute the NetBSD kernel namespace with all the
Linux compat shim definitions needed to build drm, except for the
local drm drivers that need the API.
Failures from this are much more obvious to debug than files with
missing #ifdefs, which sometimes lead to build failures but could
also just lead to silent miscompilation.
As far as I know there is no need for this; the CPU has weak ordering
on loads and stores requiring ordering barriers, but I/O devices
participate in the CPU's cache protocol for access to main memory so
there's never any need for explicit cache flushes.
This horrible kludge dates from before I understood the relation of
genfb_pci and pci drm drivers in the old and new worlds of drm.
The only user of it, in i915, was changed to use agp_i810_borrow
directly in the last drm update, so this hack can die.
The bus space is mapped non-prefetchable and non-cacheable, so there
is no need for bus_space_barrier and it might not even have any
effect -- bus_space_read/write are totally ordered for non-
prefetchable, non-cacheable mappings anyway. Presumably the intent
here was to wait for acknowledgment of the write from the device --
which bus_space_barrier does not guarantee, and which I expect
requires a read transaction as CSR_WRITE_FLUSH performs.
ok msaitoh@, knakahara@
The newly written tx descriptor needs to be visible to the device
before the TDT register is set. There's no bus space mappings that
need any barriers, though -- nothing mapped prefetchable or cacheable
here. So bus_dmamap_sync (via wm_cdtxsync) is necessary, not
bus_space_barrier. By accident, bus_space_barrier implies the same
barrier instructions as bus_dmamap_sync on some architectures, but it
wouldn't work at all if we were bouncing.
ok msaitoh@, knakahara@
registrations can result in a UAF: When a device detaches, it
calls seldestroy(), which calls knote_fini(), and when that
returns, the softc that contained the selinfo and klist are freed.
However, any knotes that were registered still linger on with the
kq descriptor they're were associated with, and when the file
descriptors close, those knotes will be f_detach'd, which will
call into the driver instance that no longer exists.
Address this problem by adding a "foplock" mutex to the knote.
This foplock must be held when calling into filter_attach(),
filter_detach(), and filter_event() (XXX not filter_touch();
see code for details). Now, in klist_fini(), for each knote
that is on the klist that's about to be blown away, acquire
the foplock, replace the knote's filterops with a do-nothing
stub, and release the foplock.
The end result is that:
==> The foplock ensures that calls into filter_*() will get EITHER
the real backing object's filterops OR the nop stubs.
==> Holing the foplock across the filter_*() calls ensures that
klist_fini() will not complete until there are no callers inside
the filterops that are about to be blown away.
The driver-specific sc_scheduled boolean flag was racy. It is
necessary to use config_pending_incr/decr to hold up console
selection and userland start (and block detach, not that that works
yet) until the drmfb attach has completed.
as error (*). This occurs typically when signal is received.
(*) For older version, we already deal with short read(2) from remote
host in sink(). But for other cases, i.e., write(2) to local file in
sink(), read(2)/write(2) in source(), error was raised.
This version of rcp(1) can successfully send/receive files with older
version, even if short read(2)/write(2) occurs by SIGINFO.
Also, when real error occurs, give up immediately instead of continue to
send/receive wrong data.
Clean up the mess a little bit as well...
Make kqueue event status for vnodes shareable, and for stacked file systems
like nullfs, make the upper vnode share that status with the lower vnode.
And, lo, NetBSD 9.99.99.
Fixes PR kern/56713.
More importantly, make sizeof(struct vcons_data) independent of
whether VCONS_DRAW_INTR &c. is defined.
Allocate the private space with kmem rather than in the caller.
This still doesn't have very good separation between interface
parameters and internal state, but it's better than before, and is
necessary to make genfb usable in modules.
In arm_simplefb.c, this removes use of the use_intr member. That
assignment became redundant with the introduction of vcons_earlyinit,
so there's no need to replace it by anything.
In general membar_*() is _not_ enough for *mb(), because membar_*()
is only for CPU/CPU synchronization on normal memory, and *mb()
requires machine-dependent I/O logic. Leave it as an `#error' case
if the architecture isn't listed here. But membar_*() is OK for
smp_*().
Fill in powerpc and sparc while here, as examples of what the
now-removed defaults failed to do. If you want to use drm on a mips
or alpha system yer gonna hafta fill this in yourself.