Commit graph

37269 commits

Author SHA1 Message Date
Martin Blapp 91f8432fab SIS_CFG_EDB_MASTER_EN indicates the EDB bus is used instead of
the PCI bus. When this bit is set, the Max DMA Burst Size
for TX/RX DMA should be no larger than 64 bytes.

Reviewed by:	luoqi
Obtained from:	(idea from linux driver source)
MFC after:	2 weeks
2003-01-10 08:12:20 +00:00
Martin Blapp e808cf6260 When reading PHY regs over the i2c bus, the turnaround ACK bit
is read one clock edge too late. This bit is driven low by
slave (as any other input data bits from slave) when the clock
is LOW. The current code did read the bit after the clock was
driven high again.

Reviewed by:	luoqi
MFC after:	2 weeks
2003-01-10 08:09:58 +00:00
Marcel Moolenaar cc4a858397 o Improve wording of the comment that accompanies fs_pad. The
padding is not specific to non-i386 architectures. It is
   caused by non-i386 specific alignment requirements of
   fs_swuid,
o  Add a CTASSERT to catch a change in the size of struct fs
   at compile-time rather than run-time.

Ok'd: gordon
Tested on: i386 ia64
2003-01-10 06:59:34 +00:00
Warner Losh 948c244d94 Add preliminary support for the Hawking PN672TX CardBus cards.
# Preliminary because there are some subtle things the NetBSD driver does
# that we don't do yet.  My card works for me w/o them.
2003-01-10 05:37:15 +00:00
Jake Burkholder 4ee5222bac Don't allow user process to set an invalid window state through sigreturn.
Spotted by:	tmm
2003-01-10 00:04:56 +00:00
Thomas Moestl a9a7a91220 Clear the target hardware address field when generating an ARP request.
Reviewed by:	nectar
MFC after:	1 week
2003-01-10 00:04:53 +00:00
Gordon Tetlow 963cae780f Fix superblock alignment problems on non-i386 platforms. Also change fs_uuid
to fs_swuid, making it more descriptive.

Submitted by:	marcel
Reviewed by:	peter
Pointy hat to:	gordon
2003-01-09 23:53:30 +00:00
Eric Moore d163d5b8c8 Fix for DELL PERC firmware. Driver was hanging
during load time; this attributed to the mailbox
busy byte not being set prior to issuing a
polling command.

Approved by: ps
MFC: 7 days
2003-01-09 21:02:28 +00:00
Tom Rhodes 38deb45fc3 Add support for the Davicom DM9009 chipset.
PR:		46859
Submitted by:	Boaz Haberman <boaz@ool-182f8b09.dyn.optonline.net>
Approved by:	rwatson
2003-01-09 20:51:39 +00:00
John Baldwin 0d238da886 Remove earlysetcpuclass() as it has been OBE.
Suggested by:	bde
2003-01-09 19:59:28 +00:00
John Baldwin f85b149dae Rework part of the previous processor name changes so that we read
cpu_exthigh and cpu_brand in printcpuinfo() instead of in identify_cpu().
We also only do it for known-good values of cpu_vendor which is a bit more
conservative.

Reviewed by:	bde (mostly)
2003-01-09 19:54:49 +00:00
David E. O'Brien 73badb2452 Build gem(4) on powerpc also. 2003-01-09 16:37:37 +00:00
David E. O'Brien d16723e8e7 Moved if_hme to hme.
(I need a score card to keep track of the /sys layout fights)
2003-01-09 16:32:12 +00:00
David E. O'Brien 1c65ef9352 Add an hme(4) module.
PR:		46871
Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
2003-01-09 16:29:03 +00:00
Jake Burkholder be0800e85e Oops, add zstty to the witness order list.
Noticed by:	benno
2003-01-09 15:45:28 +00:00
Søren Schmidt 610e02649a Dont probe PnP devices.
Submitted by: Takahashi Yoshihiro <nyan@FreeBSD.org>
2003-01-09 14:00:07 +00:00
Søren Schmidt 2768d40bf1 Fix typo
PR: 45375
2003-01-09 13:54:07 +00:00
Benno Rice f13d93ce55 Make ofw_pci_find_node() use the reg property instead of the
assigned-addresses property. This works a lot better.
2003-01-09 12:24:19 +00:00
Benno Rice a65a280612 Add a pcib variant to allow us to fix up interrupt assignments.
We probably want to do something wrt bus enumeration as well at some point.
2003-01-09 12:04:18 +00:00
Hidetoshi Shimokawa 435dd29b27 - Add error messages for bulkxfer.
- Reduce register access.
2003-01-09 10:25:07 +00:00
Benno Rice 3599b2baf7 Allocate interrupts from the resource list. 2003-01-09 09:15:42 +00:00
Benno Rice 30081705c6 - Remove the ignore list and replace it with a quirk list of sorts.
- Add a quirk type for devices whose interrupt properties are actually
  attached to their children.
- Flag the "escc" (zs-alike serial controller) device as having this quirk.
- Rework the interrupt discovery code to deal with devices that have more than
  one interrupt.
2003-01-09 06:21:42 +00:00
Sam Leffler f7890744d0 Invoke the driver directly when a request is submitted via crypto_dispatch
or crypto_kdispatch unless the driver is currently blocked.  This eliminates
the context switch to the dispatch thread for virtually all requests.

Note that this change means that for software crypto drivers the caller
will now block until the request is completed and the callback is dispatched
to the callback thread (h/w drivers will typically just dispatch the op to
the device and return quickly).  If this is an issue we can either implement
a non-blocking interface in the s/w crypto driver or use either the
"no delay" flag in the crypto request or the "software driver" capability
flag to control what to do.

Sponsored by:	Vernier Networks
2003-01-09 05:39:04 +00:00
Sam Leffler 972136fa24 o handle jumbograms in m_clone
o fixup some comments

Submitted by:	Doug Ambrisko <ambrisko@verniernetworks.com>
2003-01-09 05:30:25 +00:00
Warner Losh 52b019b3ed Merge from NetBSD and arrange for FreeBSD's slight differences in
ucom.

This gets my Sanyo SCP-4900 working.

Approved by: joe
2003-01-09 04:24:28 +00:00
Peter Grehan 1fbe1353ad - remove unneeded includes
- fix big in use of rid for SYS_RES_IRQ
- catch up with ATA common code by adding lock function
2003-01-09 01:22:30 +00:00
Peter Grehan a5bd7d2982 Remove obsolete GEOM option, and bring diskless options up-to-date
Approved by:  benno
2003-01-09 01:09:41 +00:00
Thomas Moestl 2f28543e59 Include if_hme_sbus.c, so that the module can also be used on sbus
machines. Remove opt_bdg.h, which is not needed.
2003-01-09 00:46:41 +00:00
Thomas Moestl a0de7a9e73 Add detach, shutdown, suspend and resume methods.
Tested by:	jake
2003-01-09 00:45:10 +00:00
Jake Burkholder 5f7d4c49d3 Add sbus specific zs file. 2003-01-08 23:36:59 +00:00
Jake Burkholder 6bfa8a2ef2 Split this into bus specific front end(s), so that it can be used by ppc.
This abstracts out all the differences I could see between the netbsd
sparc64 and macppc zs drivers.   In particular the offsets of the csr and
data registers are different, so we use a separate bus handle for each and
use bus_space_subregion to add the bus specific offsets.

Requested by:	benno
2003-01-08 23:36:16 +00:00
Gordon Tetlow 291871da9e Steal some space from fs_fsmnt to create fs_volname and fs_uuid. The volname
will be used to support volume names with the help of a GEOM module (to be
committed). uuid will be used to deal with conflicting volume names (which
doesn't work just yet).

Approved by:	mckusick@
2003-01-08 22:53:54 +00:00
Thomas Moestl 28d187c626 Build a gem module, for sparc64 only for now. 2003-01-08 20:40:29 +00:00
Thomas Moestl cbbdf2367e Add detach, shutdown, suspend and resume methods. The latter two are
not really tested, but are derived from the original NetBSD version.
2003-01-08 20:12:45 +00:00
Alan Cox 9a032278bd In vm_page_alloc(), honor VM_ALLOC_ZERO for system and interrupt class
requests when the number of free pages is below the reserved threshold.
Previously, VM_ALLOC_ZERO was only honored when the number of free pages
was above the reserved threshold.  Honoring it in all cases generally
makes sense, does no harm, and simplifies the code.
2003-01-08 19:58:42 +00:00
John Baldwin 338633abf8 Consistently use spaces in between arguments to strcmp(). Whitespace
only.
2003-01-08 19:16:11 +00:00
David E. O'Brien ae5c9e57b8 Fix module dependancy name.
PR:		46871
Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
2003-01-08 18:53:38 +00:00
David E. O'Brien b1c519de65 Add an hme(4) module.
PR:		46871
Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
2003-01-08 18:45:04 +00:00
Hajimu UMEMOTO a5c8d51908 "struct route" is not sufficient. NetBSD PR 18751
Obtained from:	KAME
MFC after:	1 days
2003-01-08 17:59:24 +00:00
Søren Schmidt fb02f8eeb8 Dont attach a Promise chip located behind a i960 bridge/chip.
This makes it possible to run a Promise SuperTrak SX6000 with
OS type set to "Other" as well as "Linux".
2003-01-08 17:44:36 +00:00
Søren Schmidt 4b4f97ae4c Add support for the nVidia nForce2 ATA part.
Fix support for the nForce1 as well, registers are offset 0x10
against the AMD/VIA parts.
2003-01-08 16:51:41 +00:00
John Baldwin 5b1e7cb257 - Use cpu_exthigh instead of executing cpuid again to retrieve it for the
print_AMD_foo() functions.
- Add a brand name table for the brand index provided on Intel CPU's in
  %ebx after cpuid 1.
- For Intel CPUs, if we don't get a processor name from the extended cpuid
  then use the brand index in cpuid_cpuinfo to pick a name from the brand
  table and copy that name into cpu_brand.
- Replace the duplicated code to use the extended cpuid to replace
  cpu_model with the processor name in the AMD and Transmeta sections of
  printcpuinfo() with generic code that replaces cpu_model with
  cpu_brand if cpu_brand is not an empty string.  We also trim leading
  spaces from cpu_brand prior to doing this since at least some processor
  names (notably those of Intel CPUs) have leading spaces in the name.
- Give print_AMD_features() its own private regs[] array since
  printcpuinfo() doesn't use the one it has anymore.
2003-01-08 16:41:48 +00:00
John Baldwin 26aa6d02bf - Add a cpu_exthigh variable to hold the highest extended cpuid value
returned from cpuid 0x80000000.
- Add a cpu_brand char array to hold the processor name returned by
  cpuid 0x80000002-0x80000004 on AMD, Intel, Transmeta, and possibly
  other CPUs.
- Use cpuid to set cpu_exthigh and read the processor name if it is present
  in identify_cpu().
2003-01-08 16:35:59 +00:00
John Baldwin b33c8e3ded Bah, get the test for more than one logical CPU right so we don't bogusly
claim a CPU has HT support when it lists 0 or 1 logical CPU's per physical
processor.
2003-01-08 16:33:03 +00:00
Peter Grehan 7d13e76928 Add page queues locking to vunmapbuf().
Obtained from: sparc64
Approved by:  benno
2003-01-08 12:29:59 +00:00
Peter Grehan d2e30522fe Sync the i-cache after copying down the interrupt code
Approved by:  benno
2003-01-08 12:27:47 +00:00
Peter Grehan 9e283cf9a2 Be more conservative about re-enabling interrupts during trap processing
until atomic issues are fully sorted.

Approved by:  benno
2003-01-08 12:20:46 +00:00
Peter Grehan b744fccd8a Fix incorrect error returns and sign-extension.
Approved by:  benno
2003-01-08 12:19:37 +00:00
Peter Grehan 18ca618548 Fetch the initial time from the rtc OpenFirmware node. This is a short-term
measure until the rtc h/w driver is written, and it's a lot better
than having "jan 1 1970" on filesys times.

Approved by:  benno
2003-01-08 12:17:44 +00:00
Peter Grehan 6dacd14d2a Remove obsolete NFS_ROOT conditional.
Approved by:  benno
2003-01-08 12:15:54 +00:00
Peter Grehan dedc660361 Implement bus_dmamap_load_mbuf/bus_dmamap_load_uio.
Tested load_mbuf with GEM ethernet driver.

Submitted by: Hiten Pandya <hiten@unixdaemons.com> (modified by grehan)
2003-01-08 11:46:53 +00:00
Peter Grehan a5550be852 - define HAS_STREAM_METHODS correctly
- dmamap_load_mbuf/load_uio prototypes

Submitted partly by:  Hiten Pandya <hiten@unixdaemons.com>
2003-01-08 11:43:36 +00:00
Søren Schmidt 837832bc18 Add code that works around the problem that the older Promise
controllers (ultra/fasttrak-66/100) fails on 48bit accesses.
2003-01-08 10:03:31 +00:00
Scott Long adb0a47475 Destroy the management device when detaching the driver. 2003-01-08 06:30:34 +00:00
Matthew N. Dodd dd815daba5 - Add acpi module binding.
- Restore speed and format settings on resume for CS423x and
  CS423x-PCI devices.
2003-01-08 06:24:25 +00:00
David Xu ce5c58974a Retry to get full device descriptor, this let my slow CD Tower device work. 2003-01-08 05:03:35 +00:00
David Xu b47679ccff Some KSE syscalls are MPSAFE. 2003-01-08 04:57:53 +00:00
Jake Burkholder a6517875d0 Use bus_space_subregion to add offsets to bus handles instead of doing
it manually.
2003-01-08 04:30:30 +00:00
Jake Burkholder 88a8ca8569 Implement bus_space_subregion. 2003-01-08 04:29:00 +00:00
John Baldwin f4b4a64293 Enumerate logical hyperthread CPUs manually if they aren't already listed
in the mptable.  The way this works is that we determine if the system
has hyperthreading and how many logical CPU's should be in each physical
CPU by using the information returned by cpuid.  During the first pass of
the mptable, we build a bitmask of the APIC IDs of the CPUs listed in the
mptable.  We then scan that bitmask to see if the CPUs are already listed
by the mptable, or if there are any APIC IDs already in use that would
conflict with the APIC IDs of the logical CPUs.  If that test succeeds,
then we fixup the count of application processors.  Later on during the
second pass of the mptable we create fake processor entries for logical
CPUs and add them to the system.

We only need this type of fixup hack when using the mptable to enumerate
CPUs.  The ACPI MADT table properly enumerates all logical CPUs.
2003-01-08 01:33:18 +00:00
John Baldwin 5460753d55 If the boot processor supports hyperthreading and contains more than one
logical CPU, display the number of logical CPUs per physical processor
underneath the list of CPU features.
2003-01-08 01:23:16 +00:00
John Baldwin fa896b7280 Add a cpuid_cpuinfo variable to hold the results of %ebx from cpuid with
%eax of 1 and set it in identify_cpu().
2003-01-08 01:20:05 +00:00
John Baldwin 72a1e0e226 - Fix the name of the hyperthreading cpuid feature flag to be HTT instead
of HHT.
- Document fields returned in %ebx by a cpuid with %eax of 1.
2003-01-08 01:15:26 +00:00
Peter Wemm 2488f30980 Move the MOD_SHUTDOWN event from shutdown_post_sync to shutdown_final,
so that entities that want to use the post_sync hook to write stuff
to devices and other tidy-up can do so before the device tree is
shot down.  eg: da doing a SYNC_CACHE etc.  This should get crashdumps
working on mpt devices again, and stops the ia64 boxes locking up
on regular shutdown when da tries to issue the scsi commands to mpt.

Obtained from:  njl, gibbs
2003-01-07 22:24:13 +00:00
Brian Feldman c579babe54 In vn_open(), unset ndp->ni_vp when returning failure so that code
which expects it to be NULL unless the return value was 0 will work.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-07 20:59:55 +00:00
Alfred Perlstein a11acc6f8a Use copyout to access user memory.
Submittted by: pho
MFC After: 2 days
2003-01-07 20:10:04 +00:00
Alan Cox 1f17965656 Make bogus_offset local to bufinit(). 2003-01-07 19:55:08 +00:00
Prafulla Deuskar bddfcc8792 The README refers to a LICENSE file, so add that file too.
BTW the license is also embedded in the source files.

MFC after:	1 day
2003-01-07 19:36:00 +00:00
Poul-Henning Kamp c49bddce94 Fix warnings & errors caused by my last commit. 2003-01-07 19:09:10 +00:00
Kirk McKusick fa06a012cd This patch fixes a problem caused by applications that rapidly and
repeatedly truncate the same file. Each time the file is truncated,
a buffer is grabbed to store the indirect block numbers that need
to be freed. Those blocks cannot be freed until the inode claiming
them is written to disk. Thus, the number of buffers being held by
soft updates explodes and in extreme cases can run the kernel out
of buffers. The problem can be avoided by doing an fsync on the
file every debug.maxindirdep truncates (currently defaulted to 50).
The fsync causes the inode to be written so that the held buffers
can be freed. The check for excessive buffers is checked as part
of the existing hook for excessive dependencies (softdep_slowdown)
in the truncate code.

Reported by:	David Schultz <dschultz@uclink.Berkeley.EDU>
Sponsored by:   DARPA & NAI Labs.
MFC after:	3 weeks
2003-01-07 18:23:50 +00:00
John Baldwin 377a66bc40 Cast the integer read as the first argument for %b to an unsigned integer
so it's value is not sign extended when assigned to the uintmax_t variable
used internally by printf.  For example, if bit 31 is set in the cpuid
feature word, then %b would print out the initial value as a 16 character
hexadecimal value.  Now it only prints out an 8 character value.

Reviewed by:	bde
2003-01-07 18:17:18 +00:00
Hidetoshi Shimokawa 9a7d0adfaa - Fix print format for FreeBSD-4
- Reduce debug message.
2003-01-07 12:58:08 +00:00
David Xu 45f603e21c Clear some KSE fields after kse mode was turned off. 2003-01-07 06:56:43 +00:00
David Xu b81c4d1e8c Forgot to call setrunnable() for un-idled thread. 2003-01-07 06:04:33 +00:00
David Xu ea5ab16eba Check signals for idled threads. 2003-01-07 05:56:38 +00:00
Warner Losh d90656e720 We've had something like this file since 1992, so therefore this file
is a derivitive work, so the copyright notice in the file should say
1992-2003.
2003-01-07 04:37:40 +00:00
Hidetoshi Shimokawa 64666ed6e7 Don't call fw_bus_probe() twice when successive self-id packets received.
This change should stabilize SBP-II device probing.
2003-01-07 04:26:45 +00:00
John Polstra 029e2ee3ee Put the ASIC revision into the device description string so it appears
in the dmesg output.

MFC after:	3 days
2003-01-07 01:33:03 +00:00
Maxime Henrion d21682e5d3 o Only try to recopy the mbuf into an mbuf cluster if
bus_dmamap_load_mbuf() returned EFBIG.
o Fix mbuf leaks in an error (rare) code path.
o Reuse the TX descriptor if xl_encap() failed instead of
  just picking the next one.
o Better error messages.
2003-01-07 01:01:20 +00:00
John Polstra 671116122b Don't reference the maxlen and flags fields in the ring control blocks
as separate 16-bit entities.  Some of the ring control blocks are
in NIC memory, so they must be referenced using 32-bit accesses.
Smaller accesses have been observed to fail under some conditions.
This caused the rings to be set up wrong, leading to writes by the
card outside of the intended bounds of the rings.  This problem was
diagnosed by Michael Barthelow.  Don Bowman submitted a patch which
fixed the problem using a slightly different approach.

Reference ring control blocks in NIC memory using a pointer to
volatile.

Parenthesize the BGE_HOSTADDR macro definition properly.

MFC after:	3 days
2003-01-06 23:46:47 +00:00
Thomas Moestl 195530b9dd Convert to use bus_dmamap_load_mbuf(); decouple software TX descriptors
from the hardware descriptors to avoid the overhead of having a DMA
map for each of them. Bump the number of hardware descriptors to 128,
and use half as many software descriptors for now.
Some minor cleanups.
2003-01-06 22:12:57 +00:00
Thomas Moestl 305f2c0632 - Convert to use bus_dmamap_load_mbuf().
- remove DPRINTF(), there is a CTR*() for any of them, and KTR is
  far more useful to debug this driver.
- some cleanups; remove some unused code and definitions.
2003-01-06 22:09:01 +00:00
Thomas Moestl fe461235a2 Change the iommu code to be able to handle more than one DVMA area per
map. Use this new feature to implement iommu_dvmamap_load_mbuf() and
iommu_dvmamap_load_uio() functions in terms of a new helper function,
iommu_dvmamap_load_buffer(). Reimplement the iommu_dvmamap_load()
to use it, too.
This requires some changes to the map format; in addition to that,
remove unused or redundant members.
Add SBus and Psycho wrappers for the new functions, and make them
available through the respective DMA tags.
2003-01-06 21:59:54 +00:00
Sam Leffler 53d96a08a4 don't reference a pkthdr after M_MOVE_PKTHDR has "remove it"; instead
reference the pkthdr now in the destination of the move

Sponsored by:	Vernier Networks
2003-01-06 21:33:54 +00:00
Sam Leffler 0e7dea8326 purge extraneous clears of M_PKTHDR since M_MOVE_PKTHDR does this already 2003-01-06 21:29:27 +00:00
Sam Leffler 45a0c8fe56 fix memory allocation problems and collateral damage:
o create a separate tag for each object allocated with bus_dmamem_alloc so
  the tag's maxsize is setup appropriately; this reduces memory allocation
  for the queue descriptors from 16M to what it should be and also fixes
  memory allocation for public key operands
o release bus dma resources on detach so module usage doesn't leak
o remove public key op disable now that bus dma memory allocation is fixed
o collect attach error handling in one place

Sponsored by:	Vernier Networks
2003-01-06 21:23:06 +00:00
Thomas Moestl 702f83a807 - remove the unused parent DMA tag argument from
_nexus_dmamap_load_buffer()
- implement nexus_dmamap_load() in terms of _nexus_dmamap_load_buffer().
  Note that this is untested, as this code is not currently used (but
  might be later for UPA devices).
- move BUS_DMAMAP_NSEGS to bus_private.h
- disable the ecache flushing in nexus_dmamap_sync(); it should not be
  needed, although the docs are not entirely clear on that.
2003-01-06 20:54:07 +00:00
Poul-Henning Kamp 51a5c572a6 BSD disklabels expose the controling label though the 'c' partition, and
some trick is necessary to prevent further BSD geoms from attaching to
that.  Our old trick was to make sure we don't attach to a geom from
the "BSD" class, but this doesn't work if an intermediary geom obscures
this fact.  Instead, calculate the MD5 checksum of the label we target
and ask if anybody below us loves that label.  If they do we don't.

Coded by:       gordon.
2003-01-06 20:10:41 +00:00
Poul-Henning Kamp 72384683ad In userland case include <errno.h>, not <err.h>. This is needed to make
the src/tools/regression/geom stuff compile.
2003-01-06 20:05:45 +00:00
Thomas Moestl 0415010cbd Bump the IOMMU TSB size to 32kB, to match the default size on PCI
systems.
2003-01-06 19:48:31 +00:00
Thomas Moestl 08707f05a0 Prefix the members of struct bus_space_tag and struct bus_dma_tag with
a uniqifier. No functional changes.
2003-01-06 19:43:10 +00:00
Peter Wemm 586864e29d Back out last commit. 2003-01-06 19:30:21 +00:00
Sam Leffler bc0c6d3c99 correct flags passed when allocation crypto request structures so we
don't block and the returned data is zero'd
2003-01-06 18:52:05 +00:00
Thomas Moestl 7f349cb889 Style and comment fixes, no functional changes. 2003-01-06 17:35:40 +00:00
Thomas Moestl 6cf280f100 Look for the correct method in sparc64_dmamap_load_mbuf() and
sparc64_dmamap_load_uio().
2003-01-06 17:17:26 +00:00
Thomas Moestl 8286df3339 Initialize the cache line size register of all PCI devices in the
initial setup pass.
2003-01-06 17:12:23 +00:00
Thomas Moestl 5b398f68ee Some cleanup:
- move some constants into iommureg.h
- correct some comments
- use KASSERT() in one place instead of rolling our own
- take a sanity check out of #ifdef DIAGNOSTIC
- fix a syntax error in normally #ifdef'ed out debug code
2003-01-06 17:10:07 +00:00
Thomas Moestl 3a68043d39 - remove some outdated comments
- tweak the announce message a bit
- remove '\n's from a few panic() calls
- don't use the DVMA base adress the firmware reports; instead, figure
  it out from the appropriate register on Sabres and let the IOMMU code
  choose it on Psychos. This also makes the IOMMU TSB size freely
  selectable.
2003-01-06 16:51:06 +00:00
Thomas Moestl 7bee014426 1.) fix a copy-and-paste-o in a panic() message
2.) pass the requesting child device (instead of the bus one) up when
    handling interrupt resources
3.) remeber to mark the resource list entry as unused in
    sbus_release_resource().

Reported by:	scottl (3)
2003-01-06 16:36:05 +00:00
Mike Barcroft f08294ced0 Bah, just use %zu for printing size_t. 2003-01-06 16:31:39 +00:00
Yoshihiro Takahashi 97a45538e4 Add SCSI MO device support.
Submitted by:	Kawanobe Koh <kawanobe@st.rim.or.jp>
2003-01-06 13:43:15 +00:00
Jacques Vidrine f0c093284d Correct file descriptor leaks in lseek and do_dup.
The leak in lseek was introduced in vfs_syscalls.c revision 1.218.
The leak in do_dup was introduced in kern_descrip.c revision 1.158.

Submitted by:	iedowse
2003-01-06 13:19:05 +00:00
Maxime Henrion b247d66171 Fix warnings on 64bits architectures.
Noticed by:	alpha tinderbox
2003-01-06 12:07:38 +00:00
Peter Wemm 9bae481c37 Move dashutdown from SHUTDOWN_PRI_DEFAULT to SHUTDOWN_PRI_FIRST.
Otherwise, the scsi devices that it is trying to issue commands to may
have gone away.  This is what caused shutdown to hang on ia64 systems
with mpt scsi controllers.  The bus system has torn down the device tree
and reset the mpt controller etc, and suddenly along comes dashutdown
and wants to issue a few more scsi commands....  <HANG!>

This shouldn't work on i386 either, but it seems to work solely due
to luck.
2003-01-06 08:28:15 +00:00
Hidetoshi Shimokawa 17faeefca6 Use device_printf() and s/fc->dev/fc->bdev/. 2003-01-06 08:07:20 +00:00
Poul-Henning Kamp 578c478621 This is all "#if defined(__i386__) && __GNUC__ >= 2":
Add support for GCC's --test-coverage --profile-arcs options.

Add code to call the functions listed in the .ctors section, these are
used to string the per .o file counter blocks into a linked list.

Add empty __bb_fork_func() to cope with GCC magic gandling of exec*()
named functions.

To add support for other platforms should be trivial, but involves
determining the exact data-types gcc uses on that platform.
2003-01-06 07:40:49 +00:00
Poul-Henning Kamp 3fc473df24 Add two symbols start_ctors and stop_ctors to allow us to find the
.ctors section so we can call the constructors.
2003-01-06 07:37:15 +00:00
Hidetoshi Shimokawa 9bfd777adb Fix fc->dev to fc->bdev. 2003-01-06 05:57:48 +00:00
David E. O'Brien 9e0fd32c0b Add the POSIX sanctioned "LOGIN_NAME_MAX" -- Maximum length of a login name.
Minimum Acceptable Value: _POSIX_LOGIN_NAME_MAX.
The comments at the bottom of this file claim sysconf(3) provides this value,
but it seems sysconf(3) hasn't implemented this yet.
2003-01-06 04:33:47 +00:00
Mike Barcroft ea4c7ada01 Cast return values of sizeof() to int so they can be printed with %d.
The size of this struct is unlikely to ever grow beyond what an int
can represent.

Noticed by:	alpha tinderbox
2003-01-06 04:33:46 +00:00
Marcel Moolenaar f40614b8aa Move ia64_sapics and ia64_sapic_count from interrupt.c to sapic.c
and declare them extern in interrupt.c. This eliminates the need
for ia64_add_sapic(), which is called from sapic.c.
While here, reformat ia64_enable() in interrupt.c to improve
indentation and add a sysctl (machdep.apic) to dump the I/O APIC
entries currently programmed into all I/O APICs. The latter can
help analyze interrupt problems.
Note that the sysctl is not intended as a userland (software)
interface. It may be changed in the future to include counters
so that vmstat -i can make use of it. It may also be removed...
2003-01-06 02:09:08 +00:00
Mike Silbersack 81f045c0d2 Ooops, use the full name of XL_FLAG_EEPROM_OFFSET_30
Noticed by:	Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk>
2003-01-06 01:55:12 +00:00
Peter Wemm 839c70593f Move the itm reload to a single place rather than having two identical
copies of the reload.  Note that we use the precomputed itm_reload value
so that we can avoid a division in the kernel.  The ia64 cpu does not
have integer divide, so this would have been done by a floating point
operation.
2003-01-06 01:53:55 +00:00
Marcel Moolenaar cbb095815a Replace the hardcoding of 255 as the clock interrupt vector with
CLOCK_VECTOR and define it as 254, not 255. Vector 255 is already
in use as the AP wakeup vector on the HP rx2600.

This needs to be made more dynamic. The likelyhood of vector 254
being in use is pretty small, but we already have code to assign
vectors to IPIs (see sal.c) and it's preobably better to have a
centralized "vector manager" that hands out vectors based on
some imput (like priority).
2003-01-06 01:39:25 +00:00
Peter Wemm ff29255673 Explicitly have the timecounter init happen after the cpu_initclocks is
called.  Otherwise (depending on a non-deterministic sort), the timecounter
code can be initialized before the clock rate has been set (on ia64) and it
assumes hz = 100, rather than the real value of 1024.  I'm not sure how much
gets upset by this.

Glanced at by:	phk
2003-01-06 01:01:08 +00:00
Mike Silbersack 9363b90153 Add support for the 3c555 miniPCI chipset.
Submitted by:	johannes <johannes@paradise.net.nz>
PR:		46603
MFC after:	3 days
2003-01-06 00:46:03 +00:00
Marcel Moolenaar de09ec92e6 Manually inline handleclock(). There's only a single caller and
handleclock itself is trivial.

While here, replace (itc_frequency+hz/2)/hz with itm_reload for
consistency. There's now a single place where we determine the
ITM reload value.
2003-01-06 00:38:35 +00:00
Mike Silbersack e7e21ec663 Add two MII_SETs to provide a bit more time between operations in
xl_sync; this appears to be necessary with certain systems.

Requested by:	Michael Class <michael_class@gmx.net>
2003-01-06 00:36:13 +00:00
Marcel Moolenaar 0d6d96ea78 Count interrupts as soon as possible. This makes sure interrupts are
counted even when there are no handlers.
2003-01-06 00:25:31 +00:00
Sam Leffler 2268ca475b correct pkthdr length calculation for ipv6 echo packets; after moving a packet
header with M_MOVE_PKTHDR one should not reference the packet header in the
original packet; in this case the code was assuming that m_adj would alter
m_pkthdr.len which stopped happening because M_MOVE_PKTHDR removes the
M_PKTHDR bit from m_flags

Submitted by:	Bill Fenner <fenner@research.att.com>
2003-01-05 22:37:36 +00:00
Marcel Moolenaar c58d580e70 Don't hardcode the address of the local (S)APIC (aka processor
interrupt block). We use the previously hardcoded address as a
default only, but will otherwise use whatever ACPI tells us.
The address can be found in the MADT table header or in the
LAPIC override table entry.
2003-01-05 22:14:30 +00:00
Poul-Henning Kamp ea4804130a Fix cut&paste bug which would result in a panic because buffer was
being biodone'ed multiple times.
2003-01-05 22:01:08 +00:00
Marcel Moolenaar ff263ea2dc Bump the number of interrupts from 65 to 257. This is a waste of
space most of the time, but handles machines with lots of I/O
(S)APICs. We cannot make this more dynamic without breaking the
interface with vmstat. Hence, we need to fix the interface first.
2003-01-05 22:00:19 +00:00
Marcel Moolenaar 671f297efb Handle 3-digit interrupt numbers (vectors). While here, change the
name of unused entries from "intr XXX" to "#XXX". This makes it
easier to debug interrupt problems, because vmstat can be hacked
more easily to dump all interrupt entries that are in use and not
those that have had interrupts.
2003-01-05 21:48:33 +00:00
Marcel Moolenaar d291811a6a Make all memory I/O addresses (explicitly) 64-bit. Memory mapped
devices aren't necessarily mapped within 4GB. I/O port addresses
are offsets into the memory mapped I/O port space, which is not
larger than 16MB. No need to convert those to 64 bit types.
2003-01-05 21:40:45 +00:00
Jake Burkholder 69a0015af3 Tweaks to make if_rl work on sparc64.
Mostly submitted by:	tmm
Tested on:		i386, sparc64
2003-01-05 21:36:59 +00:00
Marcel Moolenaar aa063fddbf Provide a null-implementation for bus_space_unmap, like i386.
bus_space_unmap is required for puc(4).
2003-01-05 21:34:05 +00:00
Poul-Henning Kamp 5266a767e5 Convert VOP_STRATEGY to VOP_SPECSTRATEGY in the generic getpages and
the pager input for small filesystems.
2003-01-05 20:32:03 +00:00
Poul-Henning Kamp 7a976ae838 Don't override the vop_lock, vop_unlock and vop_isunlocked methods.
Previously all filesystems which relied on specfs to do devices
would have private overrides for vop_std*, so the vop_no* overrides
here had no effect.  I overlooked the transitive nature of the vop
vectors when I removed the vop_std* in those filesystems.

Removing the override here restores device node locking to it's
previous modus operandi.

Spotted by:	bde
2003-01-05 19:14:44 +00:00
Alan Cox 9ce904432a Allocate bogus_page with VM_ALLOC_WIRED. (Previously, bogus_page's
allocation incremented the global count of wired pages, but not the
page's own wire count.  This inconsistency was introduced in
revision 1.230.)
2003-01-05 18:46:13 +00:00
Mike Barcroft 51afc2ad43 Avoid casting pointers to int and using %x to print them.
Noticed by:	alpha tinderbox
2003-01-05 16:23:49 +00:00
Hidetoshi Shimokawa a423957600 Reduce diff to RELENG_4. 2003-01-05 14:58:45 +00:00
Bill Fenner 2b0e597682 Fix alignment problems -- the embedded v4 address is guaranteed to
be only 16-bit aligned, so only do byte operations to compare with it.
2003-01-05 14:03:26 +00:00
Alfred Perlstein a09de2f7cd In sodealloc(), if there is an accept filter present on the socket
then call do_setopt_accept_filter(so, NULL) which will free the filter
instead of duplicating the code in do_setopt_accept_filter().

Pointed out by: Hiten Pandya <hiten@angelica.unixdaemons.com>
2003-01-05 11:14:04 +00:00
Poul-Henning Kamp f576a06e22 Don't take the detour over VOP_STRATEGY from spec_getpages, call our
own strategy directly.
2003-01-05 10:03:57 +00:00
Poul-Henning Kamp 973418dbf5 Split out the vnode and buf arguments to the internal strategy worker
routine instead of doing evil casts.
2003-01-05 09:55:26 +00:00
Hidetoshi Shimokawa bda19384a1 Syntax fix in fwohci_pci_suspend(). 2003-01-05 09:12:47 +00:00
Jeffrey Hsu b21bf9a59b Validate inp before de-referencing it.
Submitted by:	pb
2003-01-05 07:56:24 +00:00
Brian Feldman a8be3e63ce Fix the duplicate unlock of the pcm read channel in certain cases.
Reviewed by:	cg
2003-01-05 07:32:33 +00:00
Hidetoshi Shimokawa 94b6f028fd - Change definition of fc->maxrec same as fwdev->maxrec.
- 'spec' and 'ver' are attributes of a unit rather than a node.
- Report Phy and Link info separatelly.
- Reorder intialization step in fwohci_reset().
2003-01-05 06:21:30 +00:00
Jake Burkholder e8237e53da - Reorganize PMAP_STATS to scale a little better.
- Add some more stats for things that are now considered interesting.
2003-01-05 05:30:40 +00:00
Jake Burkholder a720ae1bbe Sync with zs.
- Fix some bogosity with mixing unit numbers and channels, which would only
  work for one instance of the device.
- Use a simpler scheme for input and output queueing.
- Use db_alt_break.
2003-01-05 04:07:31 +00:00
Jake Burkholder 3afb575773 Make imgact_elf32.c compile on sparc64.
Obtained from:	ia64
2003-01-05 03:48:55 +00:00
Jake Burkholder e548a1d4c8 - Provide backwards compatibility for kern.fallback_elf_brand.
- Use the generic elf type macros in imgact_elf.h instead of ifdefing the
  entire contents of the header.
2003-01-05 03:48:14 +00:00
Alan Cox 6c4952c7b4 Use atomic add and subtract to update the global wired page count,
cnt.v_wire_count.
2003-01-05 01:31:45 +00:00
Tim J. Robbins a3ebcd98e1 Repair vnode locking in portal_lookup(). Specifically, lock the file
vnode, and unlock the parent directory vnode if LOCKPARENT is not set.

Obtained from:	NetBSD (rev. 1.34)
2003-01-05 00:46:01 +00:00
Marcel Moolenaar 518a75ea1c Adopt, adapt and improve:
o  Make the URL of the handbook match reality
o  Improve some comments (either wording or formatting)
o  Sync with i386: comment-out DDB, INVARIANTS, INVARIANT_SUPPORT
o  Add some more SCSI/RAID controllers:
	ahd, mpt, asr, ciss, dpt, iir, mly, ida
o  Remove support for the parallel port
o  Add NICs: em, bge
o  Remove NICs: ste, tl, tx, vr, wb
o  Enable USB support again, except of the UHCI host controller.
   UHCI still hangs the BigSur (=HP i2000) machines, and makes
   them useless. The OHCI controller works fine. Note that newer
   ia64 boxes based on the Intel host controllers (UHCI or EHCI)
   still won't have USB support. We really need to import the
   EHCI host controller from NetBSD...
2003-01-05 00:04:28 +00:00
Poul-Henning Kamp f5b11b6e2d Temporarily introduce a new VOP_SPECSTRATEGY operation while I try
to sort out disk-io from file-io in the vm/buffer/filesystem space.

The intent is to sort VOP_STRATEGY calls into those which operate
on "real" vnodes and those which operate on VCHR vnodes.  For
the latter kind, the call will be changed to VOP_SPECSTRATEGY,
possibly conditionally for those places where dual-use happens.

Add a default VOP_SPECSTRATEGY method which will call the normal
VOP_STRATEGY.  First time it is called it will print debugging
information.  This will only happen if a normal vnode is passed
to VOP_SPECSTRATEGY by mistake.

Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY
does on a VCHR vnode today.

Add a new VOP_STRATEGY method in specfs to catch instances where
the conversion to VOP_SPECSTRATEGY has not yet happened.  Handle
the request just like we always did, but first time called print
debugging information.

Apart up to two instances of console messages per boot, this amounts
to a glorified no-op commit.

If you get any of the messages on your console I would very much
like a copy of them mailed to phk@freebsd.org
2003-01-04 22:10:36 +00:00
Jake Burkholder a360a43dd5 Improve the way that an elf image activator for an alternate word size is
included in the kernel.  Include imgact_elf.c in conf/files,  instead of
both imgact_elf32.c and imgact_elf64.c, which will use the default word
size for an architecture as defined in machine/elf.h.  Architectures that
wish to build an additional image activator for an alternate word size can
include either imgact_elf32.c or imgact_elf64.c in files.${ARCH}, which
allows it to be dependent on MD options instead of solely on architecture.

Glanced at by:	peter
2003-01-04 22:07:48 +00:00
Poul-Henning Kamp 3c3871e5e6 Introduce the
void backtrace(void);
function which will print a backtrace if DDB is in the kernel and an
explanation if not.

This is useful for recording backtraces in non-fatal circumstances and
does not require pollution with DDB #includes in the files where it
is used.

It would of course be nice to have a non-DDB dependent version too,
but since the meat of a backtrace is MD it is probably not worth it.
2003-01-04 20:54:58 +00:00