jhb [Fri, 9 Feb 2001 17:46:35 +0000 (17:46 +0000)]
- Catch up to the new swi API changes:
- Use swi_* function names.
- Use void * to hold cookies to handlers instead of struct intrhand *.
- In sio.c, use 'driver_name' instead of "sio" as the name of the driver
lock to minimize diffs with cy(4).
jhb [Fri, 9 Feb 2001 17:42:43 +0000 (17:42 +0000)]
- Move struct ithd to sys/interrupt.h.
- Add a set of MI helper functions for interrupt threads:
- ithread_create() creates a new interrupt thread
- ithread_destroy() destroys an interrupt thread
- ithread_add_handler() attaches a new handler to an interrupt thread
- ithread_remove_handler() detaches a handler from an interrupt thread
- Rename sinthand_add() and sched_swi() to swi_add() and swi_sched()
respectively so that they live in a consistent namespace.
- struct intrhand is no longer a public type. It would be private to
kern_intr.c but the current implementation of fast interrupts on the
alpha requires the type to be exported. However, all handlers should
be treated as void * cookies in the way that new-bus treats them. This
includes references to software interrupt handlers.
jhb [Fri, 9 Feb 2001 17:35:22 +0000 (17:35 +0000)]
Axe INTR_HEAVY, INTR_LIGHT, and INTR_THREADED. Add in a INTR_TYPE_CLK
priorirty for clock interrupt handlers and an INTR_ENTROPY flag to mark
interrupt sources that are good sources of entropy.
jhb [Fri, 9 Feb 2001 16:43:18 +0000 (16:43 +0000)]
Release the proc lock around crfree() and uifree() in wait1(). It leads to
a lock order violation, and since p is already a zombie at this point,
I'm not sure that we even need all the locking currently in wait1().
joerg [Fri, 9 Feb 2001 16:33:53 +0000 (16:33 +0000)]
Unbreak EISA. The PCI-EISA bridge bus is named `eisab', not `isab'.
This mistake seems to have been benign until very recently, probably
until msmith's PCI code reshuffle which cleaned up a lot of things.
Still, my AIC7770 doesn't work again, but it at least probes the
EISA bus now.
jhb [Fri, 9 Feb 2001 15:19:41 +0000 (15:19 +0000)]
- Change the 'witness_list' ddb command to 'show mutexes'. Note that this
will only display sleep mutexes held by the current process.
- Clean up some nits in the witness_display() function and add a ddb
command 'show witness' that dumps the hierarchy and order lists to the
console.
- Use queue(3) macros where appropriate.
- Resort the spin lock order list so that "com" is before "sched_lock".
Also, add appropriate #ifdef's around SMP and i386-specific mutexes.
- Add two new mutexes used to protect the ithread lists and tables to the
order list.
jhb [Fri, 9 Feb 2001 15:07:30 +0000 (15:07 +0000)]
Change the ktr ddb commands to be show commands. The commands are now as
follows:
- show ktr_first display the first entry
- show ktr_next display the next entry
- show ktr display the entire buffer
The /v modifiers continue to work as described previously.
jhb [Fri, 9 Feb 2001 14:59:43 +0000 (14:59 +0000)]
- Point out that we don't lock anything during the idle setup because
only the boot processor should be running in the comments.
- Initialize curproc to point to each CPU's respective idleproc if their
curproc is NULL.
- Keep track of the number of context switches performed by idleproc.
iedowse [Fri, 9 Feb 2001 13:24:06 +0000 (13:24 +0000)]
Fix some problems that were introduced in revision 1.97. Instead
of returning an error code to the caller, NFS server op routines
must themselves build an error reply and return 0 to the caller.
This is achieved by replacing the erroneous return statements with
code that jumps forward to the op function's reply code. We need
to be careful to ensure that the 'struct mount' pointer is NULL
though, so that the final vn_finished_write() call becomes a no-op.
nectar [Fri, 9 Feb 2001 13:21:50 +0000 (13:21 +0000)]
Fix login so that it exports environmental variables that are set by PAM
modules (via pam_putenv). The following variables will never be set in
this fashion:
SHELL, HOME, LOGNAME, MAIL, CDPATH, IFS, PATH
any variable starting with `LD_'
bmilekic [Fri, 9 Feb 2001 06:11:45 +0000 (06:11 +0000)]
Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:
mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)
similarily, for releasing a lock, we now have:
mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.
The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.
Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:
MTX_QUIET and MTX_NOSWITCH
The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:
mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.
Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.
Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.
Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.
Finally, caught up to the interface changes in all sys code.
Contributors: jake, jhb, jasone (in no particular order)
wpaul [Fri, 9 Feb 2001 00:45:29 +0000 (00:45 +0000)]
Apply patch to add support for the intergrated ethernet in the SiS630E
chipset. The MAC address is stored in the APC CMOS RAM and we have to
commit trememdous evil in order to read it. The code to do this is only
activated on the i386 platform. Thanks to Cameron Grant for providing
access to a test box for me to tinker with.
This will fix the problem where the sis driver ends up with a station
address of 00:00:00:00:00:00 on boards that use the 630E chipset.
luigi [Thu, 8 Feb 2001 22:54:57 +0000 (22:54 +0000)]
Whoops... forgotten a few pieces in previous patch:
* a ">" is really ">=" ;
* do not try to fetch zero-sized blocks from the card;
* make sure that bpf gets the packets it wants even with
bridging active;
tegge [Thu, 8 Feb 2001 20:22:28 +0000 (20:22 +0000)]
Protect freelists managed by Balloc/Bfree with a spinlock.
Change __dtoa to not free the string it allocated the previous time it was
called. The caller now frees the string after usage if appropiate.
archie [Thu, 8 Feb 2001 17:56:49 +0000 (17:56 +0000)]
When we receive an incoming Ethernet frame that was unicast to a
different hardware address, we should drop it (this should only
happen in promiscuous mode). Relocate the code for this check
from before ng_ether(4) processing to after ng_ether(4) processing.
Also fix a compiler warning.
sobomax [Thu, 8 Feb 2001 17:44:00 +0000 (17:44 +0000)]
- By default treat supplied arguments as a shell globs to be matched against
names of installed packages;
- add new `-G' option to disable glob matching and revert to previous
behaviour (I have no idea why this could be necessary, though);
- add a new `-x' option, which instructs pkg_info(1) to treat supplied
arguments as a regular expressions.
For example:
$ pkg_info foo\* - displays information about all packages whose names start
from foo
$ pkg_info -G foo\*-1.1 - displays information about package named "foo*-1.1"
$ pkg_info -x ^foo.\* - displays information about all packages whose names
start from foo
Original idea submitted by: Edwin Groothuis <mavetju@chello.nl> (bin/24695)
Reviewed by: jkh, roam
Approved by: jkh
phantom [Thu, 8 Feb 2001 17:33:19 +0000 (17:33 +0000)]
Add sources for following categories: LC_NUMERIC (share/numericdef),
LC_MONETARY (share/monetdef), LC_MESSAGES (share/msgdef). Now only
en_US.ISO_8859-1 and ru_RU.KOI8-R locales ready. I will find some time
in near future and'll try to make defintions for other locales.
phantom [Thu, 8 Feb 2001 16:58:53 +0000 (16:58 +0000)]
Make FreeBSD locale support complete: add support for rest locale categories
LC_MONETARY, LC_NUMERIC and LC_MESSAGES. Remove stub functions since they
don't need anymore.
as part of this cleanup I have changed all K&R declarations to ANSI style.
Main reason for doing that was great mix of declarations used here - clean
ASNI , clean K&R, ifdef'ed (both).
mikeh [Thu, 8 Feb 2001 05:33:19 +0000 (05:33 +0000)]
Prevent string overflows by using safer string functions
Use tolower() rather than bit or-ing
Sanity check user specified printf() format
Exit when too many input files are given
Remove register from variables
jhb [Thu, 8 Feb 2001 00:27:38 +0000 (00:27 +0000)]
Don't bother with acquiring/releasing Giant around kmem_malloc() and
kmem_free() for now. Kmem_malloc() and kmem_free() now have appropriate
assertions in place, and these checks aren't feasible until more of the
networking code is locked down. Also, the extra assertions here should
already be caught by the WITNESS code as lock order violations should
mutex operations on Giant be reintroduced here later.
jhb [Thu, 8 Feb 2001 00:10:07 +0000 (00:10 +0000)]
Don't enable interrupts for a kernel breakpoint or trace trap. Otherwise,
this negates the explicit disabling of interrupts when entering the
debugger in Debugger().
jhb [Thu, 8 Feb 2001 00:00:12 +0000 (00:00 +0000)]
- Check if the ccb_infos in the softc is NULL before trying to free it in
adv_free() as the ISA probe routine doesn't malloc() ccb_infos but does
call adv_free().
- Release the ISA-only overrun DMA tags, bufs, and maps if the probe fails.
peter [Wed, 7 Feb 2001 23:28:01 +0000 (23:28 +0000)]
The code I picked up from NetBSD in '97 had a nasty bug. It limited
the index of the pollfd array to the number of fd's currently open, not
the maximum number of fd's. ie: if you had 0,1,2 open, you could not
use pollfd slots higher than 20. The specs say we only have to support
OPEN_MAX [64] entries but we allow way more than that.
jhb [Wed, 7 Feb 2001 22:41:47 +0000 (22:41 +0000)]
When SMPng was first committed, we removed 'cpl' from the interrupt
frame. Teach ddb about this as there is one less word for it to skip
over when finding a trapframe on the interrupt frame stack.
1. Disable hyphenation on a dash (`-') character in macro arguments.
2. Disable recognition of end-of-sentence characters in text-type
macro arguments.
3. Fix the missing space bug when an end-of-sentence character was
followed by another punctuation character.
4. Fix the bug where hyphenation was left disabled after .Re.
mdoc(7) police: replace two -unfilled displays with -tag lists.
This works only because of bugs in current implementation: the
first .It after ``.Bd -unfilled'' re-enables filling mode and
does not restore (disable) it back afterwards.