jhb [Wed, 18 Feb 2004 22:41:53 +0000 (22:41 +0000)]
Switch to using the new $PIR interrupt routing code and remove the old
code. The pci_cfgreg.c file now just controls reading/writing PCI config
registers.
jhb [Wed, 18 Feb 2004 22:40:23 +0000 (22:40 +0000)]
Rework the $PIR (aka PCIBIOS) PCI interrupt routing code and split it off
into its own file:
- All of the $PIR interrupt routing is now done in a link-centric fashion.
When a host-PCI bridge that uses the $PIR attaches, it calls pir_parse()
to parse the table. This scans for link devices and merges all the masks
for each link device from the table entries. It then looks at the intline
register of PCI devices connected to a link to figure out if the BIOS has
routed this link and if so to which IRQ.
- The IRQ for any given link can be overridden via a hint like so:
'hw.pci.link.0x62.irq=10' Any IRQ set in this matter is treated as if it
were set that way by the BIOS.
- We only call the BIOS to route each link device once.
- When a PCI device wants to route an interrupt, we look it up in the $PIR
to find the associated link. If the link is routed, we simply return the
IRQ it is using. If it is not routed, we have to pick one. This uses a
different algorithm from the old code. First off, when we try to pick
an interrupt from a mask of possible interrupts, we try to pick the one
that is least loaded as far as PCI devices. We maintain this weight based
on the number of devices attached to each link device. When choosing an
IRQ, we first attempt to route using any PCI only interrupts (the old
code did this as well). If that doesn't work, we try to use the list of
IRQs that the BIOS has used. This is a new step that the new code didn't
do and avoids using IRQ 3 or 4 for every virgin interrupt routing. If
none of the IRQs that the BIOS used worked, then we fall back to trying
anything.
- The fallback mask for !PC98 was fixed to include IRQ 3 and not allow IRQ
2.
- We don't use the $PIR to route interrupts on a PCI-PCI bridge unless it
has already been used to route on at least one Host-PCI bridge. This
helps to avoid mixing and matching x86 firmware PCI interrupt routing
methods (which is a Bad Thing(tm)).
des [Wed, 18 Feb 2004 21:37:36 +0000 (21:37 +0000)]
Fix printf() format bug in previous commit (size_t != int).
Use %ju and an (uintmax_t) cast to print size_t values.
Use %jd and an (intmax_t) cast to print off_t values.
Use off_t variables to hold the difference between two off_t values.
Don't bother with unsigned char where char will do nicely.
phk [Wed, 18 Feb 2004 21:36:53 +0000 (21:36 +0000)]
Change the disk(9) API in order to make device removal more robust.
Previously the "struct disk" were owned by the device driver and this
gave us problems when the device disappared and the users of that device
were not immediately disappearing.
Now the struct disk is allocate with a new call, disk_alloc() and owned
by geom_disk and just abandonned by the device driver when disk_create()
is called.
Unfortunately, this results in a ton of "s/\./->/" changes to device
drivers.
Since I'm doing the sweep anyway, a couple of other API improvements
have been carried out at the same time:
The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to
DISKFLAG_NEEDSGIANT
A version number have been added to disk_create() so that we can detect,
report and ignore binary drivers with old ABI in the future.
mtm [Wed, 18 Feb 2004 15:30:10 +0000 (15:30 +0000)]
There are consumers of rwlocks, inluding our own libc, that depend on
a PTHREAD_RWLOCK_INITIALIZER to do for rwlocks what
a similarly named symbol does for statically initialized mutexes.
This symbol was dropped in The Open Group Base Specifications Issue 6
and does not exist in IEEE Std 1003.1, 2003, but it should still be
supported for backwards compatibility.
mtm [Wed, 18 Feb 2004 15:26:00 +0000 (15:26 +0000)]
o Catch up with the mutex priority protocol fixes.
o Move pthread_getschedparam() into the same file with it's
pthread_set* counterpart. Copyright on both files is identical.
mtm [Wed, 18 Feb 2004 15:22:52 +0000 (15:22 +0000)]
o Style
o Instead of checking both the passed in pointer and its value
for NULL, only check the latter. Any caller that passes in
a NULL pointer is obviously wrong.
mtm [Wed, 18 Feb 2004 15:16:31 +0000 (15:16 +0000)]
o Refactor and, among other things, get rid of insane nesting levels.
o Fix mutex priority protocols. Keep separate counts of priority
inheritance and protection mutexes to make things easier.
This will not have much affect since this is only the
userland side, and the rest involves kernel scheduling.
des [Wed, 18 Feb 2004 15:12:00 +0000 (15:12 +0000)]
Revamp the statistics code, and switch to a much more compact display
format. The old code tried to produce the exact same output as the
pre-libfetch implementation, but I no longer see any value in this.
tjr [Wed, 18 Feb 2004 14:08:25 +0000 (14:08 +0000)]
Add partial support for large (>4GB) files on ext2 filesystems. This
support is partial in that it will refuse to create large files on
filesystems that haven't been upgraded to EXT2_DYN_REV or that don't
have the EXT2_FEATURE_RO_COMPAT_LARGE_FILE flag set in the superblock.
maxim [Wed, 18 Feb 2004 08:30:08 +0000 (08:30 +0000)]
o Fix a bridge example: sysctl net.inet.ip.forwarding=1 is needless,
bridge(4) is working on a level below. Suggest
sysctl net.inet.ip.check_interface=0 instead.
cperciva [Wed, 18 Feb 2004 05:18:27 +0000 (05:18 +0000)]
Fix misspellings in the freebsd-tips fortunes. The same PR has
a patch to mention portupgrade in freebsd-tips as well; I'm not
sure if that belongs here, so I'll leave it for someone else.
peter [Wed, 18 Feb 2004 00:54:17 +0000 (00:54 +0000)]
Checkpoint a hack to enable running i386 libc_r binaries on a 64 bit
kernel. I'm not happy with it yet - refinements are to come.
This hack allows the kern.ps_strings and kern.usrstack sysctls to respond
to a 32 bit request, such as those coming from emulated i386 binaries.
bde [Tue, 17 Feb 2004 11:11:10 +0000 (11:11 +0000)]
Backed out previous commit since it just causes panics unless a special
value for MSGBUF_SIZE is configured. MSGBUF_SIZE =
(32768 * bootverbose ? 2 : 1) is always 1 or 2, so there is not enough space
in the buffer for metadata, and blindly using the nonexistent space tends
to cause fatal pagefaults. I think
MSGBUF_SIZE = (32768 * (bootverbose ? 2 : 1)) would be always 32768 since
bootverbose is only statically initialized to 0 early when MSGBUF_SIZE is
used. MSGBUF_SIZE = (32768 * ((boothowto & RB_VERBOSE) ? 2 : 1)) should
work, but this belongs in <sys/msgbuf.h> even less than previous versions.
MSGBUF_SIZE shouldn't be a macro.
tjr [Tue, 17 Feb 2004 08:51:49 +0000 (08:51 +0000)]
If the "next free cluster" field of the FSInfo block is 0xFFFFFFFF,
it means that the correct value is unknown. Since this value is just
a hint to improve performance, initially assume that the first non-reserved
cluster is free, then correct this assumption if necessary before writing
the FSInfo block back to disk.
rwatson [Tue, 17 Feb 2004 05:10:12 +0000 (05:10 +0000)]
Add com5-com8 (cuaa4-cuaa7) to /etc/remote so they are available to
tip by default. On my systems, at least, pccard modems like to turn
up on higher addresses.
gad [Mon, 16 Feb 2004 20:18:25 +0000 (20:18 +0000)]
Add a 'realclean' target, which simply and quickly removes everything
that was built in previous 'make buildworld' and 'make buildkernel'. The
target knows enough to run a 'chflags -R 0' and a second 'rm' if the first
'rm' ran into any errors while removing files.
Suggested by: email with Richard Coleman Re: upcoming 64b-time_t changes.
Reviewed by: imp, marcel, and others on -hackers
MFC after: 1 week
des [Mon, 16 Feb 2004 20:07:06 +0000 (20:07 +0000)]
Remove -Wbad-function-cast. Its main purpose is to catch bugs that we
already catch with -Wstrict-prototypes, and it causes spurious warnings
for some perfectly legitimate constructs.
guido [Mon, 16 Feb 2004 17:09:53 +0000 (17:09 +0000)]
Fix type in a sysctl. It used to be: net.key.prefered_oldsa
and is corrected to net.key.preferred_oldsa
This makes it consistent with the KAME IPsec implementation.