fjoe [Fri, 13 Aug 2004 09:40:58 +0000 (09:40 +0000)]
Add geom_uzip -- geom class that implements read-only compressed disks.
Currently supports cloop V2.0 disk compression format.
May support more formats in future.
alc [Fri, 13 Aug 2004 08:06:34 +0000 (08:06 +0000)]
Replace the linear search in vm_map_findspace() with an O(log n)
algorithm built into the map entry splay tree. This replaces the
first_free hint in struct vm_map with two fields in vm_map_entry:
adj_free, the amount of free space following a map entry, and
max_free, the maximum amount of free space in the entry's subtree.
These fields make it possible to find a first-fit free region of a
given size in one pass down the tree, so O(log n) amortized using
splay trees.
This significantly reduces the overhead in vm_map_findspace() for
applications that mmap() many hundreds or thousands of regions, and
has a negligible slowdown (0.1%) on buildworld. See, for example, the
discussion of a micro-benchmark titled "Some mmap observations
compared to Linux 2.6/OpenBSD" on -hackers in late October 2003.
OpenBSD adopted this approach in March 2002, and NetBSD added it in
November 2003, both with Red-Black trees.
njl [Fri, 13 Aug 2004 06:22:35 +0000 (06:22 +0000)]
MPSAFE locking
* Serialize access to the sysctl routines and the notify handler
* Assert that the sx lock is held in any functions they call.
* Note that recursively calling to re-enable the hotkeys is sub-optimal.
njl [Fri, 13 Aug 2004 06:22:24 +0000 (06:22 +0000)]
MPSAFE locking
* Remove the interrupt wrapper that locked Giant and call the handler
directly. Mark the handler as MPSAFE.
* Don't attempt to detect if a handler is installed. Leave that to the
bus_alloc_resource() function.
njl [Fri, 13 Aug 2004 06:22:20 +0000 (06:22 +0000)]
MPSAFE locking
* Serialize operations in acpi_video_bind_outputs(), acpi_video_detach(),
acpi_video_notify_handler(), acpi_video_power_profile(), and the sysctls.
The main goal is to protect the shared device list and prevent conflicting
settings.
* Add assertions that the sx lock is held in the leaf functions.
njl [Fri, 13 Aug 2004 06:22:17 +0000 (06:22 +0000)]
MPSAFE locking
* Restructure the event handling path. acpi_tz_thread() now calls
acpi_tz_timeout() any time an event occurs. acpi_tz_timeout() checks
the flags and calls acpi_tz_power_profile(), acpi_tz_establish(), and
acpi_tz_monitor() as appropriate. Notifies only do a wakeup and let
acpi_tz_thread() do the actual work. This path is cleaner and allows
locking since the call path is now always a D.A.G.
* Add the acpi_tz_signal() function to set flags and wake the thread.
* Remove the tz_tmp_updating flag since calls are serialized by
acpi_tz_thread().
* Remove Giant locking.
njl [Fri, 13 Aug 2004 06:22:10 +0000 (06:22 +0000)]
MPSAFE locking
* Serialize acpi_pwr_switch_consumer() and acpi_pwr_wake_enable().
* Make acpi_pwr_switch_consumer() have a single exit point.
* Add assertions to the leaf functions they call.
* Fix a memory leak in acpi_pwr_deregister_consumer(). However, it is
currently ifdefed out so this code was unused.
njl [Fri, 13 Aug 2004 06:22:03 +0000 (06:22 +0000)]
MPSAFE locking
* Serialize access to acpi_pci_link_config(), acpi_pci_find_prt(),
acpi_pci_link_route(), and acpi_pci_link_resume().
* Add lock assertions to all functions called by them.
njl [Fri, 13 Aug 2004 06:21:55 +0000 (06:21 +0000)]
MPSAFE locking
* Serialize notifying the user in acpi_lid_notify_status_changed(). This
way multiple lid events occur in order.
* Add an initialization pass to get the lid status at boot-time. This
pass does not notify any apps but gets the initial status.
njl [Fri, 13 Aug 2004 06:21:53 +0000 (06:21 +0000)]
MPSAFE locking
* Use the common serialization macros instead of rolling our own.
* Increase the coverage of the lock in EcSpaceHandler() to cover the entire
loop to avoid dropping the lock when reading more than one byte.
njl [Fri, 13 Aug 2004 06:21:44 +0000 (06:21 +0000)]
MPSAFE locking
* Serialize ops in acpi_cmbat_notify_handler(), acpi_cmbat_ioctl(),
acpi_cmbat_init_battery(), and acpi_cmbat_get_battinfo().
* Get the softc directly in acpi_cmbat_get_total_battinfo() rather than
build an array of them.
* Don't queue a _BIF query after receiving a notify. Since we clear the
timespec, a _BIF query will be done in the context of the next caller.
* Add asserts to leaf functions that operate on shared data.
* Remove the bst/bif updating flags now that we hold the lock over the
full query.
* Explain various comments in more detail.
njl [Fri, 13 Aug 2004 06:21:41 +0000 (06:21 +0000)]
MPSAFE locking
* Serialize acpi_battery_get_battdesc(), acpi_battery_register(), and
acpi_battery_remove().
* Assert that the sx lock is held in acpi_batteries_init().
* Remove check for device_get_softc() returning NULL.
njl [Fri, 13 Aug 2004 06:21:36 +0000 (06:21 +0000)]
MPSAFE locking
* Serialize notification of acline changes in acpi_acad_get_status().
* Remove the initializing flag. With the locking, we don't need to
push off requests for the acline before initialization is done.
* Don't check device_get_softc(), it can't return NULL.
njl [Fri, 13 Aug 2004 06:21:32 +0000 (06:21 +0000)]
MPSAFE locking
* Serialize calls to acpi_alloc_resource(), acpi_release_resource(),
acpi_Enable(), acpi_Disable(), and acpi_debug_sysctl().
* Acquire the ACPI mutex in acpi_register_ioctl(), acpi_deregister_ioctl(),
and acpiioctl().
* Acquire the mutex while disabling subsequent requests to enter a
sleep state in acpi_SetSleepState().
* Be sure to re-enable sleep requests and don't run resume methods when
the current request fails.
* Don't check if sleep requests are disabled in the ACPIIO_SETSLPSTATE
ioctl. acpi_SetSleepState() does this for us.
* Remove the acquisition of Giant from the struct cdevsw.
* Remove the ACPI_USE_THREADS option.
njl [Fri, 13 Aug 2004 06:21:19 +0000 (06:21 +0000)]
MPSAFE locking
* Add and comment our locking primitives. The mutex primitives use a
a static mutex and the serialization ones use a static sx lock. A global
acpi_mutex is used for access to global resources (i.e., writes to the
SMI_CMD register.)
* Remove 4.x compat defines.
bmah [Fri, 13 Aug 2004 04:54:52 +0000 (04:54 +0000)]
More wording, grammar, and punctuation tweaks. No major content
changes, although one release note, about udav(4) promiscuous mode,
was deleted as it was redundant (the driver itself is new and this
fact has its own note).
scottl [Fri, 13 Aug 2004 01:44:09 +0000 (01:44 +0000)]
Add support for the Adaptec RAID-On-Chip architecture. This in turn
provides support for the Adaptec 2130S adapter. Thanks to Adaptec for
providing hardware for this.
csjp [Thu, 12 Aug 2004 22:06:55 +0000 (22:06 +0000)]
Add the ability to associate ipfw rules with a specific prison ID.
Since the only thing truly unique about a prison is it's ID, I figured
this would be the most granular way of handling this.
This commit makes the following changes:
- Adds tokenizing and parsing for the ``jail'' command line option
to the ipfw(8) userspace utility.
- Append the ipfw opcode list with O_JAIL.
- While Iam here, add a comment informing others that if they
want to add additional opcodes, they should append them to the end
of the list to avoid ABI breakage.
- Add ``fw_prid'' to the ipfw ucred cache structure.
- When initializing ucred cache, if the process is jailed,
set fw_prid to the prison ID, otherwise set it to -1.
- Update man page to reflect these changes.
This change was a strong motivator behind the ucred caching
mechanism in ipfw.
A sample usage of this new functionality could be:
ipfw add count ip from any to any jail 2
It should be noted that because ucred based constraints
are only implemented for TCP and UDP packets, the same
applies for jail associations.
marius [Thu, 12 Aug 2004 20:37:02 +0000 (20:37 +0000)]
- Use bus_space_subregion() rather than arithmetic on bus_space_handle_t. [1]
- Properly use the error variable and return it on failure in the attach-
routines.
tegge [Thu, 12 Aug 2004 20:14:49 +0000 (20:14 +0000)]
The vm map lock is needed in vm_fault() after the page has been found,
to avoid later changes before pmap_enter() and vm_fault_prefault()
has completed.
Simplify deadlock avoidance by not blocking on vm map relookup.
rwatson [Thu, 12 Aug 2004 18:31:36 +0000 (18:31 +0000)]
When allocating the IPv6 header to stick in front of raw packet being
sent via a raw IPv6 socket, use M_DONTWAIT not M_TRYWAIT, as we're
holding the raw pcb mutex.
marius [Thu, 12 Aug 2004 17:41:33 +0000 (17:41 +0000)]
- Introduce an ofw_bus kobj-interface for retrieving the OFW node and a
subset ("compatible", "device_type", "model" and "name") of the standard
properties in drivers for devices on Open Firmware supported busses. The
standard properties "reg", "interrupts" und "address" are not covered by
this interface because they are only of interest in the respective bridge
code. There's a remaining standard property "status" which is unclear how
to support properly but which also isn't used in FreeBSD at present.
This ofw_bus kobj-interface allows to replace the various (ebus_get_node(),
ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type()
vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one.
This in turn allows to simplify and remove code-duplication in drivers for
devices that can hang off of more than one OFW supported bus.
- Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the
drivers for their children to use the ofw_bus kobj-interface. The IVAR-
interfaces of the Central, EBus and FHC are entirely replaced by this. The
PCI bus driver used its own kobj-interface and now also uses the ofw_bus
one. The IVARs special to the SBus, e.g. for retrieving the burst size,
remain.
Beware: this causes an ABI-breakage for modules of drivers which used the
IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be
recompiled.
The style-inconsistencies introduced in some of the bus drivers will be
fixed by tmm@ in a generic clean-up of the respective drivers later (he
requested to add the changes in the "new" style).
- Convert the powerpc MacIO bus driver and the drivers for its children to
use the ofw_bus kobj-interface. This invloves removing the IVARs related
to the "reg" property which were unused and a leftover from the NetBSD
origini of the code. There's no ABI-breakage caused by this because none
of these driver are currently built as modules.
There are other powerpc bus drivers which can be converted to the ofw_bus
kobj-interface, e.g. the PCI bus driver, which should be done together
with converting powerpc to use the OFW PCI code from sparc64.
- Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take
advantage of the ofw_bus kobj-interface and simplify them a bit.
Reviewed by: grehan, tmm
Approved by: re (scottl)
Discussed with: tmm
Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386
njl [Thu, 12 Aug 2004 17:06:05 +0000 (17:06 +0000)]
Skip dependent functions when finding the resource from _PRS to use for
later calls to _SRS. Add note that this code should be centralized at
some point.
njl [Thu, 12 Aug 2004 17:04:19 +0000 (17:04 +0000)]
Only print the link name if there is a link. For the hardwired case, don't
bother printing it. This fixes a panic and acpi_name() has been more robust
as well.
mlaier [Thu, 12 Aug 2004 13:59:44 +0000 (13:59 +0000)]
Loopback fix from Daniel Hartmeier:
pf_cksum_fixup() was called without last argument from
normalization, also fixup checksum when random-id modifies ip_id.
This would previously lead to incorrect checksums for packets
modified by scrub random-id.
pjd [Thu, 12 Aug 2004 13:15:52 +0000 (13:15 +0000)]
The geom(8) utility needs dynamic linker functionality to work, so it can't
be staticaly linked.
This fixes problems on systems compiled with NO_DYNAMICROOT.
harti [Thu, 12 Aug 2004 12:31:43 +0000 (12:31 +0000)]
Add support for the examination and modification of the devices.
This is implemented through SNMP and requires the ilmi daemon to
run on the system. To prevent bloat in rescue the atmconfig for
rescue is compiled without this stuff.
deischen [Thu, 12 Aug 2004 12:12:12 +0000 (12:12 +0000)]
As long as we have a knob to force system scope threads, why not have
a knob to force process scope threads. If the environment variable
LIBPTHREAD_PROCESS_SCOPE is set, force all threads to be process
scope threads regardless of how the application creates them. If
LIBPTHREAD_SYSTEM_SCOPE is set (forcing system scope threads), it
overrides LIBPTHREAD_PROCESS_SCOPE.
$ # To force system scope threads
$ LIBPTHREAD_SYSTEM_SCOPE=anything threaded_app
$ # To force process scope threads
$ LIBPTHREAD_PROCESS_SCOPE=anything threaded_app
harti [Thu, 12 Aug 2004 11:49:55 +0000 (11:49 +0000)]
Put variable assignments on .MAKEFLAGS and .MFLAGS targets into
the .MAKEFLAGS variable so that these are also passed to sub-makes.
This makes the handling of variables in the command environment more
consistent.
PR: bin/68853
Submitted by: Martin Kamerhofer <data@sbox.tugraz.at>
tjr [Thu, 12 Aug 2004 09:33:47 +0000 (09:33 +0000)]
Move some internal macros and inlines from ctype.h to a new file, _ctype.h,
which has been repo-copied from ctype.h. This will allow us to remove
namespace pollution from <wctype.h> and to make wcwidth() an inline function
without introducing more pollution.
andre [Thu, 12 Aug 2004 08:37:42 +0000 (08:37 +0000)]
Fix two cases of incorrect IPQ_UNLOCK'ing in the merged ip_reass() function.
The first one was going to 'dropfrag', which unlocks the IPQ, before the lock
was aquired; The second one doing a unlock and then a 'goto dropfrag' which
led to a double-unlock.
jeff [Thu, 12 Aug 2004 07:56:33 +0000 (07:56 +0000)]
- Introduce a new flag KEF_HOLD that prevents sched_add() from doing a
migration. Use this in sched_prio() and sched_switch() to stop us from
migrating threads that are in short term sleeps or are runnable. These
extra migrations were added in the patches to support KSE.
- Only set NEEDRESCHED if the thread we're adding in sched_add() is a
lower priority and is being placed on the current queue.
- Fix some minor whitespace problems.