Warner Losh [Mon, 14 May 2001 06:04:29 +0000 (06:04 +0000)]
Take a stab at making this less dependent on having pcic as a parent.
For memory for the pccard attribute/common memory mapping allocate on
the pccard. For other allocations, use whatever is the parent of this
device. There's no doubt other issues lurking, but this should make
things closer to being independent.
Warner Losh [Mon, 14 May 2001 05:56:12 +0000 (05:56 +0000)]
Change machdep.pccard.pcic_mem_{start,end} to machdep.pccard.mem_{start,end}
since they have nothing to do with pcic and it makes grepping for pcic
infection in pccard harder.
Seigo Tanimura [Mon, 14 May 2001 05:26:48 +0000 (05:26 +0000)]
- 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.)
Bruce A. Mah [Mon, 14 May 2001 05:05:13 +0000 (05:05 +0000)]
General corrections and fixings of the hardware list:
1. Everywhere I could figure out what driver supported a device or
class of device, there is now a cross-reference via a &man entity.
For cases where a driver has no manpage (and hence no &man entity),
we now at least give the name of the driver. For the most part,
this was done by examining driver manpages.
2. A number of devices which are i386-only are now marked as such,
determined by noting manpages or kernel source files in
architecture-specific directories.
3. Added hardware supported by the vpo(4), wl(4), awi(4), and bktr(4)
drivers, based on a read of the manpages.
The manpages and source files in question were taken from 4-STABLE,
(which is what was running on my off-net laptop at the time)
but at this level of detail, I don't expect there to be any appreciable
differences between 4-STABLE and 5-CURRENT.
Warner Losh [Mon, 14 May 2001 04:53:02 +0000 (04:53 +0000)]
When activating or deactivating a resource, only attempt to deal with
the resource activation if we're dealing with our grandchild.
Otherwise, we run into two problems. One, if the pccard layer wanted
to allocate and activate something, we'd wind up trying to do the
wrong thing twice: the ivars are wrong and we don't want the bridge to
map the resource to the slot. If we're more than a grandchild, then
who knows what kind of ivar is present. In either of these cases, we
just pass it up the food chain.
Kirk McKusick [Sun, 13 May 2001 23:30:45 +0000 (23:30 +0000)]
If the effective link count is zero when an NFS file handle request
comes in for it, the file is really gone, so return ESTALE.
The problem arises when the last reference to an FFS file is
released because soft-updates may delay the actual freeing of the
inode for some time. Since there are no filesystem links or open
file descriptors referencing the inode, from the point of view of
the system, the file is inaccessible. However, if the filesystem
is NFS exported, then the remote client can still access the inode
via ufs_fhtovp() until the inode really goes away. To prevent this
anomoly, it is necessary to begin returning ESTALE at the same time
that the file ceases to be accessible to the local filesystem.
Peter Wemm [Sun, 13 May 2001 20:43:30 +0000 (20:43 +0000)]
Back out rev 1.260. The 'streams' module is a registered dependency of
the 'svr4' module already. This was a 4.x-only problem and should not
have been MFS'ed.
+ add u_long sector_size to struct disk (documented in libdisk.3)
+ make Open_Disk sense the sector size by trying 512, 1024 and 2048
in this order. This makes the kernel note that
dscheck(cd1): bio_bcount 512 is not on a sector boundary (ssize 2048)
dscheck(cd1): bio_bcount 1024 is not on a sector boundary (ssize 2048)
if 2048 is the sector size. If this worries anyone: the message is from
/usr/src/sys/kern/subr_diskslice.c and shutups are to be placed there.
+ Have read_block and write_block use an additional parameter, the
sector size.
+ replace all barfout calls with return NULL, 0, __LINE__, etc.
Note that this does NOT emit diagnostics. More often than not,
you don't want library functions to scribble on stderr -- it may
not even be available. The right thing is to propagate the error
condition to upper management. The app should take care of errors.
+ use d1->sector_size instead of 512 in various places. I've left many
places untouched, especially those writing MBRs. I simply added
another arg hardcoded as 512. This is because I would not know what
I'm doing... I felt this approach would be reasonably backward
compatible and not introduce any new bugs in critical software.
Famous last words. Messing with MBRs might soon put me in the same
screwup meister category as, uh, never mind. :-)
+ bump the max no of disks from 20 to 32 (due to PR 24503).
Bruce Evans [Sun, 13 May 2001 07:44:14 +0000 (07:44 +0000)]
Use a critical region to protect pushing of the parent's npx state to the
pcb for fork(). It was possible for the state to be saved twice when an
interrupt handler saved it concurrently. This corrupted (reset) the state
because fnsave has the (in)convenient side effect of doing an implicit
fninit. Mundane null pointer bugs were not possible, because we save to
an "arbitrary" process's pcb and not to the "right" place (npxproc).
Push the parent's %gs to the pcb for fork(). Changes to %gs before
fork() were not preserved in the child unless an accidental context
switch did the pushing. Updated the list of pcb contents which is
supposed to inhibit bugs like this. pcb_dr*, pcb_gs and pcb_ext were
missing. Copying is correct for pcb_dr*, and pcb_ext is already
handled specially (although XXX'ly).
Reducing the savectx() call to an npxsave() call in rev.1.80 was a
mistake. The above bugs are duplicated in many places, including in
savectx() itself.
The arbitraryness of the parent process pointer for the fork()
subroutines, the pcb pointer for savectx(), and the save87 pointer
for npxsave(), is illusory. These functions don't work "right" unless
the pointers are precisely curproc, curpcb, and the address of npxproc's
save87 area, respectively, although the special context in which they
are called allows savectx(&dumppcb) to sort of work and npxsave(&dummy)
to work. cpu_fork() just doesn't work unless the parent process
pointer is curproc, or the caller has pushed %gs to the pcb, or %gs
happens to already be in the pcb.
Warner Losh [Sun, 13 May 2001 04:16:09 +0000 (04:16 +0000)]
Change #ifdef PC98 to #ifdef MECIA_SUPPORT and define MECIA_SUPPORT
when PC98 is defined. This is in perparation for a mecia driver
separate from pcic, assuming that all goes well with that effort.
MECIA_SUPPORT won't be removed until after that support is working.
Warner Losh [Sun, 13 May 2001 01:52:55 +0000 (01:52 +0000)]
I'll be making some rather substantial changes to the pci attachment
of the pcic class of devices. Go ahead and move it to the "usual"
place. I say "usual" in quotes since it isn't exactly right (not in
dev/blah), but it is closer than before.
Warner Losh [Sun, 13 May 2001 01:44:27 +0000 (01:44 +0000)]
o Get rid of static array of slots in pccard layer. Move this to the
softc.
o Store pointers to softc in dev_t in si_drv1.
o Change 'kludge version' to 'classic version' since things are getting less
kludgy.
o Minor code shuffling so that we probe and attach the pccard slots.
o Minor style(9) changes.
Ian Dowse [Sun, 13 May 2001 00:07:03 +0000 (00:07 +0000)]
- Split out the {family,socktype}->netid conversion into a separate
function; we now handle unknown protocols more gracefully.
- Cache the return from getnetconfigent() so that we don't have to
remember to call freenetconfigent() each time. This fixes a memory
leak that would cause retrying background mount_nfs processes to
slowly increase their memory usage.
Daniel Eischen [Sat, 12 May 2001 22:54:53 +0000 (22:54 +0000)]
Revert part of last commit. Instead of using %fs for KSD/TSD, we'll
follow Linux' convention and use %gs. This adds back the setting of
%fs to a sane value in sendsig(). The value of %gs remains preserved
to whatever it was in user context.
Ian Dowse [Sat, 12 May 2001 20:05:26 +0000 (20:05 +0000)]
Extract the path from an AF_LOCAL sockaddr_un in a way that correctly
terminates the string in all cases, based on code from netstat(1).
The path in a sockaddr_un is terminated either by a '\0', or by
the end of the sockaddr as defined by sun_len.
Previously, the code could write the "safety" '\0' beyond the end
of the sockaddr (sockaddr_un's need only be large enough to store
sun_len bytes), and writing into the the supplied sockaddr is bad
anyway.
Jimmy Olgeni [Sat, 12 May 2001 19:39:13 +0000 (19:39 +0000)]
Check for both hint files in /var/run (elf and aout) and eventually create
them.
Sysinstall used to check /var/run/ld.so.hints (aout related) and create
hints with the ldconfig command, but the ldconfig command alone will
generate elf hints only. The correct behavior is:
* If /var/run/ld-elf.so.hints does not exist, generate elf hints
* If /var/run/ld.so.hints does not exist, generate aout hints
(using ldconfig with the -aout option)
This will help ports that check for aout libraries using ldconfig in their
pkg-req scripts.
Bruce Evans [Sat, 12 May 2001 14:21:14 +0000 (14:21 +0000)]
Fixed some bitrot:
- the changes that renamed libf2c to libg2c had not reached here
- there were no definitions for LIBDEVINFO, LIBMENU, LIBPANEL, LIBTINFO,
LIBUSB or LIBVGL. LIBUSB was used without it being defined, and
LIBDEVINFO and LIBVGL should have been used.
- the definitions of LIBDESCRYPT, LIBGCC_PIC, LIBGPLUSPLUS, LIBKZHEAD,
LIBKZTAIL, LIBSCRYPT and LIBSCSI were garbage.
Fixed some old bugs:
- LIBC_PIC and LIBCOM_ERR were assigned to using "=" instead of "?=".
- the definition of LIBC_R was disordered.
- LIBFORM was misspelled LIBFORMS (but not actually used).
Kris Kennaway [Sat, 12 May 2001 09:44:32 +0000 (09:44 +0000)]
Clean up some of the evil string handling in this code, replace
warnx()+exit() with errx() and replace a big if..then..else construct
to determine the package download directory with a lookup table.
Maxim Sobolev [Sat, 12 May 2001 09:19:36 +0000 (09:19 +0000)]
Take keyboard map files from ${.CURDIR}/../../share/syscons/keymaps, not from
/usr/share/syscons/keymaps. This should prevent word breakage when new keymaps
have been added.
Prompted by: Matthew D. Fuller <fullermd@over-yonder.net>
John Baldwin [Fri, 11 May 2001 23:50:08 +0000 (23:50 +0000)]
Simplify the vm fault trap handling code a bit by using if-else instead of
duplicating code in the then case and then using a goto to jump around
the else case.
Brian Somers [Fri, 11 May 2001 23:42:03 +0000 (23:42 +0000)]
Bring the interface IFF_UP from ipcp_InterfaceUp() (called from IPCP's
TLU event handler).
This used to be done as a side effect of SIOCAIFADDR'ing the interface,
but now that duplicate SIOCAIFADDRs are optimised out, we can't depend
on that behaviour.
John Baldwin [Fri, 11 May 2001 23:17:54 +0000 (23:17 +0000)]
Simply the vm fault trap handling code a bit by using if-else instead of
duplicating code in the then case and then using a goto to jump around
the else case.
John Baldwin [Fri, 11 May 2001 23:17:05 +0000 (23:17 +0000)]
Allow sendsig() to hand the proc lock off to osendsig() rather than having
sendsig() release the lock just so it can call osendsig() and have
osendsig() acquire the lock.
Ian Dowse [Fri, 11 May 2001 20:42:41 +0000 (20:42 +0000)]
In vrele() and vput(), avoid triggering the confusing "missed vn_close"
KASSERT when vp->v_usecount is zero or negative. In this case, the
"v*: negative ref cnt" panic that follows is much more appropriate.
Bill Paul [Fri, 11 May 2001 20:15:41 +0000 (20:15 +0000)]
Disable the 'stats counter overflow' interrupts since they can happen
much more often that expected and negatively impact performance when
running at 100mbps. I need to figure out if there's a better way to
handle this, but for now this shouldn't hurt anything.
Bill Paul [Fri, 11 May 2001 19:56:39 +0000 (19:56 +0000)]
Add support for gigabit ethernet cards based on the NatSemi DP83820
and DP83821 gigabit ethernet MAC chips and the NatSemi DP83861 10/100/1000
copper PHY. There are a whole bunch of very low cost cards available with
this chipset selling for $150USD or less. This includes the SMC9462TX,
D-Link DGE-500T, Asante GigaNIX 1000TA and 1000TPC, and a couple cards
from Addtron.
This chip supports TCP/IP checksum offload, VLAN tagging/insertion.
2048-bit multicast filter, jumbograms and has 8K TX and 32K RX FIFOs.
I have not done serious performance testing with this driver. I know
it works, and I want it under CVS control so I can keep tabs on it.
Note that there's no serious mutex stuff in here yet either: I need
to talk more with jhb to figure out the right way to do this. That
said, I don't think there will be any problems.
This driver should also work on the alpha. It's not turned on in
GENERIC.
Kirk McKusick [Fri, 11 May 2001 07:40:39 +0000 (07:40 +0000)]
Update the fsck command in /etc/rc to use the new background
fsck checking. Applying these changes (typically via mergemaster)
will cause your system to start running background checks on all
your soft update enabled filesystems (provided that you have
a kernel with the required functionality, e.g., one built since
the end of April). Please report any and all problems to
mckusick@mckusick.com (not mckusick@freebsd.org which I read
infrequently). See the comment above the fsck command in /etc/rc
for instructions on how to disable background checking should it
cause you too much trouble.
Several FAQs:
1) Can I reboot before the background checks are done?
Ans) Yes, when the system restarts the checks will pick up
where they left off.
2) Can a crash during checking corrupt my filesystem?
Ans) No, recovered resources are returned to the system using soft
updates which ensure that the freeing is done in a safe order.
3) How will I know if any background checks are being done?
Ans) Filesystems that are to be checked in background will be listed
as `DEFER FOR BACKGROUND CHECKING' at the usual fsck check time
during system startup.
4) What happens to the output of the background checks?
Ans) It is sent to syslog `daemon' facility log level `notice'.
5) When will this feature be available in the 4.X kernel?
Ans) Never. It is much too radical and extensive a change to be
MFC'ed. Besides, it needs many months of experience and
tuning before it is ready for widespread use.
6) What happens if a background fsck fails (i.e., fsck finds
errors that would normally require a manual fsck)?
Ans) The filesystem will be marked as needing a manual fsck.
At the next system reboot, the check will be done in
foreground and the usual actions taken (usually a failure
to go multi-user until fsck has been run by hand on the
affected filesystem).
Bruce A. Mah [Thu, 10 May 2001 23:38:32 +0000 (23:38 +0000)]
New release notes: statfs(2) and df(1) track blocks committed to being
freed by softupdates, ifconfig(8) accepts CIDR notation, rc(8) clean-out
of /var/run and /var/spool/lock, c89(1) is now a binary, pax(1)
enhancements and cpio(1)/tar(1) compatability, Ukranian language console
support.
Other: Update/make (more) consistent the list of WaveLAN devices
supported.
John Baldwin [Thu, 10 May 2001 17:45:49 +0000 (17:45 +0000)]
- Split out the support for per-CPU data from the SMP code. UP kernels
have per-CPU data and gdb on the i386 at least needs access to it.
- Clean up includes in kern_idle.c and subr_smp.c.
Bill Paul [Thu, 10 May 2001 17:17:24 +0000 (17:17 +0000)]
Try to read the station address twice during the probe. I've seen
a LinkSys card here in the office where reading the station address
fails the first time, but works find afterwards. Without this, the
probe fails. I don't think this will negatively impact any existing
cards, but I want to confirm this before MFC'ing.
John Baldwin [Thu, 10 May 2001 17:03:03 +0000 (17:03 +0000)]
- Use sched_lock and critical regions to ensure that LDT updates are thread
safe from preemption and concurrent access to the LDT.
- Move the prototype for i386_extend_pcb() to <machine/pcb_ext.h>.