Commit Graph

38186 Commits

Author SHA1 Message Date
Olivier Houchard
d6bf23783f Remove duplicate includes.
Submitted by:	Cyril Nguyen-Huu <cyril@ci0.org>
2003-02-20 03:26:11 +00:00
Olivier Houchard
f5ca18bc8c Merge diff between rev 1.08 and rev 1.11 of Tekram driver, this notably add
support for Tekram DC395U2W cards.
Add a fix submitted by joerg@ to correctly report some errors to CAM.
Use bus_dma instead of the remaining vtophys().
2003-02-20 03:21:34 +00:00
Bosko Milekic
ec73437395 Fix a serious bug when computing the index for the
reference counter array for mbuf clusters.  I don't know
how this got past early testing nor how it survived so long
without getting caught.  If anyone was seeing really really
bizarre memory corruption in a few mbufs this would be why.
2003-02-20 03:01:04 +00:00
Peter Grehan
9ec2814126 Adjust IRQ count for psim's OpenPIC model - it seems to be
off by 1.
2003-02-20 01:59:42 +00:00
Peter Grehan
c0bf6c1f26 Catch up to latest KSE changes 2003-02-20 01:57:49 +00:00
David Xu
a87891ee9e Move thread limits testing code up a bit. This let UPCALLING thread
takes possible accumulated contexts away.
2003-02-20 01:11:17 +00:00
Jonathan Lemon
ffae8c5a7e Unbreak non-IPV6 compilation.
Caught by: phk
Sponsored by: DARPA, NAI Labs
2003-02-19 23:43:04 +00:00
Scott Long
cb0d64b9b9 Fix a 64-bit bogon. The hardware command structure only has one 32 bit
field for holding driver-dependant data.  Instead of putting the pointer
to the driver command struct in there, take advantage of these structs
being a (virtually) contiguous array and just put the array index in the
field.
2003-02-19 23:33:56 +00:00
Poul-Henning Kamp
0c977c9c53 Add M_WAITOK 2003-02-19 22:51:33 +00:00
Jonathan Lemon
340c35de6a Add a TCP TIMEWAIT state which uses less space than a fullblown TCP
control block.  Allow the socket and tcpcb structures to be freed
earlier than inpcb.  Update code to understand an inp w/o a socket.

Reviewed by: hsu, silby, jayanth
Sponsored by: DARPA, NAI Labs
2003-02-19 22:32:43 +00:00
Jonathan Lemon
7990938421 Convert tcp_fillheaders(tp, ...) -> tcpip_fillheaders(inp, ...) so the
routine does not require a tcpcb to operate.  Since we no longer keep
template mbufs around, move pseudo checksum out of this routine, and
merge it with the length update.

Sponsored by: DARPA, NAI Labs
2003-02-19 22:18:06 +00:00
Scott Long
9c3a7fce37 Make the aac driver be INTR_MPSAFE. Once the interrupt handler determines
that a command completion happened, all further processing is deferred to
a taskqueue.  The taskqueue itself runs implicetely under Giant, but we
already used a taskqueue for the biodone() processing, so this at least
saves the contesting of Giant in the interrupt handler.
2003-02-19 21:58:34 +00:00
Scott Long
8480cc638e o Move the cleanup of the fib maps into aac_free_commands() so as to
retain symetry with aac_alloc_commans().  Since aac_alloc_commands()
  allocates fib maps and places them onto the fib lists, aac_free_commands()
  should reverse those operations.

o Combine two ifs with the same body with an ||.

o Switch from uintptr_t to uint32_t for fib map load operations.
  The target is a uint32_t so using this type for the map load call
  avoids an extra cast.  uintptr_t should only be used when you need
  an "int sized the same as the machine's poitner size" which is not
  the case here.

o Removed the commented out M_WAITOK flag in the allocation in
  aac_alloc_commands().  The kernel will only block in the allocator
  if it can grow the size of the kernel.  This usually results in a
  page-out which could involve this aac device.  Thus, sleeping here
  could deadlock the machine.  Assuming this operation is occurring outside
  of attach time, we have enough fibs to operate anyway, so waiting for
  fibs to free up is okay if not optimal.

o In aac_alloc_commands(), if we cannot dmamem_alloc additional fib
  space, free the fib map.

o In aac_alloc_commands(), if we cannot create per-command dmamaps, don't
  lose track of the fib map that is mapping all of the commands that we
  have already released into the free pool.  Instead, just cut out of
  the loop and modify aac_free_commands to not attempt to free maps that
  have not been allocated.

o Don't use a magic number when pre-allocating fibs.

o Use PAGE_SIZE to allocate in page sized chunks instead of an
  architecture specific constant.

Submitted by: gibbs
2003-02-19 21:38:29 +00:00
Jonathan Lemon
414462252a Correct comments. 2003-02-19 21:33:46 +00:00
Jonathan Lemon
3bfd6421c2 Clean up delayed acks and T/TCP interactions:
- delay acks for T/TCP regardless of delack setting
   - fix bug where a single pass through tcp_input might not delay acks
   - use callout_active() instead of callout_pending()

Sponsored by: DARPA, NAI Labs
2003-02-19 21:18:23 +00:00
Poul-Henning Kamp
ec20bdf897 #include "opt_cpu.h" so we notice our options. 2003-02-19 20:50:02 +00:00
Jake Burkholder
367a0516d8 Fix definite panic when releasing interrupt resources.
Spotted by:	tmm
2003-02-19 19:40:40 +00:00
Maxime Henrion
5e303db539 Fix panic on sparc64 introduced in my last commit. I really
wish the busdma APIs were more consistent accross architectures.

We should probably move all the other DMA map creations in
xl_attach() where we can really handle them failing, since
xl_init() is void and shouldn't fail.

Pointy hat to:	mux
Tested by:	Anders Andersson <anders@hack.org>
2003-02-19 18:33:29 +00:00
Jake Burkholder
b41be772ad Missed a missing M_WAITOK. 2003-02-19 17:29:07 +00:00
Jake Burkholder
a5902eaf0c Use M_WAITOK. 2003-02-19 17:25:58 +00:00
David Xu
fc8cdd87d2 Count non-threaded group. 2003-02-19 13:40:24 +00:00
David Xu
4f6cfa4520 Update comments to reflect new KSE code. 2003-02-19 13:36:51 +00:00
Tim J. Robbins
6dae0c1e3e Do not call smbfs_attr_cacheremove() in the EXDEV case in smbfs_rename().
One of the vnodes is on different mount and is possibly on a different
kind of filesystem; treating it as an smbfs vnode then writing to it
will probably corrupt it.

PR:		48381
MFC after:	1 month
2003-02-19 11:54:35 +00:00
Tim J. Robbins
a44a414e11 The "m = m->m_next" that was removed in the revision 1.12 was necessary
for the m->m_next != NULL case to avoid looping infinitely when the first
mbuf in the chain becomes full.
2003-02-19 10:12:42 +00:00
David Xu
30621e142d M_WAITOK and remove an useless comment. 2003-02-19 09:59:12 +00:00
Jake Burkholder
eba43df47a Munge the zs sbus attachment to work with fhc. This is a bit of a hack,
but they would otherwise be almost identical so there's not much point in
splitting it up further.
2003-02-19 08:29:17 +00:00
Jake Burkholder
63ec9d57c9 Implement interrupt resource allocation and setup. Set the interrupt
group number properly based on the board id.  Perform dummy reads of
registers after writing to flush the hardware write buffers.

This gets the soon to be committed zs attachment working.
2003-02-19 08:23:38 +00:00
David Xu
9de9159822 Eliminate unused KSE symbols. 2003-02-19 06:59:00 +00:00
Poul-Henning Kamp
a23c180ec5 Bump __FreeBSD_version to mark the fact that <sys/dkstat.h> should no longer
be included.
2003-02-19 06:32:52 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
David Xu
0252d20369 Optimize the case when max threads number was hit. 2003-02-19 04:01:55 +00:00
Peter Wemm
bbf9145de3 Remove unused variable and code. 2003-02-19 00:32:01 +00:00
Peter Wemm
169ade77af Get rid of a silly message I added back in Sept 2001 (1.68). 2003-02-18 23:45:01 +00:00
Paul Saab
2648ded594 Add some PCI device ID's from HP 2003-02-18 21:53:44 +00:00
Warner Losh
51715fe79d Move the resource handling down into the pci bus as well.
Minor CIS resource allocation code cleanup
Remove some fairly useless debug writes.

This finishes the work to move as much cardbus code as possible into
pci.  We wind up removing 800-odd lines from cardbus.c: we go from
1285 to 400 lines.

Reviewed by: mdodd
2003-02-18 21:24:00 +00:00
Maxime Henrion
44250c5cd8 - Fix mbuf leak when we successfully allocate a new mbuf but fail to
bus_dmamap_load() it.
- Make it so reusing mbufs when we can't allocate (or map) new ones
  actually works.  We were previously trying to reuse a mbuf which
  was already bus_dmamap_unload()'ed.

Reviewed by:	silby
2003-02-18 18:50:54 +00:00
Hidetoshi Shimokawa
d5e6895166 Fix fwdev memory leak on detaching. 2003-02-18 10:56:00 +00:00
Hidetoshi Shimokawa
69f034dae4 Use pci_get_devid(). 2003-02-18 10:01:44 +00:00
Hidetoshi Shimokawa
12f2a2958b Add 'uPD72871/2 IEEE1394 1-Chip OHCI Host Controller'. 2003-02-18 09:46:52 +00:00
Hidetoshi Shimokawa
1adf684228 * firewire.c
- Fix memory leak in detaching.
- Initialize fc->status to other than FWBUSREST.

* fwohci.c
- Ignore BUS reset events while BUS reset phase. We can't clear that flag
	during bus reset phase.
2003-02-18 09:39:48 +00:00
Jake Burkholder
cce6f96a05 Add central and fhc. 2003-02-18 09:38:51 +00:00
Jake Burkholder
012d9539bf Add drivers for the central and fhc busses found in enterprise class
UltraSPARCs, and an eeprom attachment for fhc, which allows the date
to be set properly on these machines.  Central is a wierd bus which
seems to only ever have 1 fhc attached to it.   FHC (FireHose Controller)
is another wierd bus with various things on it depending where its attached.
The fhc attached to central has eeprom and zs, and the fhcs which attach
directly to nexus have simm-status, environment and other nodes, none of
which I'll probably ever have documentation for.

Thanks to Ade Lovett for providing access to an 8 cpu e4500.
2003-02-18 09:01:01 +00:00
Sam Leffler
0bbd84e2d0 remove stray debugging printf
Noted by:	Kasper Steensgaard <steensgaard@person.dk>
2003-02-18 06:25:46 +00:00
Sam Leffler
5c47350dad M_MOVE_PKTHDR must happen before any cluster is attached
Submitted by:	Harti Brandt <brandt@fokus.fraunhofer.de>
MFC after:	1 day
2003-02-18 06:20:16 +00:00
Peter Wemm
af3d516f55 Initiate de-orbit burn for USE_PCI_BIOS_FOR_READ_WRITE. This has been
#if'ed out for a while.  Complete the deed and tidy up some other bits.

We need to be able to call this stuff from outer edges of interrupt
handlers for devices that have the ISR bits in pci config space.  Making
the bios code mpsafe was just too hairy.  We had also stubbed it out some
time ago due to there simply being too much brokenness in too many systems.
This adds a leaf lock so that it is safe to use pci_read_config() and
pci_write_config() from interrupt handlers.  We still will use pcibios
to do interrupt routing if there is no acpi.. [yes, I tested this]

Briefly glanced at by:  imp
2003-02-18 03:36:49 +00:00
Warner Losh
2c422e4625 Include class designation in pnpinfo for generic driver loading 2003-02-18 03:25:57 +00:00
Scott Long
72d3502e50 Sanity check the BAR length reported by the CIS with the BAR length that
is encoded in the PCI BAR.  The latter is more reliable.

This allows the sio/modem function of the Xircom RealPort ethernet+modem
card to work.  Note that there still seem to be issues with sio_pci not
releasing resources on detach.
2003-02-17 23:47:31 +00:00
Warner Losh
5794c59372 Move the pnp and location info into the common pci bus. Make all known
pci busses implement this.

Also minor comment smithing in cardbus.  Fix copyright to this year
with my name on it since I've been doing a lot to this file.

Reviewed by: jhb
2003-02-17 21:20:35 +00:00
Warner Losh
1493e06d04 an driver now needs wlan, so put the required explicit depends
into the source.

Reviewed by: ambrisko
2003-02-17 19:57:32 +00:00
Warner Losh
29575b16f5 Kill a now-bogus comment 2003-02-17 19:48:39 +00:00
Warner Losh
180811460d These don't need to be semi-public after all. 2003-02-17 19:47:02 +00:00
Warner Losh
016f481986 Bump pnpinfo and location size to 128 bytes. Since these are computed
on the fly and read into userland one at a time, this costs very
little total memory.  The pnpinfo sizes of pccard is more than 64
bytes due to the length of the strings that man cards have in their
CIS.
2003-02-17 19:01:33 +00:00
David Xu
88aba94cdc Further fix PS_NEEDSIGCHK 2003-02-17 14:54:57 +00:00
David Xu
02bbffaf3c Move code for detecting PS_NEEDSIGCHK into thread_schedule_upcall,
I think it is a better place to handle it.
2003-02-17 14:41:22 +00:00
Hidetoshi Shimokawa
f918ec7bac * firewire.c
- Don't initiate bus reset even if probe failed for some nodes to prevent
	infinite bus reset loop.

Problem Reported by: Pierre Beyssac <pb@fasterix.frmug.org>

- Protect timeout routine with splfw() for 4-stable.

* sbp.c

- Make sure to release devq when start request.
2003-02-17 14:24:06 +00:00
Maxim Konovalov
27b15c23f8 o Restore an interrupt priority level before return.
Submitted by:	Roman Kurakin <rik@cronyx.ru>
Reviewed by:	joerg
MFC after:	5 days
2003-02-17 13:41:55 +00:00
Maxim Konovalov
b52d5ea3d2 o Fix ipfw uid rules: socheckuid() returns 0 when uid matches a socket
cr_uid.

Note: we do not have socheckuid() in RELENG_4, ip_fw2.c uses its
own macro for a similar purpose that is why ipfw2 in RELENG_4 processes
uid rules correctly. I will MFC the diff for code consistency.

Reported by:	Oleg Baranov <ol@csa.ru>
Reviewed by:	luigi
MFC after:	1 month
2003-02-17 13:39:57 +00:00
Julian Elischer
3931c9a231 Fix missed patch in last commit 2003-02-17 10:21:32 +00:00
Tim J. Robbins
96d7f8ef46 Use the proc lock to protect p_realtimer instead of Giant, and obtain
sched_lock around accesses to p_stats->p_timer[] to avoid a potential
race with hardclock. getitimer(), setitimer() and the realitexpire()
callout are now Giant-free.
2003-02-17 10:03:02 +00:00
Jeff Roberson
58a3c27384 - Add a new function, thread_signal_add(), that is called from postsig to
add a signal to a mailbox's pending set.
 - Add a new function, thread_signal_upcall(), this causes the current thread
   to upcall so that we can deliver pending signals.

Reviewed by:	mini
2003-02-17 09:58:11 +00:00
Julian Elischer
4a338afd7a Move a bunch of flags from the KSE to the thread.
I was in two minds as to where to put them in the first case..
I should have listenned to the other mind.

Submitted by:	 parts by davidxu@
Reviewed by:	jeff@ mini@
2003-02-17 09:55:10 +00:00
Marcel Moolenaar
d1d78df69b Define _ALIGNBYTES to be 15. This should have been done right away. 2003-02-17 09:53:29 +00:00
Marcel Moolenaar
a2ca37c83e Print two new processor features:
o  Spontaneous deferral (A feature required by dutch railways :-)
o  16-byte atomic operations (ld, st, cmpxchg)
2003-02-17 08:17:26 +00:00
Jeff Roberson
5215b1872f - Split the struct kse into struct upcall and struct kse. struct kse will
soon be visible only to schedulers.  This greatly simplifies much the
   KSE code.

Submitted by:	davidxu
2003-02-17 05:14:26 +00:00
Warner Losh
50cc4892cb Move call to pci_print_verbose until after all the variables that it
depends on.

Pointy hat to: imp (anybody know if these things are accepted at Eco-Cycle?)
2003-02-17 04:13:44 +00:00
Jeff Roberson
e4625663c9 - Move ke_sticks, ke_iticks, ke_uticks, ke_uu, ke_su, and ke_iu back into
the proc.  These counters are only examined through calcru.

Submitted by:	davidxu
Tested on:	x86, alpha, UP/SMP
2003-02-17 02:19:58 +00:00
Andrew Gallatin
71a45f46e7 zero the end of the memory cluster we're disposing of. Otherwise teh
vm page startup code finds a 20GB cluster on this wacky alphaserver I'm
working on..

MFC After: 7 days
2003-02-16 19:25:04 +00:00
Poul-Henning Kamp
029f0b69a4 Change "dev_t gdbdev" to "void *gdb_arg", some possible paths for GDB
will not have a dev_t.
2003-02-16 19:22:21 +00:00
Warner Losh
58f4eca2a6 Whatever dumbass wrote sio_pci.c didn't include a detach method.
Wearing said pointy hat, correct the oversight and hope nobody
notices.

# this should make xircom modems happier to detach once other bugs with
# the cardbus layer are fixed.

Noticed by: scottl
Conical Hat to: imp
2003-02-16 18:05:54 +00:00
Warner Losh
3c2eeec09a No need to wrap siodetach() with sio_pccard_detach. 2003-02-16 18:03:15 +00:00
Andrew Gallatin
cb259970c3 When trimming memory to fit Maxmem, and we discard an entire cluster,
make certain to subtract its pages from physmem.  Otherwise we end up
running phys_avail_cnt negative, and bad stuff happens.

MFC After: 1 week
2003-02-16 17:30:49 +00:00
Alfred Perlstein
9d4156aed3 Fix logic in loop so it actually executes.
Pointed out by: fjoe
2003-02-16 16:12:10 +00:00
Matt Jacob
e5824c5d33 Pointy hat- bad commit. 2003-02-16 14:26:23 +00:00
Poul-Henning Kamp
d0b4513884 This file is now empty and should no longer be used anywhere.
Put a #warning here to alert people to the fact.
2003-02-16 14:15:03 +00:00
Poul-Henning Kamp
f341ca9891 Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
Poul-Henning Kamp
7d51c17432 Move cp_time[CPUSTATES] and related #defines to <sys/resource.h> 2003-02-16 13:30:29 +00:00
Poul-Henning Kamp
7694957ecc Declare tty related counters in a tty related .h file. 2003-02-16 13:23:29 +00:00
Poul-Henning Kamp
3abd4ccf87 Move the tty related statistics counters to live with the tty code. 2003-02-16 13:22:15 +00:00
Jeff Roberson
71146186a1 - Introduce a new function bremfreel() that does a bremfree with the buf
queue lock already held.
 - In getblk() and flushbufqueues() use bremfreel() while we still have the
   buf queue lock held to keep the lists consistent.
 - Add LK_NOWAIT to two cases where we're essentially asserting that the bufs
   are not locked while acquiring the locks.  This will make sure that we get
   the appropriate panic() and not another one for sleeping with a lock held.
2003-02-16 10:43:06 +00:00
Jeff Roberson
5e8feb5bed - Add a WITNESS_SLEEP() for the appropriate cases in lockmgr(). 2003-02-16 10:39:49 +00:00
Alan Cox
6420521aa5 Remove GIANT_REQUIRED from vm_pageq_remove(). 2003-02-16 06:36:48 +00:00
Alfred Perlstein
5015c68a3c prevent overflow in shminfo.shmmax 2003-02-16 06:08:55 +00:00
Tim J. Robbins
5d58e28570 Add MPSAFE comment to linux_sigpending(). 2003-02-16 02:33:12 +00:00
Tim J. Robbins
1df69b2d1a Regen from syscalls.master 1.52. 2003-02-16 02:32:17 +00:00
Tim J. Robbins
d97ccc7e54 Mark linux_sigpending() as MPSAFE. 2003-02-16 02:31:05 +00:00
Tim J. Robbins
a5ea48d458 Regen from syscalls.master 1.49. 2003-02-16 02:28:35 +00:00
Jeffrey Hsu
a44009e07d Remove extraneous FILEDESC_LOCK around atomic read. 2003-02-16 02:15:15 +00:00
Warner Losh
387ca2cc8a Checkpoint a work in progress:
o Use the common pci_* routines in preference to the copied and hacked
  routines from an ancient pci.c.

This saves 509 lines in cardbus.c.  More savings to follow when I
convert the resource code over.  In the past when I've done this the
resource code conversion breaks cardbus in subtle ways so I'm doing a
1/2 way checkpoint this time.  cardbus still works for me the same as
it did before.

It also looks like cardbus devices now show up as pci bus devices to
pciconf -l, but maybe that was happening before.

Inspired by a patch from Justin Gibbs many moons ago.  When he
finishes his kobj multiple inheritance work, we can transition the
finished version of this work to that fairly easily.
2003-02-16 02:06:50 +00:00
Warner Losh
594b5aeb67 Use rman_get_device rather than rle->resl->r_dev.
make pci_hdrtypedata and pci_read_extcap accessible (but maybe in the end
   we'll make them private again).
2003-02-16 02:02:44 +00:00
Matt Jacob
03cf2fba38 Make sure we propagate rxid && iid in isp_target_put_atio 2003-02-16 01:37:51 +00:00
Matt Jacob
7369ae168f Pick up some compilation warning fixes from NetBSD.
If we don't have ISP_FW_CRASH_DUMP defined, we have to do
a isp_reinit in the core code- not the platform code- so
fix the ISP_CONN_FATAL case.
2003-02-16 01:32:52 +00:00
Matt Jacob
a5cf62c2b3 Roll to latest level. 2003-02-16 01:30:31 +00:00
Scott Long
1e962d0012 Clean up the CIS BAR parsing code by removing several pointless checks.
Don't complain about the Option ROM BAR type since it's perfectly valid.
2003-02-16 00:20:24 +00:00
Andrew R. Reiter
1f5a94d5f6 - Update a couple of comments to make sense with what today's code is
doing (stale comments make arr something something ;)).
2003-02-15 23:25:12 +00:00
Tor Egge
218a01e062 Avoid file lock leakage when linuxthreads port or rfork is used:
- Mark the process leader as having an advisory lock
  - Check if process leader is marked as having advisory lock when
    closing file
  - Check that file is still open after lock has been obtained
  - Don't allow file descriptor table sharing between processes
    with different leaders

PR:		10265
Reviewed by:	alfred
2003-02-15 22:43:05 +00:00
Ruslan Ermilov
4ce9429c20 Added dependency on the apm(4) module. 2003-02-15 21:22:19 +00:00
Marcel Moolenaar
89c1ecfade Fix misuse of Maxmem in the calculation of the VHPT size. Maxmem
is already in pages, so we should not convert from bytes to pages.
The result of this bug was bad scaling of the VHPT relative to the
available memory.

Submitted by: Arun Sharma <arun@sharma-home.net>
2003-02-15 20:58:32 +00:00
Alan Cox
814f5c92d7 Remove the acquisition and release of Giant around pmap_growkernel().
It's unnecessary for two reasons: (1) Giant is at present already held in
such cases and (2) our various implementations of pmap_growkernel() look to
be MP safe.  (For example, for sparc64 the proof of (2) is trivial.)
2003-02-15 20:01:09 +00:00
Alan Cox
53b1963649 Move kernel_vm_end's declaration to pmap.h; add a comment regarding the
synchronization of access to kernel_vm_end.
2003-02-15 19:38:23 +00:00
Alan Cox
8e42580deb Assert that the kernel map's system mutex is held in pmap_growkernel(). 2003-02-15 19:23:37 +00:00
Andrew R. Reiter
da8f0c8429 - Remove old comment for PURGE() as it no longer exists and implied it
was a comment to cache_zap().
- Add a comment to quickly state what cache_zap() does.

Reviewed by:	phk, mux
2003-02-15 18:58:06 +00:00
Takeshi Shibagaki
a544e1117c Add YIS YWL-11B. This card has same vendor id and product id
as XI300 Wireless LAN. So use PCMCIA_CARD2().
2003-02-15 13:59:54 +00:00
Takeshi Shibagaki
617d6dd179 Regen. 2003-02-15 13:58:28 +00:00
Takeshi Shibagaki
a51440388a Add YIS YWL-11B. This card has same vendor id and product id
as XI300 Wireless LAN.
2003-02-15 13:57:52 +00:00
Tim J. Robbins
4444375710 Acquire Giant around calls to kern_sigaction() in sigaction(),
freebsd4_sigaction() and osigaction() instead of around the whole
body of those functions. They now no longer hold Giant around calls
to copyin() and copyout(), and it is slightly more obvious what
Giant is protecting.
2003-02-15 09:56:09 +00:00
Tim J. Robbins
c41c566c4a osigpending() no longer needs Giant, for the same reason sigpending()
does not.
2003-02-15 09:15:30 +00:00
Tim J. Robbins
48e8f774cb All uses of p_siglist are protected by the proc lock now, so there's
no need to acquire Giant in sigpending() anymore.
2003-02-15 08:42:02 +00:00
Tim J. Robbins
1bdd8ae409 Lock proc while accessing p_siglist, p_sigmask and p_sigignore
in nfs_sigintr().
2003-02-15 08:25:57 +00:00
Darren Reed
7ae7a6c4f7 fix bug in updating of interface pointers when resyncing state 2003-02-15 06:47:27 +00:00
Darren Reed
aeb497128e Commit import changed from vendor branch of ipfilter to -current head 2003-02-15 06:25:25 +00:00
Darren Reed
32c7da78f7 Commit import changed from vendor branch of ipfilter to -current head 2003-02-15 06:23:45 +00:00
Darren Reed
d2c988ba46 sometimes i hate it when you leave temp files in a directory you import from 2003-02-15 06:21:14 +00:00
Darren Reed
8732fffb9b This commit was generated by cvs2svn to compensate for changes in r110911,
which included commits to RCS files with non-trunk default branches.
2003-02-15 06:18:25 +00:00
Darren Reed
46e22717ef Import IPFilter 3.4.31 into -current 2003-02-15 06:18:25 +00:00
Alfred Perlstein
e7d6662f1b Do not allow kqueues to be passed via unix domain sockets. 2003-02-15 06:04:55 +00:00
Alfred Perlstein
edf6699ae6 Fix LOR with PROC/filedesc. Introduce fdesc_mtx that will be used as a
barrier between free'ing filedesc structures.  Basically if you want to
access another process's filedesc, you want to hold this mutex over the
entire operation.
2003-02-15 05:52:56 +00:00
Ruslan Ermilov
0b56eafddf Implemented a simple "nodevice" config(8) command that cancels
the effect of the "device" command, and use it to generate the
OLDCARD from GENERIC.

Suggested by:	bde
2003-02-15 02:39:13 +00:00
Jeffrey Hsu
4b40c56c28 Take advantage of pre-existing lock-free synchronization and type stable memory
to avoid acquiring SMP locks during expensive copyout process.
2003-02-15 02:37:57 +00:00
Takanori Watanabe
a89fcf2843 Allow non-privilaged user to retrive battery or AC line information.
Reviewed by: rwatson
2003-02-15 01:46:22 +00:00
Hidetoshi Shimokawa
6611732341 Protect calling fwohci_intr() with splfw() for 4-stable. 2003-02-15 01:25:39 +00:00
Hidetoshi Shimokawa
3173a15429 - Increase split transaction timeout from 2 sec to 6 sec.
Problem reported by: Michael Reifenberger <root@nihil.reifenberger.com>

- Improve debug message.
2003-02-15 00:54:10 +00:00
Kirk McKusick
aca3e4974f Replace use of random() with arc4random() to provide less guessable
values for the initial inode generation numbers in newfs and for
newly allocated inode generation numbers in the kernel.

Submitted by:	Theo de Raadt <deraadt@cvs.openbsd.org>
Sponsored by:   DARPA & NAI Labs.
2003-02-14 21:31:58 +00:00
Bosko Milekic
9e7225808e Make m_getm() always return the top of the newly allocated chain, as
opposed to returning the top of the old chain when there was one and
the top of the newly allocated chain if there was no old chain.

Actually, it should be noted that prior to this fix, although the
comment above m_getm() advertised that m_getm() would return the
top of the old chain (if an old chain was being passed in) it
actually [wrongly] was returning the tail mbuf in the old chain
instead.  This is a bug but since the one use of m_getm() in
the tree luckily did not depend on the behavior, it happened
to work out without notice.

Harti Brandt pointed out that the advertised behavior was actually
not the real behavior and so this change makes m_getm() ALWAYS
return the newly allocated chain (and fixes the comment).  This
is less confusing and is the best course of action as then the
caller is always able to have both a reference to the top of
the original chain (because it's passing it in in the call) and
a reference to the newly attached chain.  Although the API is
slightly modified, I don't think that any third-party code uses
m_getm() and if it does, it surely can't be working properly
because the old behavior was bogus.

API bug pointed out by: Harti Brandt <brandt@fokus.fraunhofer.de>
2003-02-14 16:50:13 +00:00
Hidetoshi Shimokawa
c26f4c7168 Clear the bus reset event flag as soon as possible after
the initialization has completed to start transactions even when
interrupt is disabled during the boot process.
2003-02-14 15:52:32 +00:00
Dag-Erling Smørgrav
af2eed6648 Style nit. 2003-02-14 13:30:25 +00:00
Alfred Perlstein
3dc593c895 KASSERT format string does not need newline termination 2003-02-14 13:28:44 +00:00
Alfred Perlstein
0c5f7aaab5 Add kasserts to catch bad API usage.
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
2003-02-14 13:18:51 +00:00
Alfred Perlstein
c11110eabe Fix crash dumps on ata and scsi.
To fix scsi, don't wait for ithreads if we're dumping, it makes the
debugger sad.

To fix ata, use what appears to be a polling method if we're dumping,
I stole this from tmm but added code to ensure that this change is
only in effect while dumping.

Tested by: des
2003-02-14 13:10:40 +00:00
Alfred Perlstein
e95499bd4c style. 2003-02-14 12:44:48 +00:00
Alfred Perlstein
aae87a3681 Print a backtrace in case we tsleep from inside of DDB. 2003-02-14 12:44:07 +00:00
Tim J. Robbins
eabe23f352 Lock proc while accessing p_siglist p_sigmask and p_sigignore.
Not tested because netncp does not compile.
2003-02-14 09:16:43 +00:00
Tim J. Robbins
fbbad44413 Lock proc while manipulating p_sigmask p_sigignore and p_siglist. 2003-02-14 09:12:12 +00:00
Tim J. Robbins
fb30aed1a5 Obtain proc lock around modification of p_siglist in linux_wait4(). 2003-02-14 08:59:49 +00:00
Ruslan Ermilov
c2604cb567 Diff reduction to GENERIC. 2003-02-14 08:41:25 +00:00
Alan Cox
e33d37b66f - Add a mutex for synchronizing the use of CMAP/CADDR 1 and 2.
- Eliminate small style differences between pmap_zero_page(),
   pmap_copy_page(), etc.
2003-02-14 07:34:28 +00:00
Eric Anholt
05d1e23aa7 Split the arch-specific AGP files into the appropriate files.* and do the same
for the agp module, and add agp to the list of modules to compile for alpha.
Add an alpha_mb() to agp_flush_cache for alpha -- it's not correct but may
improve the situation, and it's what linux and NetBSD do.
2003-02-14 06:33:52 +00:00
Eric Anholt
11c6a5f80d Remove an extra agp_flush_cache(). The i810 case that needs it already has it. 2003-02-14 06:31:45 +00:00
Warner Losh
2ff0908a66 o transition from exca_write to exca_putb and read->getb. This is so that
we can have additional different types of bridges.
o remove now bogus comment.
o Don't clear CARD_OK when we can't attach a card.
o minor style nits

# this make kldload of cardbus drivers work for me when the card is
# present on boot.
2003-02-14 06:21:51 +00:00
Warner Losh
e0ba3d7e56 Massive overhaul of exca to help with the isa efforts:
o chip_name arrays ifdef'd out.
o use the OLDCARD-like get/put functions so we can support differnt types
  of mappings.
o Write the beggings of is this a valid exca device and introduce more
  chipset support.

# this is partially a wip, but also needed because some other cahnges I've
# made require some of these changes.
2003-02-14 06:21:18 +00:00
Hidetoshi Shimokawa
f3d2847dd0 - Though I got a feedback from the originator of kern/48129 that the
previous revision fixed the panic, I found the problem exits in
another part of the function by investigating the crom dump sent by him.
The search was started in the middle of bus info block and the
routine misunderstood the EUI64 as a crom entry. This problem is fixed.

PR: kern/48129

Fix incorrect type mask included in a logical unit number and check
the validity of the lun.
2003-02-14 03:09:59 +00:00
Kirk McKusick
50bd54e391 Correct lines incorrectly added to the copyright message.
Submitted by:	Frank van der Linden <fvdl@wasabisystems.com>
Sponsored by:   DARPA & NAI Labs.
2003-02-14 00:31:06 +00:00
Matthew N. Dodd
8ae37ad0ba Bandaid the bits that use the elink_foo() functions which are
i386 only at this point.
2003-02-13 23:01:59 +00:00
David E. O'Brien
d23dc82958 FB_INSTALL_CDEV not usable on Alpha. 2003-02-13 22:33:26 +00:00
David E. O'Brien
cc874de3f4 Fix whitespace problems with option lines. 2003-02-13 22:27:40 +00:00
David E. O'Brien
36dc5b9427 Fix the style of the SCHED_4BSD commit. 2003-02-13 22:24:44 +00:00
Jeffrey Hsu
85e8b24343 The protocol lock is always held in the dropafterack case, so we don't
need to check for it at runtime.
2003-02-13 22:14:22 +00:00
David E. O'Brien
1e514ebb71 Only i386 has npx device. 2003-02-13 21:55:13 +00:00
Peter Wemm
f801952a0b We only provide agp drivers for the intel chipsets, move the agp
subdir to the i386-only section.
2003-02-13 21:13:10 +00:00
Alan Cox
2bd63062b5 Use atomic ops to update amountpipekva. Amountpipekva represents the
total kernel virtual address space used by all pipes.  It is, thus, outside
the scope of any individual pipe lock.
2003-02-13 19:39:54 +00:00
Eric Anholt
27afae53db Add agpreg.h missed in commit to agp_i810 (adding i85x/i86x AGP support). 2003-02-13 19:24:19 +00:00
Alexander Kabaev
42d206e975 Implement dlinfo() function.
Introdice RTLD_SELF special handle and properly process it within
dlsym() and dlinfo() functions.

The intention is to improve our compatibility with Solaris and
to make a Java port easier.

Partially submitted by:	phantom
2003-02-13 17:47:44 +00:00
Hidetoshi Shimokawa
85c8ffea1d Remove unnecessary EXPORT_SYMS. 2003-02-13 13:42:19 +00:00
Hidetoshi Shimokawa
627d85fbdd firewire/fwohci
- Drain fwohci TX queue first then drain xfer queue which has not started.
- Check validity of the received packet length.
- Don't allocate too large buffer for xfer receive buf.

sbp
- Fix panic for some CROM which doesn't have a text leaf.
	This could fix the PR kern/48129 but no feedback has been gotten from
	the originator yet.
- Put back some M_NOWAIT flags into malloc which could be called
	in interrupt context for 4-stable.
2003-02-13 13:35:57 +00:00
MIHIRA Sanpei Yoshiro
ba5014037c Sync to 1.114 of usbdevs 2003-02-13 12:57:24 +00:00
MIHIRA Sanpei Yoshiro
f3e45b4bdc Add support SUNTAC Ir-Trinity IS96U
PR:		48212
Submitted by:	Masaharu FUJITA <m@fjts.org>
2003-02-13 12:55:18 +00:00
Dag-Erling Smørgrav
f6cebd7310 It seems the extra precautions are no longer needed. 2003-02-13 10:05:20 +00:00
Tim J. Robbins
5ce623b8e0 Add an XXX comment noting that getrusage() accesses p_stats->p_ru
and p_stats->p_cru without holding the appropriate locks.
2003-02-13 09:53:59 +00:00
Peter Grehan
9412f79eaa Missed odd address test when transcribing the Alpha version.
This fixes the checksum problems seen with telnet.
2003-02-13 08:56:41 +00:00
Eric Anholt
7978e21002 Add Intel 85x/86x AGP support.
Submitted by:	David Dawes <dawes@xfree86.org>
2003-02-13 07:17:39 +00:00
Alan Cox
5b0a1f3af2 MFi386
Remove kptobj.  Instead, use VM_ALLOC_NOOBJ.
2003-02-13 07:03:44 +00:00
Benno Rice
a7308986f5 Don't bother to build ficl if NOFORTH is defined. 2003-02-13 04:35:04 +00:00
Peter Wemm
939a4397b1 Oops. I mis-remembered about the P4 problems. It was 5.0-DP2 that
was shipped with DISABLE_PG_G and DISABLE_PSE, not 5.0-REL.  *blush*
Disable the code - but still leave it there in case its still lurking.
2003-02-13 02:42:06 +00:00
Peter Wemm
521871f1fa Turn of PG_PS and PG_G for Pentium-4 cpus at boot time. This is so
that we can stop turning off PG_G and PG_PS globally for releases.
2003-02-13 01:52:44 +00:00
Peter Wemm
1c425b874c Add a 'debug.witness_trace' sysctl (and tunable) when DDB is present.
This causes LOR and could-sleep messages to come with a stack trace.
2003-02-13 01:35:56 +00:00
Peter Wemm
891e066864 Print "Stack backtrace:" right before dumping the backtrace. We cannot
expect end users to automatically recognize a stack trace for what it is.
2003-02-13 01:33:59 +00:00
Jeffrey Hsu
3dc7ebf9ff in_pcbnotifyall() requires an exclusive protocol lock for notify functions
which modify the connection list, namely, tcp_notify().
2003-02-12 23:55:07 +00:00
Peter Wemm
cc8557f550 Do not do an assignment in a truth test (previous commit) or gcc gives a
warning which breaks builds.

cc1: warnings being treated as errors
src/sys/net/bridge.c: In function `bdg_forward':
sys/net/bridge.c:931: warning: suggest parentheses around assignment used as truth value
*** Error code 1
2003-02-12 19:34:34 +00:00
Tor Egge
96365d3dcf Correctly set bio_data in cloned children when cutting up large requests. 2003-02-12 16:30:46 +00:00
MIHIRA Sanpei Yoshiro
fe84a7c1b9 Sync to 1.113 of usbdevs 2003-02-12 13:22:55 +00:00
MIHIRA Sanpei Yoshiro
7d44829c5e Add support YAMAHA NetVolante Routers
NetVolante RTA54i Broadband&ISDN Router
	NetVolante RTA55i Broadband VoIP Router
	NetVolante RTW65b Broadband Wireless Router
	NetVolante RTW65i Broadband&ISDN Wireless Router

PR:		bin/42574
Submitted by:	Yoshihiko Sarumaru <mistral@imasy.or.jp>
2003-02-12 13:20:39 +00:00
Poul-Henning Kamp
8ebd558f5d Implement a handle for efficient implementation of perforations in
lower extremities.

Setting bit 4 in debugflags (sysctl kern.geom.debugflags=16) will
allow any open to succeed on rank#1 providers.  This will generally
correspond to the physical disk devices: ad0, da0, md0 etc.

This fundamentally violates the mechanics of GEOMs autoconfiguration,
and is only provided as a debugging facility, so obviously error
reports on GEOM where this bit is or has been set will not be
accepted.
2003-02-12 09:48:27 +00:00
Warner Losh
6d0dd93192 Minor correction to comment: PNIC and XIRCOM have eeprom, its just
non-standard.
2003-02-12 07:16:15 +00:00
Warner Losh
b235704d7c Implement rman_get_device
# I though this was alredy implemented

Pointy hat on my head shown by: peter
2003-02-12 07:00:59 +00:00
Warner Losh
22acd92b68 MF-p4:
Kill the slightly bogus #define for DECODE_PROTOTYPE
	Be less verbose.  Hide most (all I hope) of the CIS
	parsing behind cardbus_debug_cis (which is set with
	hw.cardbus.debug_cis=1).

	This doesn't fix problems with parsing, but should make cardbus
	less chatty.  There appears to be some issues still with the
	parsing of the CIS, but this won't fix them.

Prompted by: scottl
2003-02-12 06:11:47 +00:00
Warner Losh
9476c349dd MFp4:
Second part of the kldload patches for cardbus.  This makes
	kldload of a driver for a device that's inserted now appears
	to work.  To make it work, we only do a power cycle of the card
	if there's no children drivers attached.

	This likely is papering over bogosities in the power system.  The
	power sequence needs to be re-written, so I'll not worry about
	the papering over until the re-write.
2003-02-12 05:57:02 +00:00
Warner Losh
78b389be87 MFp4:
Don't reach inside of rman to r_dev.  Use rman_get_device instead.
2003-02-12 05:54:22 +00:00
Warner Losh
0cba409706 Whitespace nits. 2003-02-12 04:48:15 +00:00
Alan Cox
393a225ced Remove kptobj. Instead, use VM_ALLOC_NOOBJ. 2003-02-12 04:35:37 +00:00
Jeffrey Hsu
6d45d64a8f Properly document that syncache timer processing requires an
exclusive TCP protocol lock.
2003-02-12 00:42:12 +00:00
Poul-Henning Kamp
f0e185d705 Implement a bio-taskqueue to reduce number of context switches in
disk I/O processing.

        The intent is that the disk driver in its hardware interrupt
        routine will simply schedule the bio on the task queue with
        a routine to finish off whatever needs done.

        The g_up thread will then schedule this routine, the likely
        outcome of which is a biodone() which queues the bio on
        g_up's regular queue where it will be picked up and processed.

        Compared to the using the regular taskqueue, this saves one
        contextswitch.

Change our scheduling of the g_up and g_down queues to be water-tight,
at the cost of breaking the userland regression test-shims.

Input and ideas from:   scottl
2003-02-11 22:30:26 +00:00
Sam Leffler
ee7785a7f8 PFIL_HOOKS optimization: check if at least one hook is present before
munging the IP header to pass to the hooks
2003-02-11 21:48:20 +00:00
Poul-Henning Kamp
2c71b5639f Announce our ability to do DFLTPHYS sized transfers. 2003-02-11 21:30:28 +00:00
Poul-Henning Kamp
7e579a7c0a Announce our ability to do MAXPHYS transfers. 2003-02-11 21:29:53 +00:00
Poul-Henning Kamp
0364fe2cb3 Advertise MAXPHYS upwards, we will split as necessary before we get to the
bottom of things.
2003-02-11 21:24:25 +00:00
Poul-Henning Kamp
99af707c39 Check disk->d_maxsize/dev->si_iosize_max at open time rather than in strategy.
Printf a warning and use DFLTPHYS if the drive has not set a size.
2003-02-11 21:23:34 +00:00
Joerg Wunsch
1e35598c3a Deregister the dev_clone event handler when unloading the module. Bad
things might happen otherwise.

Noticed by:	Michael Reifenberger <root@nihil.reifenberger.com>
2003-02-11 21:12:43 +00:00
Jens Schweikhardt
00ad14c702 Improve a comment and undo a bogus s/a/an/ in a comment. An asm guru
should add more comments explaining which registers hold which variables.

Spotted by:	bde
2003-02-11 20:15:11 +00:00
Poul-Henning Kamp
15c672a31d Make a mutex to stop the race coming into geom_disk's done routine.
Cut up requests into smaller bits if they are longer than the drivers
disk->d_maxsize or dev->si_iosize_max.

Properly handle the race condition when using g_clone_bio() is used
without having the single-threadedness of g_down/g_up secure locking.
2003-02-11 18:32:31 +00:00
Brian Feldman
d00d7d5c39 Sound devices were being leaked by dsp_open() not actually releasing the
channels it allocates if chn_reset() on them resulted in failure.
ARROW'D!
2003-02-11 16:58:54 +00:00
Poul-Henning Kamp
8028f16b1b Don't divide by zero if there is no stripewidth specified. 2003-02-11 15:23:41 +00:00
Poul-Henning Kamp
200c8a23cd Typo in last commit. 2003-02-11 15:20:34 +00:00
Poul-Henning Kamp
8a63edc3a1 Better names for struct disk elements: d_maxsize, d_stripeoffset
and d_stripesisze;

Introduce si_stripesize and si_stripeoffset in struct cdev so we
can make the visible to clustering code.

Add stripesize and stripeoffset to providers.

DTRT with stripesize and stripeoffset in various places in GEOM.
2003-02-11 14:57:34 +00:00
Poul-Henning Kamp
bb17c5f69f Propagate DISKFLAG_CANDELETE from struct disk to G_PF_CANDELETE on the
provider.
2003-02-11 14:12:06 +00:00
Poul-Henning Kamp
11eb149478 Wrap a long line. 2003-02-11 14:09:48 +00:00
Yoshihiro Takahashi
5628bf6970 Sort. 2003-02-11 13:19:01 +00:00
Poul-Henning Kamp
392d56b4bd Don't short-circuit zero-length requests of they are BIO_[SG]ETATTR. 2003-02-11 13:13:10 +00:00
Poul-Henning Kamp
a0ca480ce6 Retire D_CANFREE flag. 2003-02-11 12:51:51 +00:00
Poul-Henning Kamp
88b1af7730 Use the SI_CANDELETE flag on the dev_t rather than the D_CANFREE flag
on the cdevsw to determine ability to handle the BIO_DELETE request.
2003-02-11 12:49:58 +00:00
Poul-Henning Kamp
cadb987095 Unconditionally make our provider with G_PF_CANDELETE. 2003-02-11 12:37:04 +00:00
Poul-Henning Kamp
faa7b8b96e Propagate G_PF_CANDELETE to our own providers from the provider we attach to. 2003-02-11 12:36:33 +00:00