]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
19 years ago- Reduce the number of netgraph messages when listing
ru [Wed, 9 Feb 2005 16:17:33 +0000 (16:17 +0000)]
- Reduce the number of netgraph messages when listing
  nodes from (N + 1) to 1, where N is the number of
  nodes in the system.

- Implement "ls -l" which runs the "show" command for
  each node.

In collaboration with: glebius

19 years agoIn revision 1.29 timeout() was converted to ng_callout().
ru [Wed, 9 Feb 2005 15:14:44 +0000 (15:14 +0000)]
In revision 1.29 timeout() was converted to ng_callout().

The difference is that the callout function installed via the
ng_callout() method is guaranteed to NOT fire after the shutdown
method was run (when a node is marked NGF_INVALID).  Also, the
shutdown method and the callout function are guaranteed to NOT
run at the same time, as both require the writer lock.  Thus
we can safely ignore a zero return value from ng_uncallout()
(callout_stop()) in shutdown methods, and go on with freeing
the node.

The said revision broke the node shutdown -- ng_bridge_timeout()
is no longer fired after ng_bridge_shutdown() was run, resulting
in a memory leak, dead nodes, and inability to unload the module.
Fix this by cancelling the callout on shutdown, and moving part
responsible for freeing a node resources from ng_bridge_timer()
to ng_bridge_shutdown().

Noticed by: ru
Submitted by: glebius, ru

19 years agoWhile working on constification temporarily disable -Werror. Things are too
harti [Wed, 9 Feb 2005 13:22:02 +0000 (13:22 +0000)]
While working on constification temporarily disable -Werror. Things are too
twisted.

19 years agoUntangle VarFind and, while rewriting most of the function, fix the
harti [Wed, 9 Feb 2005 13:13:59 +0000 (13:13 +0000)]
Untangle VarFind and, while rewriting most of the function, fix the
intendation. (A large part of the function was already at intendation 8).

19 years agoProperly initialise the variable `deny'.
stefanf [Wed, 9 Feb 2005 13:02:43 +0000 (13:02 +0000)]
Properly initialise the variable `deny'.

19 years agostyle polishing.
phk [Wed, 9 Feb 2005 12:22:16 +0000 (12:22 +0000)]
style polishing.

19 years agoPass -C to rpcgen.
stefanf [Wed, 9 Feb 2005 12:17:52 +0000 (12:17 +0000)]
Pass -C to rpcgen.

19 years agoUse CFLAGS+=.
ru [Wed, 9 Feb 2005 11:50:43 +0000 (11:50 +0000)]
Use CFLAGS+=.

19 years agoRemove the messy locking dance around xpt_done()
scottl [Wed, 9 Feb 2005 11:50:16 +0000 (11:50 +0000)]
Remove the messy locking dance around xpt_done()

19 years agoProvide locking for the ccb_bioq. This allows xpt_done() to be called without
scottl [Wed, 9 Feb 2005 11:44:15 +0000 (11:44 +0000)]
Provide locking for the ccb_bioq.  This allows xpt_done() to be called without
Giant held.  In camisr(), move the ccb_bioq elements to a temporary local list
and then process the elements off of that list.  This enables the list to be
processed by only taking the ccb_bioq_lock once and only for a very short
time.

ccb_bioq_lock is a leaf mutex, so it's fine to call xpt_done() with other
locks held.  This is just a very minor step in the work to lock CAM, but
it allows us to avoid some messy locking/unlock dances in certain drivers.

19 years agoUse CFLAGS+=.
stefanf [Wed, 9 Feb 2005 10:35:28 +0000 (10:35 +0000)]
Use CFLAGS+=.

19 years agoIntroduce VarCreate and VarDestroy functions and used them where
harti [Wed, 9 Feb 2005 09:53:28 +0000 (09:53 +0000)]
Introduce VarCreate and VarDestroy functions and used them where
appropriate.

Submitted by: Max Okumoto <okumoto@ucsd.edu>

19 years agoInclude missing headers.
stefanf [Wed, 9 Feb 2005 09:13:36 +0000 (09:13 +0000)]
Include missing headers.

19 years agoFix the standalone module build.
obrien [Wed, 9 Feb 2005 08:35:24 +0000 (08:35 +0000)]
Fix the standalone module build.

19 years ago- Remove g_gate_hold()/g_gate_release() from start/done paths. It saves
pjd [Wed, 9 Feb 2005 08:29:39 +0000 (08:29 +0000)]
- Remove g_gate_hold()/g_gate_release() from start/done paths. It saves
  4 mutex operations per I/O requests.
- Use only one mutex to protect both (incoming and outgoing) queue.
  As MUTEX_PROFILING(9) shows, there is no big contention for this lock.
- Protect sc_queue_count with queue mutex, instead of doing atomic
  operations on it.
- Remove DROP_GIANT()/PICKUP_GIANT() - ggate is marked as MPSAFE and no
  Giant there.

19 years agoEmblish rev 1.180 to -fno-strict-alias w/-Os & -O3 also.
obrien [Wed, 9 Feb 2005 07:34:22 +0000 (07:34 +0000)]
Emblish rev 1.180 to -fno-strict-alias w/-Os & -O3 also.

19 years agoRemove DLINK_3, its unused. Remove NETGEAR FA410TX, since it is the
imp [Wed, 9 Feb 2005 06:16:27 +0000 (06:16 +0000)]
Remove DLINK_3, its unused.  Remove NETGEAR FA410TX, since it is the
same as the LINKSYS COMBO_ECARD (which also seems to be the same as
another linksys product that also has a modem, but I can't find that
one at the moment).  Remove the PCM100, since it is now no longer
used.

19 years agoo Remove duplicate LINKSYS ETHERFAST entry.
imp [Wed, 9 Feb 2005 06:03:36 +0000 (06:03 +0000)]
o Remove duplicate LINKSYS ETHERFAST entry.
o The COMBO_ECARD comes in many flavors, it seems, so probe both the DL10019
  and the AX88x90 on it.  Since this seems to work with no ill effects, maybe
  the probing should happen more generally rather than being table driven.
  Need to think more about this.
o Remove PCM100 because it is duplicative (the ETHERFAST is the pcm100 and
  apparently has the same IDs).  It was here for NetBSD because they match
  up an expected MAC address OID, but since we don't bother with that, we
  don't need to be so finely discriminating.
o Minor style nit.

19 years agoRemove reference to softc from probe entirely...
imp [Wed, 9 Feb 2005 05:55:54 +0000 (05:55 +0000)]
Remove reference to softc from probe entirely...

19 years agos/descr/oid_descr/
marcel [Wed, 9 Feb 2005 04:48:23 +0000 (04:48 +0000)]
s/descr/oid_descr/

19 years agoAdd missed merge of ripcbinfo extern. Given how widely used
rwatson [Wed, 9 Feb 2005 01:12:43 +0000 (01:12 +0000)]
Add missed merge of ripcbinfo extern.  Given how widely used
ripcbinfo is, we should probably add it to an include file.

Spotted by: mux

19 years agoMinor style cleanup. Get rid of extra {}, extra blank lines and some
imp [Wed, 9 Feb 2005 00:50:59 +0000 (00:50 +0000)]
Minor style cleanup.  Get rid of extra {}, extra blank lines and some
continued line indentation.  Should be no functional changes.

19 years agomove pmap.h after vm.h include... some of the headers from pmap.h depend
jmg [Wed, 9 Feb 2005 00:10:17 +0000 (00:10 +0000)]
move pmap.h after vm.h include...  some of the headers from pmap.h depend
upon vm.h

19 years agoo Remove ifdef PC98, since this file has diverged quite a bit from
imp [Wed, 9 Feb 2005 00:06:12 +0000 (00:06 +0000)]
o Remove ifdef PC98, since this file has diverged quite a bit from
  if_ed_isa.c, and they seem to not be helpful anymore.
o Fix style issues from de-Pification.
o change from _isa_ to _cbus_ to the largest extent possible to reflect that
  this is really for cbus, not isa.
o Use ANSI function definitions.
o Use ed_clear_memory
o eliminate kvtop

19 years agoNo need to bzero softc.
imp [Tue, 8 Feb 2005 23:58:38 +0000 (23:58 +0000)]
No need to bzero softc.

19 years agoConvenience function to clear memory of the card, and then check to make
imp [Tue, 8 Feb 2005 23:57:43 +0000 (23:57 +0000)]
Convenience function to clear memory of the card, and then check to make
sure that it works by reading back as 0.

19 years ago - Add a new assert in the getnewvnode(). Assert that the usecount is still
jeff [Tue, 8 Feb 2005 23:27:10 +0000 (23:27 +0000)]
 - Add a new assert in the getnewvnode().  Assert that the usecount is still
   0 to detect getnewvnode() races.
 - Add the vnode address to a few panics near by to help in debugging.

Sponsored by: Isilon Systems, Inc.

19 years ago - Remove an invalid KASSERT added in recent background write reshuffling.
jeff [Tue, 8 Feb 2005 23:25:08 +0000 (23:25 +0000)]
 - Remove an invalid KASSERT added in recent background write reshuffling.

Sponsored by: Isilon Systems, Inc.

19 years agoLock raw IP socket pcb list and PCBs when processing input via
rwatson [Tue, 8 Feb 2005 22:16:26 +0000 (22:16 +0000)]
Lock raw IP socket pcb list and PCBs when processing input via
icmp6_rip6_input().

Reviewed by: gnn
MFC after: 1 week

19 years ago- Add debug.watchdog tunable, so we can specify watchdog CPU from loader
pjd [Tue, 8 Feb 2005 22:15:24 +0000 (22:15 +0000)]
- Add debug.watchdog tunable, so we can specify watchdog CPU from loader
  which will help to debug hangs on boot.
- Remove 'U' from debug.watchdog sysctl definition, so if we set it to '-1'
  it really shows '-1'.
- Fix comment.

Reviewed by: rwatson

19 years agoAdd a new sysctl, "security.jail.chflags_allowed", which controls the
cperciva [Tue, 8 Feb 2005 21:31:11 +0000 (21:31 +0000)]
Add a new sysctl, "security.jail.chflags_allowed", which controls the
behaviour of chflags within a jail.  If set to 0 (the default), then a
jailed root user is treated as an unprivileged user; if set to 1, then
a jailed root user is treated the same as an unjailed root user.

This is necessary to allow "make installworld" to work inside a jail,
since it attempts to manipulate the system immutable flag on certain
files.

Discussed with: csjp, rwatson
MFC after: 2 weeks

19 years agoSplit the vop_vector for ffs1 and ffs2, this is mostly for the different
phk [Tue, 8 Feb 2005 21:03:52 +0000 (21:03 +0000)]
Split the vop_vector for ffs1 and ffs2, this is mostly for the different
EXTATTR support.

19 years agoUse ffs_truncate() directly instead of UFS_TRUNCATE()
phk [Tue, 8 Feb 2005 20:51:00 +0000 (20:51 +0000)]
Use ffs_truncate() directly instead of UFS_TRUNCATE()

19 years agoRemove type 0x4 (FAT12 <32MB) to make room for type 0x7 (NTFS).
des [Tue, 8 Feb 2005 20:43:04 +0000 (20:43 +0000)]
Remove type 0x4 (FAT12 <32MB) to make room for type 0x7 (NTFS).

19 years agoBackground writes are entirely an FFS/Softupdates thing.
phk [Tue, 8 Feb 2005 20:29:10 +0000 (20:29 +0000)]
Background writes are entirely an FFS/Softupdates thing.

Give FFS vnodes a specific bufwrite method which contains all the
background write stuff and then calls into the default bufwrite()
for the rest of the job.

Remove all the background write related stuff from the normal bufwrite.

This drags the softdep_move_dependencies() back into FFS.

Long term, it is worth looking at simply copying the data into
allocated memory and issuing the bio directly and not create the
"shadow buf" in the first place (just like copy-on-write is done
in snapshots for instance).  I don't think we really gain anything
but complexity from doing this with a buf.

19 years agoUse the local APIC timer to drive the various kernel clocks on SMP machines
jhb [Tue, 8 Feb 2005 20:25:07 +0000 (20:25 +0000)]
Use the local APIC timer to drive the various kernel clocks on SMP machines
rather than forwarding interrupts from the clock devices around using IPIs:
- Add an IDT vector that pushes a clock frame and calls
  lapic_handle_timer().
- Add functions to program the local APIC timer including setting the
  divisor, and setting up the timer to either down a periodic countdown
  or one-shot countdown.
- Add a lapic_setup_clock() function that the BSP calls from
  cpu_init_clocks() to setup the local APIC timer if it is going to be
  used.  The setup uses a one-shot countdown to calibrate the timer.  We
  then program the timer on each CPU to fire at a frequency of hz * 3.
  stathz is defined as freq / 23 (hz * 3 / 23), and profhz is defined as
  freq / 2 (hz * 3 / 2).  This gives the clocks relatively prime divisors
  while keeping a low LCM for the frequency of the clock interrupts.
  Thanks to Peter Jeremy for suggesting this approach.
- Remove the hardclock and statclock forwarding code including the two
  associated IPIs.  The bitmap IPI handler has now effectively degenerated
  to just IPI_AST.
- When the local APIC timer is used we don't turn the RTC on at all, but
  we still enable interrupts on the ISA timer 0 (i8254) for timecounting
  purposes.

19 years agoDocument EBUSY.
trhodes [Tue, 8 Feb 2005 20:16:59 +0000 (20:16 +0000)]
Document EBUSY.

PR: 73387
Submitted by: Thomas Ludwig <tludwig@smr.ch> (original version)

19 years agoAdd xrefs to crypt(3) and pw(8) and add a warning about not manually
trhodes [Tue, 8 Feb 2005 19:23:24 +0000 (19:23 +0000)]
Add xrefs to crypt(3) and pw(8) and add a warning about not manually
altering passwd related files.

PR:             74656
Submitted by:   Jilles Tjoelker <jilles@stack.nl> (original version)

19 years agoDrag another softupdates tentacle back into FFS: Now that FFS's
phk [Tue, 8 Feb 2005 18:09:11 +0000 (18:09 +0000)]
Drag another softupdates tentacle back into FFS:  Now that FFS's
vop_fsync is separate from the internal use we can do the full job
there.

19 years agoMaxunit is inclusive so fix off-by-one in previous commit.
njl [Tue, 8 Feb 2005 18:03:17 +0000 (18:03 +0000)]
Maxunit is inclusive so fix off-by-one in previous commit.

19 years agoUpdate device_find_child(9) to return the first matching child if unit
njl [Tue, 8 Feb 2005 18:00:29 +0000 (18:00 +0000)]
Update device_find_child(9) to return the first matching child if unit
is set to -1.

Reviewed by: dfr, imp

19 years agoSimplify the "and if we're in the debugger, don't use locks" logic,
rwatson [Tue, 8 Feb 2005 17:56:04 +0000 (17:56 +0000)]
Simplify the "and if we're in the debugger, don't use locks" logic,
correcting some misthinking.

Discussed with (really this time): bde

19 years agoAlso add the manpage entry for cpufreq.
njl [Tue, 8 Feb 2005 17:44:18 +0000 (17:44 +0000)]
Also add the manpage entry for cpufreq.

19 years agoAdd an initial manpage for the cpufreq framework and methods to help users
njl [Tue, 8 Feb 2005 17:43:35 +0000 (17:43 +0000)]
Add an initial manpage for the cpufreq framework and methods to help users
and developers who want to import new hardware drivers.  This could also
certainly use mdoc review.

19 years agoDon't use the UFS_* and VFS_* functions where a direct call is possble.
phk [Tue, 8 Feb 2005 17:40:01 +0000 (17:40 +0000)]
Don't use the UFS_* and VFS_* functions where a direct call is possble.

The UFS_ functions are for UFS to call back into VFS.  The VFS functions
are external entry points into the filesystem.

19 years ago(forced commit to record correct commit message)
phk [Tue, 8 Feb 2005 17:23:39 +0000 (17:23 +0000)]
(forced commit to record correct commit message)

Split ffs_fsync() into a VOP_FSYNC() component and an internal part
called ffs_syncvnode().

Eliminate unnecessary thread argument and XXX'ed curthread passes
for same.  Reduce softdep_sync_metadata() from a struct vop_fsync_args
to just the vnode argument it needs.

Convert internal VOP_FSYNC() calls to use ffs_syncvnode().

19 years agoNext step on the road to IRPs: create and use an imitation of the
wpaul [Tue, 8 Feb 2005 17:23:25 +0000 (17:23 +0000)]
Next step on the road to IRPs: create and use an imitation of the
Windows DRIVER_OBJECT and DEVICE_OBJECT mechanism so that we can
simulate driver stacking.

In Windows, each loaded driver image is attached to a DRIVER_OBJECT
structure. Windows uses the registry to match up a given vendor/device
ID combination with a corresponding DRIVER_OBJECT. When a driver image
is first loaded, its DriverEntry() routine is invoked, which sets up
the AddDevice() function pointer in the DRIVER_OBJECT and creates
a dispatch table (based on IRP major codes). When a Windows bus driver
detects a new device, it creates a Physical Device Object (PDO) for
it. This is a DEVICE_OBJECT structure, with semantics analagous to
that of a device_t in FreeBSD. The Windows PNP manager will invoke
the driver's AddDevice() function and pass it pointers to the DRIVER_OBJECT
and the PDO.

The AddDevice() function then creates a new DRIVER_OBJECT structure of
its own. This is known as the Functional Device Object (FDO) and
corresponds roughly to a private softc instance. The driver uses
IoAttachDeviceToDeviceStack() to add this device object to the
driver stack for this PDO. Subsequent drivers (called filter drivers
in Windows-speak) can be loaded which add themselves to the stack.
When someone issues an IRP to a device, it travel along the stack
passing through several possible filter drivers until it reaches
the functional driver (which actually knows how to talk to the hardware)
at which point it will be completed. This is how Windows achieves
driver layering.

Project Evil now simulates most of this. if_ndis now has a modevent
handler which will use MOD_LOAD and MOD_UNLOAD events to drive the
creation and destruction of DRIVER_OBJECTs. (The load event also
does the relocation/dynalinking of the image.) We don't have a registry,
so the DRIVER_OBJECTS are stored in a linked list for now. Eventually,
the list entry will contain the vendor/device ID list extracted from
the .INF file. When ndis_probe() is called and detectes a supported
device, it will create a PDO for the device instance and attach it
to the DRIVER_OBJECT just as in Windows. ndis_attach() will then call
our NdisAddDevice() handler to create the FDO. The NDIS miniport block
is now a device extension hung off the FDO, just as it is in Windows.
The miniport characteristics table is now an extension hung off the
DRIVER_OBJECT as well (the characteristics are the same for all devices
handled by a given driver, so they don't need to be per-instance.)
We also do an IoAttachDeviceToDeviceStack() to put the FDO on the
stack for the PDO. There are a couple of fake bus drivers created
for the PCI and pccard buses. Eventually, there will be one for USB,
which will actually accept USB IRP.s

Things should still work just as before, only now we do things in
the proper order and maintain the correct framework to support passing
IRPs between drivers.

Various changes:

- corrected the comments about IRQL handling in subr_hal.c to more
  accurately reflect reality
- update ndiscvt to make the drv_data symbol in ndis_driver_data.h a
  global so that if_ndis_pci.o and/or if_ndis_pccard.o can see it.
- Obtain the softc pointer from the miniport block by referencing
  the PDO rather than a private pointer of our own (nmb_ifp is no
  longer used)
- implement IoAttachDeviceToDeviceStack(), IoDetachDevice(),
  IoGetAttachedDevice(), IoAllocateDriverObjectExtension(),
  IoGetDriverObjectExtension(), IoCreateDevice(), IoDeleteDevice(),
  IoAllocateIrp(), IoReuseIrp(), IoMakeAssociatedIrp(), IoFreeIrp(),
  IoInitializeIrp()
- fix a few mistakes in the driver_object and device_object definitions
- add a new module, kern_windrv.c, to handle the driver registration
  and relocation/dynalinkign duties (which don't really belong in
  kern_ndis.c).
- made ndis_block and ndis_chars in the ndis_softc stucture pointers
  and modified all references to it
- fixed NdisMRegisterMiniport() and NdisInitializeWrapper() so they
  work correctly with the new driver_object mechanism
- changed ndis_attach() to call NdisAddDevice() instead of ndis_load_driver()
  (which is now deprecated)
- used ExAllocatePoolWithTag()/ExFreePool() in lookaside list routines
  instead of kludged up alloc/free routines
- added kern_windrv.c to sys/modules/ndis/Makefile and files.i386.

19 years agoDon't use VOP_LEASE() with operations on extended attribute backing
rwatson [Tue, 8 Feb 2005 17:05:38 +0000 (17:05 +0000)]
Don't use VOP_LEASE() with operations on extended attribute backing
files.

Pointed out by: phk

19 years agoFor snapshots we need all VOP_LOCKs to be exclusive.
phk [Tue, 8 Feb 2005 16:25:50 +0000 (16:25 +0000)]
For snapshots we need all VOP_LOCKs to be exclusive.

The "business class upgrade" was implemented in UFS's VOP_LOCK
implementation ufs_lock() which is the wrong layer, so move it to
ffs_lock().

Also, as long as we have not abandonned advanced vfs-stacking we
should not preclude it from happening: instead of implementing a
copy locally, use the VOP_LOCK_APV(&ufs) to correctly arrive at
vop_stdlock() at the bottom.

19 years agoFor snapshots we need all VOP_LOCKs to be exclusive.
phk [Tue, 8 Feb 2005 15:54:30 +0000 (15:54 +0000)]
For snapshots we need all VOP_LOCKs to be exclusive.

The "business class upgrade" was implemented in UFS's VOP_LOCK
implementation ufs_lock() which is the wrong layer, so move it to
ffs_lock().

Also, as long as we have not abandonned advanced vfs-stacking we
should not preclude it from happening: instead of implementing a
copy locally, use the VOP_LOCK_APV(&ufs) to correctly arrive at
vop_stdlock() at the bottom.

19 years agoUse VOP_STRATEGY_APV() instead of direct dereference, this is more
phk [Tue, 8 Feb 2005 15:40:11 +0000 (15:40 +0000)]
Use VOP_STRATEGY_APV() instead of direct dereference, this is more
correct.

19 years agoNuke information about GDB_REMOTE_CHAT, it was removed some time ago.
brueffer [Tue, 8 Feb 2005 15:07:50 +0000 (15:07 +0000)]
Nuke information about GDB_REMOTE_CHAT, it was removed some time ago.

MFC after: 3 days

19 years agoAdd VOP_FOO_APV() which takes a pointer to the vop_vector.
phk [Tue, 8 Feb 2005 12:54:32 +0000 (12:54 +0000)]
Add VOP_FOO_APV() which takes a pointer to the vop_vector.

This allows stacked or partitioned filesystems to say "Continue
the normal resolution from here", for instace from FFS to UFS.

Use VNASSERT() instead of KASSERT().

19 years agomerge from geom_vol_ffs.c rev 1.14 (avoid unaligned I/O requests)
des [Tue, 8 Feb 2005 12:34:11 +0000 (12:34 +0000)]
merge from geom_vol_ffs.c rev 1.14 (avoid unaligned I/O requests)

19 years agoKeep only one style of Pittsburgh driver's tests.
ru [Tue, 8 Feb 2005 10:42:22 +0000 (10:42 +0000)]
Keep only one style of Pittsburgh driver's tests.

Noticed by: Pawel Worach

19 years agoUse the correct length when copying trailing data!!
brian [Tue, 8 Feb 2005 10:38:24 +0000 (10:38 +0000)]
Use the correct length when copying trailing data!!

PR: 77104
Submitted by: Martin Birgmeier martin at email dot aon dot at
MFC after: 3 days

19 years agoAllow building/installing of NLS catalogs while building of libraries
phantom [Tue, 8 Feb 2005 10:37:34 +0000 (10:37 +0000)]
Allow building/installing of NLS catalogs while building of libraries

MFC after: 3 days

19 years agobzero() -> M_ZERO.
ru [Tue, 8 Feb 2005 10:31:55 +0000 (10:31 +0000)]
bzero() -> M_ZERO.

19 years agoTake care not to issue unaligned I/O requests while tasting a provider.
des [Tue, 8 Feb 2005 08:04:23 +0000 (08:04 +0000)]
Take care not to issue unaligned I/O requests while tasting a provider.

19 years agoUnroll the loop for calculating the 8.3 filename checksum. In testing
njl [Tue, 8 Feb 2005 07:51:14 +0000 (07:51 +0000)]
Unroll the loop for calculating the 8.3 filename checksum.  In testing
on my P3, microbenchmarks show the unrolled version is 78x faster.  In
actual use (recursive ls), this gives an average of 9% improvement in
system time and 2% improvement in wall time.

19 years agoUse ANSI function definitions, tweak a couple of prototypes to match (since
imp [Tue, 8 Feb 2005 06:12:44 +0000 (06:12 +0000)]
Use ANSI function definitions, tweak a couple of prototypes to match (since
K&R prototypes needed to mismatch in the way that they were mismatched),
rename ds_getmcaf to ed_ds_getmcaf.  Remove a few register keywords.

19 years agouse fixed types for the calls to ed_pio_readmem, ed_pio_writemem.
imp [Tue, 8 Feb 2005 05:59:43 +0000 (05:59 +0000)]
use fixed types for the calls to ed_pio_readmem, ed_pio_writemem.
Make the special hp versions match the general ones.  Also use fixed
types in the WD80x3_generic probe, and change callers' arrays to
match.  Fix a couple of minor style issues by using newstyle function
definitions in a couple places.

19 years agoMake it possible to unload ed. Move the ed_pccard_detach routine to
imp [Tue, 8 Feb 2005 05:45:35 +0000 (05:45 +0000)]
Make it possible to unload ed.  Move the ed_pccard_detach routine to
if_ed and rename it to ed_detach().  Tell other busses to use this
routine for detach.

Since I don't actually have any non-pccard ed hardware I can test
with, I've only tested with my pccards.

More improvements in this area likely are possible.

Prodded by: rwatson

19 years agoFix style bugs introduced in the de__Pification of this code.
imp [Tue, 8 Feb 2005 05:41:54 +0000 (05:41 +0000)]
Fix style bugs introduced in the de__Pification of this code.

Style bug generically noted by: bde

19 years agoFix crashdumps on twe. The twe_immediate_request() path was not only
scottl [Tue, 8 Feb 2005 03:43:02 +0000 (03:43 +0000)]
Fix crashdumps on twe.  The twe_immediate_request() path was not only
copying data to a temporary buffer before the I/O, but also copying that
temporary buffer back to the original data location after the I/O.  When
you're dumping kernel heap and stack and protected pages, this is very
very bad.

A belated thanks to Robert Watson for donating hardware for this (and future)
work.

MFC after: 3 days

19 years agoMFi386: read from RTC_INTR after writing to RTC_STATUSB
peter [Tue, 8 Feb 2005 01:21:24 +0000 (01:21 +0000)]
MFi386: read from RTC_INTR after writing to RTC_STATUSB

19 years agoFix sloppy use of "manpage", bump .Dd where applicable and rename RED to
mlaier [Mon, 7 Feb 2005 23:20:12 +0000 (23:20 +0000)]
Fix sloppy use of "manpage", bump .Dd where applicable and rename RED to
Random Early Detection (not ... Drop) in order to be consistent with other
documentation on ALTQ

Pointed out by: simon, ru, Brad Davis

19 years agoIntroduce three new targets for ports collection:
krion [Mon, 7 Feb 2005 23:04:33 +0000 (23:04 +0000)]
Introduce three new targets for ports collection:
showconfig-recursive, rmconfig-recursive and config-conditional.

MFC after: 3 days

19 years ago- Implement ibcs2_emul_find() using kern_alternate_path(). This changes
jhb [Mon, 7 Feb 2005 22:02:18 +0000 (22:02 +0000)]
- Implement ibcs2_emul_find() using kern_alternate_path().  This changes
  the semantics in that the returned filename to use is now a kernel
  pointer rather than a user space pointer.  This required changing the
  arguments to the CHECKALT*() macros some and changing the various system
  calls that used pathnames to use the kern_foo() functions that can accept
  kernel space filename pointers instead of calling the system call
  directly.
- Use kern_open(), kern_access(), kern_execve(), kern_mkfifo(), kern_mknod(),
  kern_setitimer(), kern_getrusage(), kern_utimes(), kern_unlink(),
  kern_chdir(), kern_chmod(), kern_chown(), kern_symlink(), kern_readlink(),
  kern_select(), kern_statfs(), kern_fstatfs(), kern_stat(), kern_lstat(),
  kern_fstat().
- Drop the unused 'uap' argument from spx_open().
- Replace a stale duplication of vn_access() in xenix_access() lacking
  recent additions such as MAC checks, etc. with a call to kern_access().

19 years ago- Implement svr4_emul_find() using kern_alternate_path(). This changes
jhb [Mon, 7 Feb 2005 21:53:42 +0000 (21:53 +0000)]
- Implement svr4_emul_find() using kern_alternate_path().  This changes
  the semantics in that the returned filename to use is now a kernel
  pointer rather than a user space pointer.  This required changing the
  arguments to the CHECKALT*() macros some and changing the various system
  calls that used pathnames to use the kern_foo() functions that can accept
  kernel space filename pointers instead of calling the system call
  directly.
- Use kern_open(), kern_access(), kern_msgctl(), kern_execve(),
  kern_mkfifo(), kern_mknod(), kern_statfs(), kern_fstatfs(),
  kern_setitimer(), kern_stat(), kern_lstat(), kern_fstat(), kern_utimes(),
  kern_pathconf(), and kern_unlink().

19 years agoImplement a kern_pathconf() wrapper for pathconf() which can take the
jhb [Mon, 7 Feb 2005 21:46:43 +0000 (21:46 +0000)]
Implement a kern_pathconf() wrapper for pathconf() which can take the
filename from either a user space or a kernel space pointer.

19 years agoIf the pointer to the new itimerval is NULL in kern_setitimer(), just
jhb [Mon, 7 Feb 2005 21:45:48 +0000 (21:45 +0000)]
If the pointer to the new itimerval is NULL in kern_setitimer(), just
read the old value via kern_getitimer().

19 years agoAvoid usage of implicit int.
stefanf [Mon, 7 Feb 2005 21:42:16 +0000 (21:42 +0000)]
Avoid usage of implicit int.

19 years agoInclude <stdlib.h> for exit().
stefanf [Mon, 7 Feb 2005 21:41:26 +0000 (21:41 +0000)]
Include <stdlib.h> for exit().

19 years agoAdd a prototype for localupdate().
stefanf [Mon, 7 Feb 2005 21:40:24 +0000 (21:40 +0000)]
Add a prototype for localupdate().

19 years agoAdd chroot. It can be a real lifesaver, and adds less than 2 kB.
des [Mon, 7 Feb 2005 21:19:18 +0000 (21:19 +0000)]
Add chroot.  It can be a real lifesaver, and adds less than 2 kB.

19 years agoAn aggressive little script I used to trim out duplicate fortunes.
ru [Mon, 7 Feb 2005 21:15:16 +0000 (21:15 +0000)]
An aggressive little script I used to trim out duplicate fortunes.

19 years agoTrim more cookies, by playing with different hash functions,
ru [Mon, 7 Feb 2005 21:00:20 +0000 (21:00 +0000)]
Trim more cookies, by playing with different hash functions,
e.g., by trimming all non-alphabet characters and whitespace,
converting to lowercase, and considering only first (or last)
N letters (maybe only consonants).  The fortune editor then
displays all fortunes that have the same hash, and allows to
remove one of them.  The rest is written to stdout.

19 years agoUse if_link_state_change() instead of rt_ifmsg(). Remove include net/route.h.
glebius [Mon, 7 Feb 2005 19:39:29 +0000 (19:39 +0000)]
Use if_link_state_change() instead of rt_ifmsg(). Remove include net/route.h.

Reviewed by: wpaul, sam

19 years ago- Use kern_{l,f,}stat() and kern_{f,}statfs() functions rather than
jhb [Mon, 7 Feb 2005 18:47:28 +0000 (18:47 +0000)]
- Use kern_{l,f,}stat() and kern_{f,}statfs() functions rather than
  duplicating the contents of the same functions inline.
- Consolidate common code to convert a BSD statfs struct to a Linux struct
  into a static worker function.

19 years agoMake linux_emul_convpath() a simple wrapper for kern_alternate_path().
jhb [Mon, 7 Feb 2005 18:46:05 +0000 (18:46 +0000)]
Make linux_emul_convpath() a simple wrapper for kern_alternate_path().

19 years ago- Tweak kern_msgctl() to return a copy of the requested message queue id
jhb [Mon, 7 Feb 2005 18:44:55 +0000 (18:44 +0000)]
- Tweak kern_msgctl() to return a copy of the requested message queue id
  structure in the struct pointed to by the 3rd argument for IPC_STAT and
  get rid of the 4th argument.  The old way returned a pointer into the
  kernel array that the calling function would then access afterwards
  without holding the appropriate locks and doing non-lock-safe things like
  copyout() with the data anyways.  This change removes that unsafeness and
  resulting race conditions as well as simplifying the interface.
- Implement kern_foo wrappers for stat(), lstat(), fstat(), statfs(),
  fstatfs(), and fhstatfs().  Use these wrappers to cut out a lot of
  code duplication for freebsd4 and netbsd compatability system calls.
- Add a new lookup function kern_alternate_path() that looks up a filename
  under an alternate prefix and determines which filename should be used.
  This is basically a more general version of linux_emul_convpath() that
  can be shared by all the ABIs thus allowing for further reduction of
  code duplication.

19 years agoVarious and sundry style fixes.
jhb [Mon, 7 Feb 2005 18:38:29 +0000 (18:38 +0000)]
Various and sundry style fixes.

19 years agoUse linux_emul_convpath() rather than linux_emul_find() as
jhb [Mon, 7 Feb 2005 18:37:51 +0000 (18:37 +0000)]
Use linux_emul_convpath() rather than linux_emul_find() as
linux_emul_find() is going away.

19 years agoUse the LCONVPATHEXIST() macro rather than it's exact expansion to be
jhb [Mon, 7 Feb 2005 18:37:13 +0000 (18:37 +0000)]
Use the LCONVPATHEXIST() macro rather than it's exact expansion to be
consistent.

19 years agoUse kern_setitimer() to implement linux_alarm() instead of fondling the
jhb [Mon, 7 Feb 2005 18:36:21 +0000 (18:36 +0000)]
Use kern_setitimer() to implement linux_alarm() instead of fondling the
real interval timer directly.

19 years agoUse kern_open() directly rather than a stackgap detour via open().
jhb [Mon, 7 Feb 2005 18:22:20 +0000 (18:22 +0000)]
Use kern_open() directly rather than a stackgap detour via open().

19 years agoDrop Giant before calling kthread_exit().
jhb [Mon, 7 Feb 2005 18:21:50 +0000 (18:21 +0000)]
Drop Giant before calling kthread_exit().

19 years agoAvoid using tsleep() in the resume path as it may result in the
mdodd [Mon, 7 Feb 2005 17:14:42 +0000 (17:14 +0000)]
Avoid using tsleep() in the resume path as it may result in the
system hanging if timer interrupts aren't running yet.

This allows my Thinkpad to resume successfully with APM.

Approved by:  sos
MFC after:  2 weeks

19 years agoRemove an unneeded check.
harti [Mon, 7 Feb 2005 16:33:57 +0000 (16:33 +0000)]
Remove an unneeded check.

19 years agoIntroduce a typedef for variable value modifation functions and use it
harti [Mon, 7 Feb 2005 16:27:19 +0000 (16:27 +0000)]
Introduce a typedef for variable value modifation functions and use it
where appropriate.

Submitted by: Max Okumoto <okumoto@ucsd.edu>

19 years agoMake the intention of a loop clearer.
harti [Mon, 7 Feb 2005 15:51:51 +0000 (15:51 +0000)]
Make the intention of a loop clearer.

Submitted by: Max Okumoto <okumoto@ucsd.edu>

19 years agoAdd VNASSERT() which is just like KASSERT() but takes a vnode argument
phk [Mon, 7 Feb 2005 12:56:19 +0000 (12:56 +0000)]
Add VNASSERT() which is just like KASSERT() but takes a vnode argument
which it will vn_printf() if it triggers.

19 years agoRemove unused defines.
nyan [Mon, 7 Feb 2005 12:23:07 +0000 (12:23 +0000)]
Remove unused defines.

19 years agoBe more verbose about altq SYNOPSIS and add more linkage in the relating pf
mlaier [Mon, 7 Feb 2005 11:46:36 +0000 (11:46 +0000)]
Be more verbose about altq SYNOPSIS and add more linkage in the relating pf
documents.

Inspired by: scottl
Reviewed by: Brad Davis <so14kNOso14kSPAMcom>
MFC after: 3 days

19 years agoFix the problem with incorrect throttling level reported immediately after
sobomax [Mon, 7 Feb 2005 11:35:24 +0000 (11:35 +0000)]
Fix the problem with incorrect throttling level reported immediately after
reboot. Safter the reboot the TCC is usually in the Automatic mode, in which
reading current performance level is likely to produce bogus results make sure
to switch it to the On-Demand mode and set to some known performance level.
Unfortunately there is no reliable way to check that TCC is in the Automatic
mode. Reading bit 4 of ACPI Thermal Monitor Control Register produces 0
regardless of the current mode.

MFC after: 1 week

19 years agoIntroduce Buf_StripNewLines() and use it where appropriate.
harti [Mon, 7 Feb 2005 11:27:47 +0000 (11:27 +0000)]
Introduce Buf_StripNewLines() and use it where appropriate.

Submitted by: Max Okumoto <okumoto@ucsd.edu>

19 years agoFix "to a file" example so it works (one must touch(1) the file first).
obrien [Mon, 7 Feb 2005 11:26:53 +0000 (11:26 +0000)]
Fix "to a file" example so it works (one must touch(1) the file first).

19 years agoImprove parsing of hook name.
glebius [Mon, 7 Feb 2005 11:16:07 +0000 (11:16 +0000)]
Improve parsing of hook name.

Submitted by: ru

19 years agoAccess vmobject via the bufobj instead of the vnode
phk [Mon, 7 Feb 2005 10:04:06 +0000 (10:04 +0000)]
Access vmobject via the bufobj instead of the vnode