Commit Graph

66 Commits

Author SHA1 Message Date
uebayasi
bffc20a6b1 dmover(4) really uses uvm(9). (Wasn't revealed by i386/ALL...) 2010-11-13 14:08:20 +00:00
uebayasi
8184d5dc03 Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants.  These are provided by sys/param.h now.
2010-11-13 13:51:57 +00:00
dsl
2a54322c7b If a multithreaded app closes an fd while another thread is blocked in
read/write/accept, then the expectation is that the blocked thread will
exit and the close complete.
Since only one fd is affected, but many fd can refer to the same file,
the close code can only request the fs code unblock with ERESTART.
Fixed for pipes and sockets, ERESTART will only be generated after such
a close - so there should be no change for other programs.
Also rename fo_abort() to fo_restart() (this used to be fo_drain()).
Fixes PR/26567
2009-12-20 09:36:05 +00:00
dsl
7a42c833db Rename fo_drain() to fo_abort(), 'drain' is used to mean 'wait for output
do drain' in many places, whereas fo_drain() was called in order to force
blocking read()/write() etc calls to return to userspace so that a close()
call from a different thread can complete.
In the sockets code comment out the broken code in the inner function,
it was being called from compat code.
2009-12-09 21:32:58 +00:00
nonaka
a6a538b335 compile again. 2009-05-01 00:15:57 +00:00
christos
86ba58fd64 Fix locking as Andy explained. Also fill in uid and gid like sys_pipe did. 2009-04-11 23:05:26 +00:00
christos
b859fbe7cb Fix PR/37878 and PR/37550: Provide stat(2) for all devices and don't use
fbadop_stat.
2009-04-11 15:47:33 +00:00
ad
c6367674d6 Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0	accept(fd, ...)
thr1	close(fd)
2009-04-04 10:12:51 +00:00
ad
c496ce1a99 Update dmover fileops to compile again. From he@. 2008-03-26 13:33:58 +00:00
rmind
c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
matt
acb0b175a3 Add #include <sys/simplelock.h> 2008-01-05 02:47:03 +00:00
ad
0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
ad
598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
he
5f195f5b4e Ensure that the 'pc' local variable is initialized, so that this builds again. 2007-11-12 15:50:21 +00:00
dogcow
c067a1b95c pesky missing semicolons. 2007-11-08 07:53:11 +00:00
ad
54221c3e0f - Make it compile again.
- Don't call pool_cache_init with a held simplelock.
2007-11-07 14:04:27 +00:00
ad
d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
ad
46ed8f7d77 Use the softint API. 2007-10-08 16:18:02 +00:00
ad
1934283e4a Use selinit() / seldestroy(). 2007-09-25 14:04:07 +00:00
rmind
20bbb87e34 Implementation of per-CPU work-queues support for workqueue(9) interface.
WQ_PERCPU flag for workqueue and additional argument for workqueue_enqueue()
to assign a CPU might be used. Notes:
 - For now, the list is used for workqueue_queue, which is non-optimal,
   and will be changed with array, where index would be CPU ID.
 - The data structures should be changed to be cache-friendly.

Reviewed by: <yamt>, <tech-kern>
2007-07-12 20:39:56 +00:00
he
cdcf88b05c Make a minimal adaption to the new kthread_create() signature
by renaming swdmover_proc to swdmover_lwp, and pass in
&swdmover_backend as an argument to be used by the kthread.
Reviewed by ad@.
2007-07-12 14:15:55 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
ad
3bf254230f Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 19:56:19 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
cube
4cdd8aada6 Complete initializers so those files compile. 2007-01-13 18:42:45 +00:00
yamt
8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
ad
76274213ea Correct first arg to falloc(). 2006-07-28 08:51:05 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
yamt
ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
yamt
d91bf59ce6 dmoverioopen: add a missing simple_lock_init(). 2006-01-17 12:10:51 +00:00
perry
93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
perry
f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
christos
be3704c73f pass the flag to fdclone. 2005-02-12 23:14:03 +00:00
he
d1b8269758 Correct a typo: it's fnullop_kqfilter and not fnullop_kqueue. 2004-12-05 22:42:27 +00:00
christos
31c81b28f5 Cloning cleanup:
1. make fileops const
2. add 2 new negative errno's to `officially' support the cloning hack:
    - EDUPFD (used to overload ENODEV)
    - EMOVEFD (used to overload ENXIO)
3. Created an fdclone() function to encapsulate the operations needed for
   EMOVEFD, and made all cloners use it.
4. Centralize the local noop/badop fileops functions to:
   fnullop_fcntl, fnullop_poll, fnullop_kqfilter, fbadop_stat
2004-11-30 04:25:43 +00:00
thorpej
29671d6616 Fix the fcntl entry points; cmd is a command, not the flags themselves.
Pointed out by Christos (he wrote the broken code originally, and I copied
it to another file later :-)
2004-11-28 07:44:05 +00:00
briggs
9082432644 Go ahead and define xor function names up to xor16. 2003-11-07 22:04:59 +00:00
briggs
cad1dd99c8 Fix another used-before-initialized bug that gcc uncovered. 2003-11-07 22:04:13 +00:00
jdolecek
a034152027 move dupfd from struct proc to struct lwp - it's per-LWP, not per-process; we
use curlwp where the lwp is not directly available, i.e. in device open
routines

briefly discussed on tech-kern
2003-09-13 08:32:10 +00:00
briggs
6d7027eec6 Add support for xor2-xor8 to swdmover. 2003-07-25 13:59:09 +00:00
thorpej
b41675bcc3 Add a software implementation of the iSCSI CRC32C algorithm. This
serves as an example of how the immediate value can be used by a
dmover function.
2003-07-19 02:05:35 +00:00
thorpej
a2a587d698 Add a well-known dmover function name for the CRC32C used by the iSCSI
protocol.
2003-07-19 02:03:11 +00:00
thorpej
5f35784b8a Add immediate value support for dmoverio transactions. 2003-07-19 02:00:18 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
thorpej
792ce8fe0d Fix typo in previous. 2003-06-14 19:03:40 +00:00
thorpej
d0e1416b29 Separate out the immediate value from the input buffer. The immediate
value field can now always be used as an input, and output, or both.

This is especially handy for data movers which can e.g. calculate the
CRC32C of a buffer as it is moved (which requires both a seed [input],
and a place to stash the result [output]).
2003-06-12 17:20:43 +00:00
scw
58c736d46f In dmio_read(), make sure to set DMIO_STATE_READ_WAIT in ds->ds_flags
before going to sleep.
2003-05-30 11:37:47 +00:00
briggs
4c104c6cea In dmover_backend_alloc(), make sure we get ninputs from the best_algdesc,
not just the most recent algdesc (which might be NULL).
2003-04-26 04:44:18 +00:00