jhb [Fri, 30 Mar 2007 18:07:24 +0000 (18:07 +0000)]
- Use lock_init/lock_destroy() to setup the lock_object inside of lockmgr.
We can now use LOCK_CLASS() as a stronger check in lockmgr_chain() as a
result. This required putting back lk_flags as lockmgr's use of flags
conflicted with other flags in lo_flags otherwise.
- Tweak 'show lock' output for lockmgr to match sx, rw, and mtx.
jkim [Fri, 30 Mar 2007 17:56:44 +0000 (17:56 +0000)]
Use underlying structures instead of kernel_sysctlbyname() for msginfo and
seminfo because kernel_sysctlbyname() is slow. There is no dependency
problem since linux module depends on both sysvmsg and sysvsem and linprocfs
depends on it in turn.
delphij [Fri, 30 Mar 2007 16:32:08 +0000 (16:32 +0000)]
- Be more verbose when saying "foo" not found.
- In gctl_get_geom(), don't issue error when we were not
provided with an parameter, like gctl_get_provider() did.
simokawa [Fri, 30 Mar 2007 14:41:24 +0000 (14:41 +0000)]
- Don't call fw_busreset() in firewire_attach().
This should fix the problem that the first bus reset is
sometimes ignored because of FWBUSRESET status.
wkoszek [Fri, 30 Mar 2007 14:34:34 +0000 (14:34 +0000)]
Instead of direct manipulation on queue and worklist mutexes, bring macros
for doing this job. This change will make it easy to migrate from using
spinning locks to adaptive ones.
imp [Fri, 30 Mar 2007 04:10:04 +0000 (04:10 +0000)]
Document that EPERM is returned when the calling thread does not have
the mutex locked. Also tweak the wording to make it more consistant
between pthread_cond_wait and pthread_cond_tiedwait.
Confirmed with the opengroup's web site that this is a valid return
value. Wording used specifically not that of opengroup's online man
pages.
bms [Thu, 29 Mar 2007 21:39:22 +0000 (21:39 +0000)]
Fix a bug in IPv4 address configuration exposed by refcounting.
* Join the IPv4 all-hosts multicast group 224.0.0.1 once only;
that is, when an IPv4 address is first configured on an interface.
* Do not join it for subsequent IPv4 addresses as this violates IGMP.
* Be sure to leave the group when all IPv4 addresses have been removed
from the interface.
* Add two DIAGNOSTIC printfs related to the issue.
Further care and attention is needed in this area; it is suggested that
netinet's attachment to the ifnet structure be compartmentalized and
non-implicit.
jasone [Thu, 29 Mar 2007 21:07:17 +0000 (21:07 +0000)]
Use size_t instead of unsigned for pagesize-related values, in order to
avoid downcasting issues. In particular, this change fixes
posix_memalign(3) for alignments greater than 2^31 on LP64 systems.
Make sure that NDEBUG is always set to be compatible with MALLOC_DEBUG. [1]
Reported by: [1] Lee Hyo geol <hyogeollee@gmail.com>
wkoszek [Thu, 29 Mar 2007 13:26:13 +0000 (13:26 +0000)]
vm_map_delete should be used only internally, by the VM subsystem. Replace
it with vm_map_remove, which not only embeds additional check, but also
takes care of locking.
ache [Thu, 29 Mar 2007 10:55:33 +0000 (10:55 +0000)]
Fix get_if_var() with 3 args (i.e. with default)
All xxx_<ifname> flags are set to empty strings automatically earlier so
eval echo \${${prefix}${_if}${suffix}-${_default}}
not substitute the default but return just the empty string.
Fix it using
eval echo \${${prefix}${_if}${suffix}:-${_default}}
(i.e. treat empty strings as unset)
The bug manifistates itself with the following warning from checkyesno():
/etc/rc.d/dhclient: WARNING: $background_dhclient is not set properly -
see rc.conf(5)
kib [Thu, 29 Mar 2007 08:26:04 +0000 (08:26 +0000)]
Revert rev. 1.205. Replace unconditional acquision of Giant when QUOTAS are
defined with VFS_LOCK_GIANT(NULL) call.
This shall fix softdep operation when mpsafe_vfs = 0.
imp [Wed, 28 Mar 2007 22:40:37 +0000 (22:40 +0000)]
RTC_TIMR's RTC_SEC field is BCD. That makes it unsuitable for
GetSeconds(). Instead, use CRTR register shifted right 15. This
gives us a range of 32 seconds we can do for timeout.
Shift to using == rather than < or > for calculating the timeout,
since if we can't read the ST_CTRT register twice in a second we have
even bigger problems to worry about, and == deals with the 'wrap'
issue.
This lets me type at the boot2 prompt again! Woo Hoo!
Bogusness noticed by: tisco
Pointy Hat to: That silly imp guy
imp [Wed, 28 Mar 2007 22:31:32 +0000 (22:31 +0000)]
All SD cards have a block size of 512. The READ_BL_LEN field in the
CSD is usually 512 (well, 9), but for 2GB (and the rogue 4GB SD cards)
it is 1024 (or 2048 for 4GB). This value doesn't work for the block
read commands (which really want 512). Hardcode 512 for those. This
may break really old MMC cards that don't have a 512 block size (I've
never seen one: make my day and send me one :-), but since the MMC
side of the house is currently broken, it should only have the effect
that 2GB (and non-conforming 4GB) SD cards will work.
My 'non-conforming' 4GB SD card also works now too. The
non-conforming 4GB SD cards were sold for a while before the SD
association was worried they would be (a) incompatible (different FAT
flavor on them) and (b) confusing for the new SDHC standard and
cracked down on suppliers' bogus use of the SD trademark...
imp [Wed, 28 Mar 2007 21:18:45 +0000 (21:18 +0000)]
Various buglets fixed (from submitter):
The changes to getstr() is so that the character that is
passed in to it, is also processed just as the rest. I also
removed one of the getc() calls otherwise you loose every
second character.
I also changed the strcpy of kname, so that it only happens if
kname is '\0'. This is so that one can pass a kernel in
through /boot.config.
The last change to boot2.c is in parse(). If you tried to type
a kernel name to boot, the first character was lost, the arg--
fix that.
jasone [Wed, 28 Mar 2007 19:55:07 +0000 (19:55 +0000)]
Remove the run promotion/demotion machinery. Replace it with red-black
trees that track all non-full runs for each bin. Use the red-black
trees to be able to guarantee that each new allocation is placed in the
lowest address available in any non-full run. This change completes the
transition to allocating from low addresses in order to reduce the
retention of sparsely used chunks.
If the run in current use by a bin becomes empty, deallocate the run
rather than retaining it for later use. The previous behavior had the
tendency to spread empty runs across multiple chunks, thus preventing
the release of chunks that were completely unused.
Generalize base_chunk_alloc() (and rename it to base_pages_alloc()) to
handle allocation sizes larger than the chunk size, so that it is
possible to support chunk sizes that are smaller than an arena object.
Reduce the minimum chunk size from 64kB to 8kB.
Optimize tracking of addresses for deleted chunks.
marcel [Wed, 28 Mar 2007 18:34:59 +0000 (18:34 +0000)]
For embedded UARTs compatible with the ns8250 family it is possible
that the driver clock is identical to the processor or bus clock.
This is the case for the PowerQUICC processor. When the clock is
high enough, overflows happen in the calculation of the time it
takes to send 1/10 of a character, used in delay loops. Fix the
overflows so as to fix bugs in the delay loops that can cause either
insufficient delays or excessive delays.
marcel [Wed, 28 Mar 2007 18:26:12 +0000 (18:26 +0000)]
When we match UARTs found during bus-enumeration with UARTs used for
system devices (i.e. console, debug port or keyboard), don't stop
after the first match. Find them all and keep track of the last.
The reason for this change is that the low-level console is always
added to the list of system devices first, with other devices added
later. Since new devices are added to the list at the head, we have
the console always at the end. When a debug port is using the same
UART as the console, we would previously mark the "newbus" UART as
a debug port instead of as a console. This would later result in a
panic because no "newbus" device was associated with the console.
By matching all possible system devices we would mark the "newbus"
UART as a console and not as a debug port.
While it is arguably better to be able to mark a "newbus" UART as
both console and debug port, this fix is lightweight and allows
a single UART to be used as the console as well as a debug port
with only the aesthetic bug of not telling the user about it also
being a debug port.
Now that we match all possible system devices, update the rclk of
the system devices with the rclk that was obtained through the
bus attachment. It is generally true that clock information is
more reliable when obtained from the parent bus than by means of
some hardcoded or assumed value used early in the boot. This by
virtue of having more context information.
marcel [Wed, 28 Mar 2007 18:05:17 +0000 (18:05 +0000)]
Add method enabled() to the SCC interface. This method can be used
by driver backends to mark individual channels as enabled or not.
The default implementation of this method always mark channels as
enabled.
This method is currently not used, but is added with the PowerQUICC
in mind where the 2nd SCC channel can be disabled.
glebius [Wed, 28 Mar 2007 13:59:13 +0000 (13:59 +0000)]
Bump maximum number of interface hooks to the maximum possible value.
This will increase the memory consumption for more than 1 Mb, but this
is required for operation on multiinterface access concentrators running
mpd.