Commit Graph

35 Commits

Author SHA1 Message Date
jlemon
51a6be83c4 Use new kernel_sysctlbyname function. Remove private copy. 2001-05-19 05:48:07 +00:00
jhb
52943e84fd Include sys/lock.h and sys/mutex.h so that this compiles. 2001-05-15 22:02:46 +00:00
tanimura
e060357fff Back out scanning file descriptors with holding a process lock.
selrecord() requires allproc sx in pfind(), resulting in lock order
reversal between allproc and a process lock.
2001-05-15 10:19:57 +00:00
tanimura
5a0e2818dd - Convert msleep(9) in select(2) and poll(2) to cv_*wait*(9).
- Since polling should not involve sleeping, keep holding a
  process lock upon scanning file descriptors.

- Hold a reference to every file descriptor prior to entering
  polling loop in order to avoid lock order reversal between
  lockmgr and p_mtx upon calling fdrop() in fo_poll().
  (NOTE: this work has not been done for netncp and netsmb
  yet because a socket itself has no reference counts.)

Reviewed by:	jhb
2001-05-14 05:26:48 +00:00
markm
6ec52cf8be Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)
2001-05-01 08:13:21 +00:00
bp
5757b7eae6 Move bindery authentication ncps to ncp_ncp.c file. ncp_login.c will stay
empty for a while.
2001-03-22 10:38:16 +00:00
bp
dabf271c01 Properly set flags on the broken connection. 2001-03-22 10:29:39 +00:00
bp
42fd3e99f0 Major update of NCP requester:
Use mchain API to work with mbuf chains.

Do not depend on INET and IPX options.

Allocate ncp_rq structure dynamically to prevent possible stack overflows.

Let ncp_request() dispose control structure if request failed.

Move all NCP wrappers to ncp_ncp.c file and all NCP request processing
functions to ncp_rq.c file.

Improve reconnection logic.

Misc style fixes.
2001-03-10 05:24:45 +00:00
bp
bb6cd2b48a Specify packing for an entire structure, not for each element of it. 2001-03-10 05:06:29 +00:00
bmilekic
fd2da3a771 Implement m_getm() which will perform an "all or nothing" mbuf + cluster
allocation, as required.

If m_getm() receives NULL as a first argument, then it allocates `len'
(second argument) bytes worth of mbufs + clusters and returns the chain
only if it was able to allocate everything.
If the first argument is non-NULL, then it should be an existing mbuf
chain (e.g. pre-allocated mbuf sitting on a ring, on some list, etc.) and
so it will allocate `len' bytes worth of clusters and mbufs, as needed,
and append them to the tail of the passed in chain, only if it was able
to allocate everything requested.

If allocation fails, only what was allocated by the routine will be freed,
and NULL will be returned.

Also, get rid of existing m_getm() in netncp code and replace calls to it
to calls to this new generic code.

Heavily Reviewed by: bp
2001-02-14 05:13:04 +00:00
phk
8363061cc7 Mechanical change to use <sys/queue.h> macro API instead of
fondling implementation details.

Created with: sed(1)
Reviewed by: md5(1)
2001-02-04 13:13:25 +00:00
bp
c87934520b Common option '-N' do not require an argument. 2001-01-07 07:03:59 +00:00
bmilekic
4c48d530e1 * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.
This is because calls with M_WAIT (now M_TRYWAIT) may not wait
  forever when nothing is available for allocation, and may end up
  returning NULL. Hopefully we now communicate more of the right thing
  to developers and make it very clear that it's necessary to check whether
  calls with M_(TRY)WAIT also resulted in a failed allocation.
  M_TRYWAIT basically means "try harder, block if necessary, but don't
  necessarily wait forever." The time spent blocking is tunable with
  the kern.ipc.mbuf_wait sysctl.
  M_WAIT is now deprecated but still defined for the next little while.

* Fix a typo in a comment in mbuf.h

* Fix some code that was actually passing the mbuf subsystem's M_WAIT to
  malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the
  value of the M_WAIT flag, this could have became a big problem.
2000-12-21 21:44:31 +00:00
dwmalone
da98718eb6 Make malloc use M_ZERO in some more locations.
Don't check for a null pointer if malloc called with M_WAITOK.

Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Approved by:	bp
2000-10-29 16:14:28 +00:00
phk
05fcfd3993 Remove unneeded #include <sys/proc.h> lines. 2000-10-29 13:57:19 +00:00
jasone
46ca3ece23 Convert lockmgr locks from using simple locks to using mutexes.
Add lockdestroy() and appropriate invocations, which corresponds to
lockinit() and must be called to clean up after a lockmgr lock is no
longer needed.
2000-10-04 01:29:17 +00:00
bp
8be0b0e412 Remove duplicate SYSCTL_NODE() declaration. Kernel linker can't deal
with it well.
2000-10-02 09:10:22 +00:00
phk
29e5a8dc50 Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.
Pointed out by:	bde
2000-07-04 11:25:35 +00:00
phk
b09ca1a9bb Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:
Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

        -sysctl_vm_zone SYSCTL_HANDLER_ARGS
        +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
2000-07-03 09:35:31 +00:00
jake
5e208b0c18 Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
jake
1d685644e0 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
peter
a522921e3a nwfs depends on ncp 2000-04-29 13:34:28 +00:00
bp
954796bd50 Do not panic if request issued by kernel.
Reported by:	Vladimir Poliakov <vnp@mail.kccm.ru>
2000-04-05 10:54:02 +00:00
bp
2e1ed2a14a Enable '=' character in the filename.
Submitted by:	Dan Nelson <dnelson@emsphone.com>
2000-01-29 02:10:37 +00:00
bde
6aebd70213 Forward declare some structs so that this header is more self-suifficent. 2000-01-14 19:54:42 +00:00
peter
a5782dd663 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
bp
1b628f3833 Update to version 1.3.4 of ncplib. Cleanup header files. 1999-12-12 05:50:07 +00:00
archie
7db89ff8e4 Change structure field named 'toupper' to 'to_upper' to avoid conflict
with the macro of the same name.  Same thing for 'tolower'.
1999-11-02 22:46:42 +00:00
bp
e50d111feb Bump internal version number with next release of ncplib. 1999-10-31 15:01:47 +00:00
bp
2a2e1c0de0 Add support for C++ in the headers. Some style cleanup.
Pointed by:	bde
1999-10-31 03:39:03 +00:00
bp
473ddaa968 Add missing initialization which could lead to kernel panic. 1999-10-29 10:21:07 +00:00
bp
d0481cae52 Initial import of ncp library sources.
Reviewed by:	jdp, mdodd
1999-10-12 11:56:41 +00:00
bp
b354aa6e0e Remove unnessary includes. 1999-10-12 10:37:00 +00:00
bde
7e50c56ef8 Fixed "misspelling" of bcmp as memcmp. memcmp doesn't exist in the
kernel, but gcc provides a pessimal builtin for it.

Makefile.i386:
Added a variable (CONF_CFLAGS) for configuration-specific compiler flags.

LINT:
Use CONF_CFLAGS to inhibit use of gcc builtins.
1999-10-03 07:09:31 +00:00
bp
98e4371758 Import kernel part of ncplib: netncp and nwfs
Reviewed by:	msmith, peter
Obtained from:	ncplib
1999-10-02 04:06:24 +00:00