dragonfly.git
13 years agokernel - Tear out device polling
Samuel J. Greear [Sun, 11 Jul 2010 16:23:55 +0000 (16:23 +0000)]
kernel - Tear out device polling

* Remove existing (now legacy) code that implements device polling, kq filters
  are now the "One True (and only) Way"

* Add dummy write filters (always true) for devices: targ, vinum, snp, tw
  and apm

13 years agonet - Add dummy kq write support to tun and tap
Samuel J. Greear [Sun, 11 Jul 2010 14:07:28 +0000 (14:07 +0000)]
net - Add dummy kq write support to tun and tap

* Makes tun and tap always report writeable if polled via a kq-enabled
  interface.

13 years agodev - Mask false uninitialized variable warning
Samuel J. Greear [Sun, 11 Jul 2010 14:06:27 +0000 (14:06 +0000)]
dev - Mask false uninitialized variable warning

13 years agokernel - kqfilter - Fix edge-case lockup in kern_kevent()
Matthew Dillon [Fri, 9 Jul 2010 21:08:23 +0000 (14:08 -0700)]
kernel - kqfilter - Fix edge-case lockup in kern_kevent()

* An edge case where the marker can wind up at the head of
  a non-empty event list containing only spurious events.  This
  causes an endless loop to be entered because only the sleep
  case moves the marker.

* If no events were processed and we loop the marker is now
  moved, fixing the problem.

13 years agokernel - Fix kqfilter error return codes
Matthew Dillon [Fri, 9 Jul 2010 05:19:06 +0000 (22:19 -0700)]
kernel - Fix kqfilter error return codes

* Some kqfilters returned an Exxx error, others return 1 on error,
  and the device kq code returned -1 on error.

* All kqfilters now return a proper Exxx error.

* When an EVFILT is not implemented, EOPNOTSUPP is now returned.
  EPERM is no longer returned.

13 years agokernel - implement serialno for kqueue poll handling part 1/2
Matthew Dillon [Fri, 9 Jul 2010 04:46:52 +0000 (21:46 -0700)]
kernel - implement serialno for kqueue poll handling part 1/2

* The kqueue implementation for the poll system call was improperly
  triggering on spurious events.

* Adjust the poll support code to implement a serial number scheme
  similar to how the select code works.  The poll array index is also
  encoded.

* poll() handles unsupported POLLPRI and POLLRDBAND requests differently
  from select().  poll() ignores these requests if they are not supported
  (select returns an error).

  Allow kqfilter functions to return EPERM or EOPNOTSUPP to indicate
  an unsupported filter.  Return values will be fixed in part 2.

13 years agoMerge remote branch 'crater/master' into kq_devices
Matthew Dillon [Fri, 9 Jul 2010 00:37:24 +0000 (17:37 -0700)]
Merge remote branch 'crater/master' into kq_devices

13 years agodev - Properly propogate wakeup events for ums
Matthew Dillon [Thu, 8 Jul 2010 23:04:25 +0000 (16:04 -0700)]
dev - Properly propogate wakeup events for ums

* The last commit had a minor problem.  It turns out that the
  selwakeup() code does not generate a kqueue event or wake it up
  if no select pid was set, and since select() now uses kqueue no
  select pid will ever be set.

* Calling KNOTE() directly solves the problem.

13 years agomkinitrd - make use of lt
Alex Hornung [Thu, 8 Jul 2010 21:36:57 +0000 (22:36 +0100)]
mkinitrd - make use of lt

13 years agolt - add new tree-like utility
Alex Hornung [Thu, 8 Jul 2010 21:24:02 +0000 (22:24 +0100)]
lt - add new tree-like utility

* lt shows the directory structure below some specified directory much
  like the tree utility does.

13 years agolibmd - add sha512, fix warnings in tests
Alex Hornung [Sun, 4 Jul 2010 13:05:58 +0000 (14:05 +0100)]
libmd - add sha512, fix warnings in tests

* Add a SHA512 implementation taken from sys/crypto/sha2.

* Fix the test driver warnings up to the set WARNS level.

13 years agolibc - correct pthread_once stub
Alex Hornung [Sun, 4 Jul 2010 22:37:18 +0000 (23:37 +0100)]
libc - correct pthread_once stub

* Make the pthread_once stub in libc work correctly.

* This fixes an issue with pthread_once not being called even once in
  libprop for programs not linked against lpthread.

Suggested-by: Simon 'corecode' Schubert
Obtained-from: NetBSD

13 years agodev - Properly propogate wakeup events for ums
Samuel J. Greear [Thu, 8 Jul 2010 16:53:09 +0000 (16:53 +0000)]
dev - Properly propogate wakeup events for ums

* No longer conditionalize the call to selwakeup when new data is available,
  the kq subsystem will sort out whether a wakeup really needs to happen or
  not.

13 years agokernel - skip PG_MARKER vm pages.
Matthew Dillon [Thu, 8 Jul 2010 05:15:05 +0000 (22:15 -0700)]
kernel - skip PG_MARKER vm pages.

* The contigmalloc code was improperly interpreting PG_MARKER
  VM pages, resulting in an infinite blocking condition.

13 years agoMerge branch 'master' into kq_devices
Samuel J. Greear [Wed, 7 Jul 2010 15:57:10 +0000 (15:57 +0000)]
Merge branch 'master' into kq_devices

13 years agodevfs(4): Remove a bogus assertion (nchildren is unsigned, hence can't be <0).
Sascha Wildner [Wed, 7 Jul 2010 15:45:06 +0000 (17:45 +0200)]
devfs(4): Remove a bogus assertion (nchildren is unsigned, hence can't be <0).

In-discussion-with: alexh

13 years agobus - Add kq support to usb bus
Samuel J. Greear [Wed, 7 Jul 2010 15:46:37 +0000 (15:46 +0000)]
bus - Add kq support to usb bus

13 years agodev - Add kq support to usbmisc devices
Samuel J. Greear [Wed, 7 Jul 2010 15:46:01 +0000 (15:46 +0000)]
dev - Add kq support to usbmisc devices

* ugen, uhid, ums and uscanner

13 years agoi4b - Add kq support
Samuel J. Greear [Wed, 7 Jul 2010 14:12:01 +0000 (14:12 +0000)]
i4b - Add kq support

13 years agokernel - Add kq support to ctty
Samuel J. Greear [Wed, 7 Jul 2010 12:54:36 +0000 (12:54 +0000)]
kernel - Add kq support to ctty

13 years agodev - Add kq support to drm
Samuel J. Greear [Wed, 7 Jul 2010 12:29:30 +0000 (12:29 +0000)]
dev - Add kq support to drm

13 years agobus - Add kq support to fwdev
Samuel J. Greear [Wed, 7 Jul 2010 12:17:34 +0000 (12:17 +0000)]
bus - Add kq support to fwdev

13 years agokernel - Fix altq for x86_64 vkernel build
Matthew Dillon [Wed, 7 Jul 2010 04:29:24 +0000 (21:29 -0700)]
kernel - Fix altq for x86_64 vkernel build

* Remove i386-conditionalization for TSC access
* Probably also fixes x864_64 normal kernel build too.

13 years agokernel - MPSAFE work - Basic tokenization for vkernel x86_64 pmap.c
Matthew Dillon [Wed, 7 Jul 2010 04:28:50 +0000 (21:28 -0700)]
kernel - MPSAFE work - Basic tokenization for vkernel x86_64 pmap.c

* Tokenize the vkernel x86_64 pmap.c file

13 years agokernel - MPSAFE work - Basic tokenization for vkernel i386 pmap.c
Matthew Dillon [Tue, 6 Jul 2010 04:31:09 +0000 (21:31 -0700)]
kernel - MPSAFE work - Basic tokenization for vkernel i386 pmap.c

* Tokenize the vkernel i386 pmap.c file
* Add minor documentation to x86_64 pmap.c

13 years agosys/conf/kmod.mk: Adjust the genassym stuff a wee bit.
Sascha Wildner [Tue, 6 Jul 2010 01:22:38 +0000 (03:22 +0200)]
sys/conf/kmod.mk: Adjust the genassym stuff a wee bit.

This should fix 'make -j X buildkernel'.

Reported-by: sephe
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1792>
Modeled-after: FreeBSD

13 years ago/usr/Makefile: Adjust to our new handling of the pkgsrc GIT repository.
Sascha Wildner [Mon, 5 Jul 2010 12:42:03 +0000 (14:42 +0200)]
/usr/Makefile: Adjust to our new handling of the pkgsrc GIT repository.

13 years agodev - Add kq support to hotplug
Samuel J. Greear [Mon, 5 Jul 2010 07:53:29 +0000 (07:53 +0000)]
dev - Add kq support to hotplug

13 years agodev - Add kq support to spic
Samuel J. Greear [Mon, 5 Jul 2010 07:39:27 +0000 (07:39 +0000)]
dev - Add kq support to spic

13 years agodev - Add kq support to tw
Samuel J. Greear [Mon, 5 Jul 2010 07:26:11 +0000 (07:26 +0000)]
dev - Add kq support to tw

13 years agodev - Add kq support to cmx
Samuel J. Greear [Mon, 5 Jul 2010 07:13:20 +0000 (07:13 +0000)]
dev - Add kq support to cmx

13 years agodev - Add kq support to bktr
Samuel J. Greear [Mon, 5 Jul 2010 06:45:51 +0000 (06:45 +0000)]
dev - Add kq support to bktr

13 years agodev - Add kq support to cxm
Samuel J. Greear [Mon, 5 Jul 2010 06:18:31 +0000 (06:18 +0000)]
dev - Add kq support to cxm

13 years agodev - Add kq support to aac
Samuel J. Greear [Mon, 5 Jul 2010 04:17:09 +0000 (04:17 +0000)]
dev - Add kq support to aac

13 years agovinum - Add kq support
Samuel J. Greear [Mon, 5 Jul 2010 04:06:50 +0000 (04:06 +0000)]
vinum - Add kq support

13 years agodev - Add kq support to snp
Samuel J. Greear [Mon, 5 Jul 2010 03:39:35 +0000 (03:39 +0000)]
dev - Add kq support to snp

13 years agodev - Add kq support to mse
Samuel J. Greear [Mon, 5 Jul 2010 03:38:53 +0000 (03:38 +0000)]
dev - Add kq support to mse

13 years agodev - Add kq support to asc
Samuel J. Greear [Mon, 5 Jul 2010 03:38:10 +0000 (03:38 +0000)]
dev - Add kq support to asc

13 years agolinux - Finish bringing epoll in sync with kevent changes
Samuel J. Greear [Mon, 5 Jul 2010 03:31:47 +0000 (03:31 +0000)]
linux - Finish bringing epoll in sync with kevent changes

* Description extraction now happens outside of kern_event()

13 years agoapm - Add kq support
Samuel J. Greear [Mon, 5 Jul 2010 02:25:58 +0000 (02:25 +0000)]
apm - Add kq support

13 years agodev - Add kq support to kbd
Samuel J. Greear [Mon, 5 Jul 2010 02:25:09 +0000 (02:25 +0000)]
dev - Add kq support to kbd

13 years agofilters - Minor fixes
Samuel J. Greear [Mon, 5 Jul 2010 01:46:29 +0000 (01:46 +0000)]
filters - Minor fixes

* Don't fall-through in psm kqfilter setup struct

* Assign correct address to kn_hook in tun setup function

13 years agotop: Fix count of process states
Stathis Kamperis [Sun, 4 Jul 2010 06:19:44 +0000 (09:19 +0300)]
top: Fix count of process states

The count was not in correspondence with our enumeration constants
for the process states. For example, an "active" process could be
counted as "running".

Only tested with i386/UP :)

13 years agoacpi_{hp,thinkpad}.4: Fix sysctl names.
Sascha Wildner [Sun, 4 Jul 2010 19:07:30 +0000 (21:07 +0200)]
acpi_{hp,thinkpad}.4: Fix sysctl names.

13 years agoral.4: We don't have %U, so use %O for URLs for now.
Sascha Wildner [Sun, 4 Jul 2010 18:45:45 +0000 (20:45 +0200)]
ral.4: We don't have %U, so use %O for URLs for now.

13 years agoacpi_sony(4): Sync with FreeBSD.
Sascha Wildner [Sun, 4 Jul 2010 18:43:09 +0000 (20:43 +0200)]
acpi_sony(4): Sync with FreeBSD.

13 years agoacpi_sony.4: Fix sysctl names.
Sascha Wildner [Sun, 4 Jul 2010 18:36:38 +0000 (20:36 +0200)]
acpi_sony.4: Fix sysctl names.

13 years agoMake the loader load ehci.ko by default.
Sascha Wildner [Sun, 4 Jul 2010 15:50:44 +0000 (17:50 +0200)]
Make the loader load ehci.ko by default.

It seems to do more good than harm.

HOWEVER!

Unfortunately, There are systems that don't play nice with ehci. One
of my boxes, for example, won't reboot with ehci loaded.

Therefore, the behavior introduced with this commit can be disabled
by doing one of the following things:

1) 'unset ehci_load' from the loader prompt before booting.

2) Booting in 'safe mode'.

3) Putting 'hint.ehci.0.disabled=1' in /boot/loader.conf.

This is all modeled after the way the automatic loading of acpi.ko is
handled.

13 years agotest commit
Sascha Wildner [Sun, 4 Jul 2010 16:05:11 +0000 (18:05 +0200)]
test commit

13 years agomkinitrd(8): Strip binaries when copying so they will fit in the image.
Sascha Wildner [Sun, 4 Jul 2010 01:47:05 +0000 (03:47 +0200)]
mkinitrd(8): Strip binaries when copying so they will fit in the image.

While here, comment out a call of the tree utility which we don't have
in base.

13 years agoinitrd: /usr/share/initrd/sbin wasn't being created. Add it via mtree(8).
Sascha Wildner [Sun, 4 Jul 2010 01:45:25 +0000 (03:45 +0200)]
initrd: /usr/share/initrd/sbin wasn't being created. Add it via mtree(8).

This led to oinit being installed as a file named 'sbin'. Remove this
file via etc/Makefile (during 'make upgrade') so that with the next
upgrade the file is installed correctly.

13 years agostandards.7: Write some more and mention the default environment.
Sascha Wildner [Sat, 3 Jul 2010 23:54:30 +0000 (01:54 +0200)]
standards.7: Write some more and mention the default environment.

13 years agoAdd a few __printflike() and __scanflike() to various header files.
Sascha Wildner [Sat, 3 Jul 2010 20:35:42 +0000 (22:35 +0200)]
Add a few __printflike() and __scanflike() to various header files.

13 years agovinum(4): Use char for has_part since that's what we scanf() later on.
Sascha Wildner [Sat, 3 Jul 2010 20:35:04 +0000 (22:35 +0200)]
vinum(4): Use char for has_part since that's what we scanf() later on.

13 years agoUncomment vinum in LINT to have it covered by -Werror.
Sascha Wildner [Sat, 3 Jul 2010 20:34:04 +0000 (22:34 +0200)]
Uncomment vinum in LINT to have it covered by -Werror.

13 years agokernel - MPSAFE work - Basic tokenization for x86_64 pmap.c
Matthew Dillon [Sat, 3 Jul 2010 18:20:58 +0000 (11:20 -0700)]
kernel - MPSAFE work - Basic tokenization for x86_64 pmap.c

* Tokenize x86_64 pmap.c, it still needs documenting and cleanup
  like i386 pmap.c has.

13 years agokernel - MPSAFE work - Finish tokenizing vm_page.c
Matthew Dillon [Sat, 3 Jul 2010 18:19:26 +0000 (11:19 -0700)]
kernel - MPSAFE work - Finish tokenizing vm_page.c

* Finish tokenizing vm_page.c

* Certain global procedures, particular vm_page_hold() and vm_page_unhold(),
  are best called with the vm_token already held for implied non-blocking
  operation.

13 years agokernel - MPSAFE work - Add missing token release
Matthew Dillon [Sat, 3 Jul 2010 18:16:54 +0000 (11:16 -0700)]
kernel - MPSAFE work - Add missing token release

* Add a missing token release in a rare code path.

13 years agolinux emu - MPSAFE work
Alex Hornung [Sat, 3 Jul 2010 17:40:10 +0000 (18:40 +0100)]
linux emu - MPSAFE work

* Reduce the uses of the mplock to a bare minimum, such as when calling
  exit1.

* Change the emuldata lock to lockmgr; it shouldn't have been mplock in
  the first place.

* Reduce the scope locked by the emuldata lock as much as possible.

13 years agokmod.mk - attempt to enable use of assym for kmods
Alex Hornung [Sat, 3 Jul 2010 17:38:21 +0000 (18:38 +0100)]
kmod.mk - attempt to enable use of assym for kmods

* Half-working attempt at being able to use assym.s in kernel modules
  when doing a 'make' in the directory of the module. It will now fail
  because of opt_nfs.h being included by nfs.h, included by genassym.c
  not being found.

Obtained-from: FreeBSD

13 years agosk(4): Initialize if_multiaddrs (in ether_ifattach), before touching it
Sepherosa Ziehau [Sat, 3 Jul 2010 05:30:11 +0000 (13:30 +0800)]
sk(4): Initialize if_multiaddrs (in ether_ifattach), before touching it

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1789

13 years agokernel - hold MP lock in idlezero for now
Matthew Dillon [Sat, 3 Jul 2010 02:07:14 +0000 (19:07 -0700)]
kernel - hold MP lock in idlezero for now

* The MP lock must be held in the idlezero code for now until tokenization
  is finished on the rest of the code base.

* Fixes random memory corruption which could occur when idlezero was
  turned on.

13 years agodev - Add kq support to psm
Samuel J. Greear [Fri, 2 Jul 2010 21:20:21 +0000 (21:20 +0000)]
dev - Add kq support to psm

13 years agodev - Add kq support to dsp
Samuel J. Greear [Fri, 2 Jul 2010 20:53:54 +0000 (20:53 +0000)]
dev - Add kq support to dsp

13 years agounmount - fix issue with process refs on unmount
Alex Hornung [Fri, 2 Jul 2010 20:29:17 +0000 (21:29 +0100)]
unmount - fix issue with process refs on unmount

* The p_textnch introduction made this issue appear, as some processes
  are still alive at system shutdown and their p_textnch were holding
  these references to the mount nch.

* On unmount of a filesystem we now scan all active processes for procs
  whose p_textnch is related to the mountpoint we are getting rid of,
  and release these.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1708
Special-Thanks-To: Antonio Huete (tuxillo@) for identifying the
offending commit and extensive testing

13 years agomkinitrd.8: Remove some trailing whitespace.
Sascha Wildner [Fri, 2 Jul 2010 20:37:22 +0000 (22:37 +0200)]
mkinitrd.8: Remove some trailing whitespace.

13 years agokernel - Add kq support to devctl
Samuel J. Greear [Fri, 2 Jul 2010 18:23:10 +0000 (18:23 +0000)]
kernel - Add kq support to devctl

13 years agokernel - Add kq support to udev
Samuel J. Greear [Fri, 2 Jul 2010 18:01:57 +0000 (18:01 +0000)]
kernel - Add kq support to udev

13 years agoacpi - Add kqueue support to apm emulation device
Samuel J. Greear [Fri, 2 Jul 2010 17:22:26 +0000 (17:22 +0000)]
acpi - Add kqueue support to apm emulation device

13 years agokernel - Add kq support to tty devices
Samuel J. Greear [Fri, 2 Jul 2010 16:12:03 +0000 (16:12 +0000)]
kernel - Add kq support to tty devices

* This is all of the remaining tty devices missing kq support.

* vcons, dcons, sysmouse, pts, rp

13 years agoRemove opt_global.h inclusion, it is included by default.
Sascha Wildner [Thu, 1 Jul 2010 16:54:49 +0000 (18:54 +0200)]
Remove opt_global.h inclusion, it is included by default.

13 years agoif_detach(): Fix unoptimized compilation without ALTQ in the config.
Sascha Wildner [Thu, 1 Jul 2010 16:51:26 +0000 (18:51 +0200)]
if_detach(): Fix unoptimized compilation without ALTQ in the config.

altq_disable() and altq_detach() aren't available until ALTQ is configured
and compilation with -O0 failed linking.

$deity knows why this worked when building optimized (our default).

13 years agomkinitrd.8: Remove empty line.
Sascha Wildner [Thu, 1 Jul 2010 16:03:08 +0000 (18:03 +0200)]
mkinitrd.8: Remove empty line.

13 years agomkinitrd(8): Miscellaneous permission related clean up.
Sascha Wildner [Thu, 1 Jul 2010 15:24:48 +0000 (17:24 +0200)]
mkinitrd(8): Miscellaneous permission related clean up.

Also, rename mkinitrd -> mkinitrd.sh in src/ so it is easy to recognize
as a script. Our build infrastructure will handle installing it without
the suffix.

13 years agoRegenerate the pciconf(8) database
Sascha Wildner [Thu, 1 Jul 2010 14:17:36 +0000 (16:17 +0200)]
Regenerate the pciconf(8) database

...from the following files:

Hart:    Jan 22, 2008 (version 671)
Boemler: Jul  1, 2010
Mares:   Jun  1, 2010

13 years agomath.h: Convert HUGE_VALL to constant, from const-qualified var
Stathis Kamperis [Wed, 30 Jun 2010 20:56:06 +0000 (23:56 +0300)]
math.h: Convert HUGE_VALL to constant, from const-qualified var

Define HUGE_VALL via a compiler builtin. If the compiler doesn't
support it, we just fallback to previous situation. Both gcc and
clang play well with it.

This patch allows us to:
1. use HUGE_VALL as initializer element for objects with static
   storage duration
2. not worry about the format of long double (e.g., 96bit vs 128bit)
3. not worry about things like endianness

Briefly-discussed-with: corecode@, swildner@, but put the blame on me
if I broke something for you.

Special-thanks-to: swildner@ for checking code with clang.

P.S. HUGE_VAL{,F} already do the right thing.

13 years agomkinitrd - add tool and infrastructure for initrd
Alex Hornung [Sun, 27 Jun 2010 00:51:13 +0000 (01:51 +0100)]
mkinitrd - add tool and infrastructure for initrd

* Add the tool and necessary infrastructure to be able to easily build
  initial ramdisks.

13 years agokernel - Make returned pollfd's more conformant with legacy poll
Samuel J. Greear [Tue, 29 Jun 2010 23:47:53 +0000 (23:47 +0000)]
kernel - Make returned pollfd's more conformant with legacy poll

* Do not set ready states in revents if an error condition is present

* Mask out file descriptors with a descriptor id equalling -1

13 years agokernel - Introduce a local marker to kqueue_scan()
Samuel J. Greear [Tue, 29 Jun 2010 21:53:59 +0000 (21:53 +0000)]
kernel - Introduce a local marker to kqueue_scan()

* The local marker in kqueue_scan() allows multiple threads to operate on a kq
  at once by leap-frogging each others markers.

13 years agokernel - refactor main kqueue event loop
Samuel J. Greear [Mon, 28 Jun 2010 18:03:14 +0000 (18:03 +0000)]
kernel - refactor main kqueue event loop

* seperate the sleep and scan functionality into discrete functions

* pull all of the important logic (management of the list marker, the call
  to kqueue_sleep()) directly into kern_event()

13 years agonet - Add kqueue read support to tun device
Samuel J. Greear [Mon, 28 Jun 2010 16:26:22 +0000 (16:26 +0000)]
net - Add kqueue read support to tun device

13 years agonet - Add kqueue read support to bpf device
Samuel J. Greear [Sun, 27 Jun 2010 03:04:27 +0000 (03:04 +0000)]
net - Add kqueue read support to bpf device

13 years agotests - select that returns many writers
Samuel J. Greear [Sun, 27 Jun 2010 01:32:48 +0000 (01:32 +0000)]
tests - select that returns many writers

* This is modeled after the main/many_events test found in libevent2.

13 years agolinux - Bring epoll in sync with kqueue changes
Samuel J. Greear [Sat, 26 Jun 2010 21:18:41 +0000 (21:18 +0000)]
linux - Bring epoll in sync with kqueue changes

* Fix a bug related to the timeout calculation, it was calculating for
  microseconds, not milliseconds + typo.

* Successfully handle the copyout success case in copyout handler

13 years agokernel - kqueue - Bug fixing pass
Matthew Dillon [Sat, 26 Jun 2010 21:02:36 +0000 (14:02 -0700)]
kernel - kqueue - Bug fixing pass

* We cannot terminate the loop when events are received if all the
  events are spurious (none were collected by the copyout).

* Move the WOULDBLOCK -> 0 handling out of kqueue_scan() and into
  kern_kevent().

* Preset (*errorp) to 0 so it is set definitively for all cases, including
  degenerate cases.

* Allow an infinite number of events when doselect() calls kern_kevent()
  to avoid premature termination on successive calls which could occur
  due to spurious events.

* Fix a bug in dopoll() where the bytes variable was calculated prior to
  the truncation of nfds.

* Fix copyin/copyout arguments.

* Add missing rel_mplock() in pipe_kqfilter()

13 years agokernel - Implement poll(2) in terms of kevent
Samuel J. Greear [Fri, 25 Jun 2010 01:03:22 +0000 (01:03 +0000)]
kernel - Implement poll(2) in terms of kevent

13 years agokernel - KQueue: Create EVFILT_EXCEPT for exceptional conditions
Samuel J. Greear [Thu, 24 Jun 2010 07:45:58 +0000 (07:45 +0000)]
kernel - KQueue: Create EVFILT_EXCEPT for exceptional conditions

 * Move the handling of out-of-band data (NOTE_OOB) under EVFILT_EXCEPT. This
simplifies the select implementation and makes room for additional exceptional
conditions to be added in the future.

13 years agokernel - kqueue select support
Matthew Dillon [Wed, 23 Jun 2010 04:59:29 +0000 (21:59 -0700)]
kernel - kqueue select support

* Fix bug in kevent timeout handling.  Only go to non-blocking once
  (*res) is non-zero.

* Use stack-declared kfd_set structures for select operations on
  64 or fewer descriptors.

* Refactor the select_copyin() loop.

* Fix bug in serial number decoding in the select_copyout() loop.

* Do not use EV_CLEAR, this can cause temporary EOF conditions to
  reset improperly.  Do not use EV_ONESHOT either.  Leave the event
  in the kqueue, it will speed things up when select() is called in
  a loop (the events will already exist).

* Implement ptckqfilter ... implement kqfilter functions for pty's and
  ptc's instead of using the tty kqfilter functions which do not work
  properly for ptc control terminals.

* Change getbits/putbits from macros to inline functions.

13 years agokernel - Add kqueue read support to memio devices
Samuel J. Greear [Tue, 15 Jun 2010 16:13:45 +0000 (16:13 +0000)]
kernel - Add kqueue read support to memio devices

 memio devices: mem, kmem, null, random, urandom, zero, io

13 years agokernel - Add kqueue to log device (/dev/klog)
Samuel J. Greear [Tue, 15 Jun 2010 16:44:44 +0000 (16:44 +0000)]
kernel - Add kqueue to log device (/dev/klog)

13 years agodevfs - KQ filter ops are expected to return 0 or 1
Samuel J. Greear [Mon, 14 Jun 2010 13:26:04 +0000 (13:26 +0000)]
devfs - KQ filter ops are expected to return 0 or 1

13 years agotest - Add OOB tests for select and kqueue
Samuel J. Greear [Sun, 13 Jun 2010 13:48:20 +0000 (13:48 +0000)]
test - Add OOB tests for select and kqueue

13 years agokernel - Add OOB support to kqueue
Samuel J. Greear [Fri, 11 Jun 2010 08:13:53 +0000 (08:13 +0000)]
kernel - Add OOB support to kqueue

Adds the ability to be notified of out-of-band data on a socket to
kqueue by specifying NOTE_OOB in the fflags of a kevent.

13 years agoImplement select(2) in terms of kevent
Samuel J. Greear [Fri, 4 Jun 2010 23:13:25 +0000 (23:13 +0000)]
Implement select(2) in terms of kevent

13 years agokernel - remove pmap_interlock debugging
Matthew Dillon [Tue, 29 Jun 2010 00:39:09 +0000 (17:39 -0700)]
kernel - remove pmap_interlock debugging

* Remove the pmap_interlock debugging kprintf()s

13 years agoLog frequency changes via syslog(3) from powerd(8) instead from acpi(4).
Sascha Wildner [Tue, 29 Jun 2010 00:22:20 +0000 (02:22 +0200)]
Log frequency changes via syslog(3) from powerd(8) instead from acpi(4).

This avoids cluttering of the console with 'set pstate' messages on
verbosely booted systems when powerd(8) runs.

13 years agopowerd.8: Add missing .El
Sascha Wildner [Mon, 28 Jun 2010 23:26:57 +0000 (01:26 +0200)]
powerd.8: Add missing .El

13 years agopowerd.8: Clean up the manual page a bit.
Sascha Wildner [Mon, 28 Jun 2010 23:18:27 +0000 (01:18 +0200)]
powerd.8: Clean up the manual page a bit.

13 years agopowerd(8): Add an rc script etc.
Sascha Wildner [Mon, 28 Jun 2010 23:00:02 +0000 (01:00 +0200)]
powerd(8): Add an rc script etc.

13 years agoHook powerd(8) into the build.
Sascha Wildner [Mon, 28 Jun 2010 22:22:00 +0000 (00:22 +0200)]
Hook powerd(8) into the build.