Commit Graph

43176 Commits

Author SHA1 Message Date
Peter Wemm
d49aa1354b Change the pmap_invalidate_xxx() functions so they test against
pmap == kernel_pmap rather than pmap->pm_active == -1.  gcc's inliner
can remove more code that way.  Only kernel_pmap has a pm_active of -1.
2003-10-30 22:15:22 +00:00
John Baldwin
555639e062 Fixup the sorting of some of the options. DISABLE_P* are still out of
order to keep all of the opt_pmap.h options together.
2003-10-30 21:45:34 +00:00
John Baldwin
e57ea233d9 Ensure that mp_ncpus is set to 1 if mp_cpu_probe() fails. 2003-10-30 21:44:01 +00:00
John Baldwin
1ab9ea3059 Include "opt_pmap.h" so that the DISABLE_P* options are honored. 2003-10-30 21:42:44 +00:00
John Baldwin
63239aa581 Always export r_gdt and r_idt and give them extern declarations in
machine/segments.h.
2003-10-30 21:42:17 +00:00
Brooks Davis
c020a92f9f There is no way to enter the attach routine twice with the same softc
without a detach call in between so don't try to deal with that
possiability.

This is a diff-reduction commit for the upcoming if_xname conversion.
2003-10-30 19:45:58 +00:00
Peter Wemm
fbd00896e2 MFi386: thread specific fpu state optimizations 2003-10-30 19:04:58 +00:00
Hajimu UMEMOTO
349b668aab - unlock on error.
- don't call malloc with M_WAITOK within lock context.
2003-10-30 18:42:25 +00:00
Alexander Kabaev
0823d2996c Relock mntvnode_mtx if vget fails in vfs_stdsync. The loop is
always shoould entered with mutex locked.
2003-10-30 16:22:51 +00:00
Hartmut Brandt
cc3f6cb9fd Explain why the lock-free allocation algorithm is safe in our case
while beeing not safe in the general case. Thanks to David Schultz
<das@freebsd.org> for help.
2003-10-30 16:19:50 +00:00
Mitsuru IWASAKI
fbbdf7c7d2 Add sysctl MIB and loader tunable `hw.acpi.no_reset_video' as
the same effect as ACPI_NO_RESET_VIDEO kernel option.
2003-10-30 16:14:55 +00:00
Hajimu UMEMOTO
7fc91b3f1d add management part of address selection policy described in
RFC3484.

Obtained from:	KAME
2003-10-30 15:29:17 +00:00
Søren Schmidt
f969ea6912 Add support for the VIA 8237 (both PATA and SATA part).
Cleanup the SATA support a bit now we are here anyways.
2003-10-30 13:16:21 +00:00
Hartmut Brandt
62b93d9b12 Reinvent the used-flag for external mbufs. This and the on-card flag
are now in the header of the external buffer itself which allows us
to manipulate them in the free routine without having to lock the softc
structure or the free list. To get space for these flags the chunk number
is reduced to 8 bit which amounts to a maximum of 256 chunks per allocated
page. This restriction is now enforced by a CTASSERT.
2003-10-30 10:43:52 +00:00
Alan Cox
7645e88596 - Synchronize access to the swdevt's sw_blist with sw_dev_mtx.
- Remove several instances of GIANT_REQUIRED.
2003-10-30 09:12:43 +00:00
Alan Cox
d05bc12976 - Synchronize access to swdevhd using sw_dev_mtx.
- Use swp_sizecheck() rather than assignment to swap_pager_full in
   swaponsomething().
2003-10-30 07:11:06 +00:00
Peter Wemm
3f378ea44a MFi386: rev 1.451 (jhb): call pmap_kremove() rather than duplicate it 2003-10-30 04:08:22 +00:00
Peter Wemm
10d9b64384 MFi386: trap.c rev 1.259: fetch thread mailbox address in page fault trap 2003-10-30 04:06:28 +00:00
David Xu
7eeaaf9b97 Try to fetch thread mailbox address in page fault trap, so when thread
blocks in page fault hanlder, and upcall thread can be scheduled. It is
useful if process is doing lots of mmap based I/O.
2003-10-30 02:55:43 +00:00
Peter Wemm
40bb965382 Oops, forgot to save these in the editor. Add CTASSERTS for signal and
context related things.
2003-10-30 02:43:19 +00:00
Peter Wemm
60a8c422cd Add CTASSERT()'s to check that the sizes of our replicas of the 32 bit
structures come out the right size.

Fix the ones that broke.  stat32 had some missing fields from the end
and statfs32 was broken due to the strange definition of MNAMELEN
(which is dependent on sizeof(long))

I'm not sure if this fixes any actual problems or not.
2003-10-30 02:40:30 +00:00
Sam Leffler
319de71e19 avoid recursive lock panic by unlocking before calling rtrequest;
this is consistent with other places but will be replaced
shortly by a "proper fix"

Supported by:	FreeBSD Foundation
Pain felt by:	Jiri Mikulas
2003-10-29 23:01:37 +00:00
Sam Leffler
2657cae39a correct LOR by using a local variable to hold result
instead of holding a lock while calling out of view

Supported by:	FreeBSD Foundation
2003-10-29 22:59:12 +00:00
Daniel Eischen
ec49974ac2 Don't attempt to destroy the driver mutex when it hasn't yet
been created.  This has been sitting in my local tree for
far too long; I can't believe noone else has come across this
yet.
2003-10-29 21:54:37 +00:00
Nate Lawson
e8c321c92f Fix a panic that occurs when resuming. For some reason, sc->cur_scp is
NULL.

Submitted by:	Andrew Thompson <andy@fud.org.nz>
2003-10-29 20:48:13 +00:00
Sam Leffler
d0402f1b73 Potential fix for races shutting down callouts when unloading
the module.  Previously we grabbed the mutex used by the callouts,
then stopped the callout with callout_stop, but if the callout
was already active and blocked by the mutex then it would continue
later and reference the mutex after it was destroyed.  Instead
stop the callout first then lock.

Supported by:	FreeBSD Foundation
2003-10-29 19:15:00 +00:00
Sam Leffler
3520e9d61d o add locking to protect routing table refcnt manipulations
o add some more debugging help for figuring out why folks are
  getting complaints about releasing routing table entries with
  a zero refcnt
o fix comment that talked about spl's
o remove duplicate define of DUMMYNET_DEBUG

Supported by:	FreeBSD Foundation
2003-10-29 19:03:58 +00:00
Sam Leffler
8dbc9c8bf4 Always queue looped back packets (rather than potentially using
direct dispatch) to avoid extensive kernel stack usage and to
avoid directly re-entering the network stack.  The latter causes
locking problems when, for example, a complete TCP handshake`
happens w/o a context switch.
2003-10-29 18:37:47 +00:00
Sam Leffler
b237430cfe mark interrupt handlers MPSAFE 2003-10-29 18:32:14 +00:00
Sam Leffler
90fc7b7cb8 Add a temporary mechanism to disble INTR_MPSAFE from network interface
drivers.  This is prepatory to running more parts of the network system
w/o Giant.
2003-10-29 18:29:50 +00:00
Bruce Evans
b3aeaf2ed1 Removed mostly-dead code for setting switchtime after the idle loop
clobbers this variable.  Long ago, when the idle loop wasn't in a
process, it set switchtime.tv_sec to zero to indicate that the time
needs to be read after the idle loop finishes.  The special case for
this isn't needed now that there is an idle process (for each CPU).
The time is read in the normal way when the idle process is switched
away from.  The seconds component of the time is only zero for the
first second after the uptime is set, and the mostly-dead code was only
executed during this time.  (This was slightly broken by using uptimes
instead of times relative to the Epoch -- in the original version the
seconds component of the time was only 0 for the first second after
the Epoch.)

In mi_switch(), moved the setting of switchticks to just after the
first (and now only) setting of switchtime.  This setting used to be
delayed since a late setting was needed for the idle case and an early
setting was not needed.  Now the early setting is needed so that
fork_exit() doesn't need to set either switchtime or switchticks.
Removed now-completely-rotted comment attached to this.  Most of the
code described by the comment had already moved to sched_switch().
2003-10-29 15:23:09 +00:00
Hartmut Brandt
d976286c77 Allow sending of more than one raw cell from a single mbuf. Only the
very first cell in the mbuf should have a cell header word (of which
everything except the payload type and the CLP bit is ignored). All
other cells should be 48 byte and get the same header as the first cell.

This fixes a problem with sending more than 120000 raw cells/sec through
an HE155. The card seems to need 2 cell times to DMA the transmit buffer
ready queue entry and the transmit buffer descriptor so at 1/3 the
link rate the transmit buffer ready queue starts to fill up. Even with this
patch it's obviously impossible to send raw cells at link rate.
2003-10-29 15:15:19 +00:00
Hartmut Brandt
cb79e7478d Remove a superfluous ) from the previous commit. This was obviously
a result of the current solar storm.
2003-10-29 15:11:26 +00:00
Hartmut Brandt
278bc3c3a9 Make the maximum number of pages for external mbufs configurable in
the kernel environment and accessible as a RO sysctl.

Explain that the HE155 will not work in 64-bit/66MHz slots, but may work
in 64-bit/33MHz slots.
2003-10-29 15:07:10 +00:00
Hajimu UMEMOTO
59dfcba4aa add ECN support in layer-3.
- implement the tunnel egress rule in ip_ecn_egress() in ip_ecn.c.
   make ip{,6}_ecn_egress() return integer to tell the caller that
   this packet should be dropped.
 - handle ECN at fragment reassembly in ip_input.c and frag6.c.

Obtained from:	KAME
2003-10-29 15:07:04 +00:00
Bruce Evans
89674a9f77 Removed sched_nest variable in sched_switch(). Context switches always
begin with sched_lock held but not recursed, so this variable was
always 0.

Removed fixup of sched_lock.mtx_recurse after context switches in
sched_switch().  Context switches always end with this variable in the
same state that it began in, so there is no need to fix it up.  Only
sched_lock.mtx_lock really needs a fixup.

Replaced fixup of sched_lock.mtx_recurse in fork_exit() by an assertion
that sched_lock is owned and not recursed after it is fixed up.  This
assertion much match the one in mi_switch(), and if sched_lock were
recursed then a non-null fixup of sched_lock.mtx_recurse would probably
be needed again, unlike in sched_switch(), since fork_exit() doesn't
return to its caller in the normal way.
2003-10-29 14:40:41 +00:00
Hartmut Brandt
92d5836987 Make the value of the HATM_DEBUG symbol the default for the debugging
flags. Introduce a new debugging flag to dump received packets.
2003-10-29 14:33:41 +00:00
Hartmut Brandt
ac45adc11a Inline a function that was called only in one place directly into that place.
Correct a bug when the number of pages for external mbufs was
very large. In this case the page number could overflow into the large
buffer flag. Make this more unlikley by move that flag further away.
2003-10-29 14:28:26 +00:00
Mitsuru IWASAKI
d63ab51a51 Alphabetical order for ACPI options broken by adding ACPI_NO_RESET_VIDEO.
Add short comment about ACPI_NO_RESET_VIDEO into NOTES.

Pointed-out by:	njl
2003-10-29 14:22:09 +00:00
Hartmut Brandt
908b018b49 We have some space in the external mbufs so use this space for
the external buffer reference count. This saves us a malloc() + free()
per small receive mbuf.
2003-10-29 13:21:38 +00:00
Hartmut Brandt
7672807356 Defer allocation of the actual receive mbuf until the external buffer
is returned from the card to the driver. Add a counter that shows
how many times this allocation has failed. Note, that we could even
further delay the allocation of the mbuf until we know, that we need it
(there are no receive errors and the connection is open). This will be done
in a later commit.

Print the new statistics field in atmconfig.
2003-10-29 13:14:39 +00:00
Hartmut Brandt
d1f6e71f1d Get rid of the mutexes for the exernal buffer free lists. Use
atomic instructions instead. Remove the stuff used to track
whether an external mbuf travels through the system. This is
temporary only and will come back soon.
2003-10-29 12:59:44 +00:00
Hajimu UMEMOTO
11de19f44d ip6_savecontrol() argument is redundant 2003-10-29 12:52:28 +00:00
Hajimu UMEMOTO
1410779a4f hide m_tag, again.
Requested by:	sam
2003-10-29 12:49:12 +00:00
Alan Cox
0676a140b2 - Synchronize updates to nswapdev using sw_dev_mtx. 2003-10-29 07:51:41 +00:00
Marcel Moolenaar
3c6441a736 Fix the alpha tinderbox. The alpha specific bitops used by the bitmap
code has the typical branch prediction detour, which creates cross-
section branches. A LINT kernel is apparently large enough nowadays
that the .text and .text2 sections cannot always be layed-out so that
branches between them reach.
The fix is to stop using the alpha-specific bitops and instead use
the portable implementation used by all platforms other than alpha
and i386.
2003-10-29 07:35:53 +00:00
Alan Cox
2d9974c1e8 - Avoid a race in swaponsomething(): Calculate the new swdevt's first and
end swblk and insert this new swdevt into the list of swap devices
   in the same critical section.
2003-10-29 05:42:28 +00:00
Sam Leffler
9c855a36c1 Introduce the notion of "persistent mbuf tags"; these are tags that stay
with an mbuf until it is reclaimed.  This is in contrast to tags that
vanish when an mbuf chain passes through an interface.  Persistent tags
are used, for example, by MAC labels.

Add an m_tag_delete_nonpersistent function to strip non-persistent tags
from mbufs and use it to strip such tags from packets as they pass through
the loopback interface and when turned around by icmp.  This fixes problems
with "tag leakage".

Pointed out by:	Jonathan Stone
Reviewed by:	Robert Watson
2003-10-29 05:40:07 +00:00
Marcel Moolenaar
4765b7e51a This commit was generated by cvs2svn to compensate for changes in r121642,
which included commits to RCS files with non-trunk default branches.
2003-10-29 04:25:17 +00:00
Marcel Moolenaar
c2b1cc6d02 Import beta6 of libuwx. This release has some minor fixes and
some minor corrections to beta5.
2003-10-29 04:25:17 +00:00
Mitsuru IWASAKI
92781c3567 Add kernel option ACPI_NO_RESET_VIDEO as workaround for problems
(e.g. LCD white-out after resume) on some machine cased by
re-initialize video BIOS code in acpi_wakecode.
2003-10-29 03:30:45 +00:00
Søren Schmidt
60279a3808 Cleanup the interrupt code that deals with the busmaster bits. 2003-10-28 21:08:14 +00:00
Brooks Davis
5e17543a23 Use VLANNAME instead of "vlan". 2003-10-28 20:58:02 +00:00
John Baldwin
9665592e2b According to the submitter, POSIX mandates that all interval timers are
reset in a child process after a fork().  Currently, however, only the
real timer is cleared while the virtual and profiling timers are inherited.

The realtimer is cleared because it lives directly in struct proc in
p_realtimer.  It is in the zero'd section of struct proc.  The other timers
live in the p_timer[] array in struct pstats.  These timers are copied on
fork() rather than zero'd.  The fix is to move p_timer[] to the zero'd
part of struct pstats so that they are zero'd instead of copied on fork().

Note: Since at least FreeBSD 2.0 (and possibly earlier) we've had storage
for two real interval timers.  Now that the uarea is less important,
perhaps we could move all of p_timer[] over to struct proc and drop the
p_realtimer special case to fix that.

PR:		kern/58647
Reported by:	Dan Nelson <dnelson@allantgroup.com>
MFC after:	1 week
2003-10-28 20:46:23 +00:00
Marcel Moolenaar
3bdfa17c6c When switching the RSE to use the kernel stack as backing store, keep
the RNAT bit index constant. The net effect of this is that there's
no discontinuity WRT NaT collections which greatly simplifies certain
operations. The cost of this is that there can be up to 504 bytes of
unused stack between the true base of the kernel stack and the start
of the RSE backing store. The cost of adjusting the backing store
pointer to keep the RNAT bit index constant, for each kernel entry,
is negligible.

The primary reasons for this change are:
1. Asynchronuous contexts in KSE processes have the disadvantage of
   having to copy the dirty registers from the kernel stack onto the
   user stack. The implementation we had so far copied the registers
   one at a time without calculating NaT collection values. A process
   that used speculation would not work. Now that the RNAT bit index
   is constant, we can block-copy the registers from the kernel stack
   to the user stack without having to worry about NaT collections.
   They will be in the right place on the user stack.
2. The ndirty field in the trapframe is now also usable in userland.
   This was previously not the case because ndirty also includes the
   space occupied by NaT collections. The value could be off by 8,
   depending on the discontinuity. Now that the RNAT bit index is
   contants, we have exactly the same number of NaT collection points
   on the kernel stack as we would have had on the user stack if we
   didn't switch backing stores.
3. Debuggers and other applications that use ptrace(2) can now copy
   the dirty registers from the kernel stack (using ptrace(2)) and
   copy them whereever they want them (onto the user stack of the
   inferior as might be the case for gdb) without having to worry
   about NaT collections in the same way the kernel doesn't have to
   worry about them.

There's a second order effect caused by the randomization of the
base of the backing store, for it depends on the number of dirty
registers the processor happened to have at the time of entry into
the kernel. The second order effect is that the RSE will have a
better cache utilization as compared to having the backing store
always aligned at page boundaries. This has not been measured and
may be in practice only minimally beneficial, if at all measurable.
2003-10-28 19:38:26 +00:00
Søren Schmidt
45f13b849c This should allow us to boot with DMA enabled on unknown PCI ATA
chipsets, well at least newer ones...
2003-10-28 19:01:48 +00:00
Scott Long
187a0f56e7 Directly call the 'reboot' word instead of indirectly evaluating it. 2003-10-28 17:18:42 +00:00
Hajimu UMEMOTO
b266757652 make sure to accept only IPv6 packet.
Obtained from:	KAME
2003-10-28 16:45:29 +00:00
Hajimu UMEMOTO
2a5aafce0e cleanup use of m_tag.
Obtained from:	KAME
2003-10-28 16:29:26 +00:00
Hajimu UMEMOTO
46b35e11be mib name was changed by fixing a spelling.
net.key.prefered_oldsa -> net.key.preferred_oldsa

Obtained from:	KAME
2003-10-28 16:16:04 +00:00
Sam Leffler
395bb18680 speedup stream socket recv handling by tracking the tail of
the mbuf chain instead of walking the list for each append

Submitted by:	ps/jayanth
Obtained from:	netbsd (jason thorpe)
2003-10-28 05:47:40 +00:00
Jeff Roberson
1aca9909e5 - Only change the run queue in sched_prio() if the kse is non null. threads
can be in the TD_ON_RUNQ state and not have an associated kse.
 - Remove the PRI_IDLE special case from sched_clock(), it was not actually
   necessary.
2003-10-28 03:28:48 +00:00
Peter Wemm
57e1fa205b Oops. Remove some rather noisy debug printfs that slipped in there
somehow.
2003-10-28 01:06:37 +00:00
Marcel Moolenaar
95b0df9df2 The previous commit removed both clause 3 and clause 4 from the UCB
license. Only clause 3 has been revoked. Restore the fourth clause
as clause 3.

Pointed out by: das@

Remove my name as a copyright holder since I don't use a BSD license
compatible or comparable to the UCB license. I choose not to add a
complete second license for my work for aesthetic reasons, nor to
replace the UCB license on grounds of rewriting more than 90% of the
source files. The rewrite can also be seen as an enhancement and since
the files were practically empty, it's rather trivial to have changed
90% of the files.
2003-10-27 22:54:34 +00:00
John Baldwin
2e81e660b4 Fix pmap_unmapdev() to call pmap_kremove() instead of implementing it
directly so that it more closely mirrors pmap_mapdev() which calls
pmap_kenter().
2003-10-27 22:15:02 +00:00
Scott Long
4229f75b5c Directly call the 'boot' word instead of indirectly evaluating it.
Submitted by: dcs
2003-10-27 16:39:49 +00:00
Hartmut Brandt
325014126d When we cannot allocate an external buffer (bacause we've hit
the maximum number of pages for buffers) return -1 instead of 0.
This fixes a panic under conditions when many mbufs are needed.

Update the head pointer of the receive buffer pool queue even when
we could not supply a buffer to the chip. Otherwise the chip will
not re-interrupt us for another try. A better strategy would probably
be to remember this condition and to supply buffers without an interrupt
as soon as buffers get available.
2003-10-27 16:21:59 +00:00
Hartmut Brandt
027ebd2f39 Allow building the NgATM SAAL layer directly into the kernel. 2003-10-27 11:19:08 +00:00
Jeff Roberson
eab9cabf34 - Don't set td_priority directly here, use sched_prio(). 2003-10-27 07:15:47 +00:00
Hajimu UMEMOTO
8c0dd0e438 M_DONTWAIT was passed into malloc().
Submitted by:	Ian Dowse <iedowse@maths.tcd.ie>
2003-10-27 07:15:22 +00:00
Jeff Roberson
3f741ca117 - Use a better algorithm in sched_pctcpu_update()
Contributed by:	Thomaswuerfl@gmx.de

 - In sched_prio(), adjust the run queue for threads which may need to move
   to the current queue due to priority propagation .
 - In sched_switch(), fix style bug introduced when the KSE support went in.
   Columns are 80 chars wide, not 90.
 - In sched_switch(), Fix the comparison in the idle case and explicitly
   re-initialize the runq in the not propagated case.
 - Remove dead code in sched_clock().
 - In sched_clock(), If we're an IDLE class td set NEEDRESCHED so that threads
   that have become runnable will get a chance to.
 - In sched_runnable(), if we're not the IDLETD, we should not consider
   curthread when examining the load.  This mimics the 4BSD behavior of
   returning 0 when the only runnable thread is running.
 - In sched_userret(), remove the code for setting NEEDRESCHED entirely.
   This is not necessary and is not implemented in 4BSD.
 - Use the correct comparison in sched_add() when checking to see if an idle
   prio task has had it's priority temporarily elevated.
2003-10-27 06:47:05 +00:00
Warner Losh
6a0e476222 const char ** needs to be passed, not char **. 2003-10-27 06:41:40 +00:00
Nate Lawson
450b6ff66f Call the VESA reset BIOS vector on the resume path. This may help displays
after resume.  I have not found it to break anything.
2003-10-27 06:26:51 +00:00
Kenneth D. Merry
65afe1f454 In camperiphdone(), make sure we check for fatal errors and bail out
instead of retrying them blindly.

This should fix some of the problems people have been having with cdrom
drives taking a long time to probe.  This should also eliminate the need
for the initial TUR in cdsize().

cam_periph.c:	Don't keep retrying if the error we get back is a fatal
		error.  This should help us detect the transition from
		"Logical unit not ready, cause not reportable" to "Medium
		not present" in the "TUR many" handler.  (The TUR many
		handler gets triggered for Logical unit not ready, cause
		not reportable errors.)

scsi_cd.c:	Remove the initial test unit ready in cdsize().  Hopefully
		it isn't necessary after the above change.

Submitted by:	gibbs (mostly)
Tested by:	peter
MFC After:	2 weeks
2003-10-27 06:15:55 +00:00
Alan Cox
d536c58f53 - Complete the synchronization of accesses to the swblock hash table. 2003-10-27 05:58:15 +00:00
Marcel Moolenaar
f74fae21b8 Add support for userland to access I/O port space. This is primarily
added for XFree86. There are 2 reasons for doing this with sysarch():
1. The memory mapped I/O space is not at a fixed physical address. An
   application has to use some interface to get the base address. It
   gets worse if the machine has multiple memory mapped I/O spaces.
2. Access to the memory mapped I/O space needs to happen through a
   translation that is flagged as uncachable. There's no interface
   that allows a process to do uncached memory I/O, other than though
   /dev/mem (possibly).

So, until we either disallow direct access to I/O or bus space from
userland or have a better way of doing this, sysarch() has the least
negative impact on existing interfaces.
2003-10-27 05:45:35 +00:00
Warner Losh
42d00de1a6 sync to 1.77 2003-10-27 05:37:34 +00:00
Warner Losh
0d064154e2 Correct CEM33 2003-10-27 05:37:01 +00:00
Alexander Kabaev
78ece5537d Delay if_lo module intialization until domain list has been
completely populated. This prevents a system crash on boot.
2003-10-27 04:16:32 +00:00
Nate Lawson
eb4f7a817c Fix style problems with new options.
Requested by:	bde
2003-10-27 02:42:08 +00:00
Warner Losh
400911ccdc Make sn MPSAFE. This has survived a couple of make buildworlds with
my Megahertz XJ10BT.
2003-10-26 22:35:44 +00:00
Warner Losh
6b5dc774ed Pass sc to GO_WINDOW macro.
Use SET_IRQ for pccard case, rather than exapnding it inline.

Requested by: mdodd
2003-10-26 22:28:20 +00:00
Warner Losh
2bf694a41c Sync to pccarddevs 1.76 2003-10-26 22:24:01 +00:00
Warner Losh
0a0304727f Add Olicom GoCard 28.8k version 2003-10-26 22:22:34 +00:00
Warner Losh
891a59d722 Sync to 1.75 of pccarddevs 2003-10-26 20:09:57 +00:00
Warner Losh
05473b7a94 Minor tweak to Olicom 2220. Also add the OC-2232 while I'm here.
Looks like 'special magic' is needed to access the ethernet part of
that combo card, so I've not added it to ex.
2003-10-26 20:09:18 +00:00
Alan Cox
7827d9b0fe - Introduce and use a mutex synchronizing access to the swblock hash table. 2003-10-26 19:55:35 +00:00
Hajimu UMEMOTO
02b9a2066e re-add wrongly disappered IPV6_CHECKSUM stuff by introducing
ip6_raw_ctloutput().

Obtained from:	KAME
2003-10-26 18:17:01 +00:00
Hajimu UMEMOTO
862e960f61 drop unused defines. 2003-10-26 15:15:36 +00:00
Hajimu UMEMOTO
fe01034af8 drop unused fields. 2003-10-26 15:06:06 +00:00
Hajimu UMEMOTO
9dcd9885cf use official # for IFT_STF
(are there any backward compat issue?  i don't think so)

Obtained from:	KAME
2003-10-26 14:29:04 +00:00
Hajimu UMEMOTO
0021a48500 use uint32_t instead of u_int32_t for newly introduced
struct definition.
2003-10-26 10:49:18 +00:00
Hidetoshi Shimokawa
ffbfc256fc Revert previous change.
We have to put dcons_crom at first after 'optional' and
dcons and firewire are necessary and not optional for dcons_crom anyway.

Reported by: brooks
2003-10-26 07:42:32 +00:00
Warner Losh
7d38a5efdc add newcard support to ex 2003-10-26 06:34:22 +00:00
Warner Losh
23c6a7f4fa Sync to pccarddevs 1.74 2003-10-26 06:32:50 +00:00
Warner Losh
9abf3fd1a4 Add ID for olicom GOCARD Ethernet (OC2220) 2003-10-26 06:31:46 +00:00
Alan Cox
43186e53ae - Simplify vm_object_collapse()'s collapse case, reducing the number
of lock acquires and releases performed.
 - Move an assertion from vm_object_collapse() to vm_object_zdtor()
   because it applies to all cases of object destruction.
2003-10-26 06:29:26 +00:00
Warner Losh
03c1602aed Style changes:
o kill register
o minor function name tweaks.
2003-10-26 05:34:01 +00:00
Alfred Perlstein
6229d8418b constify bintime_add, bintime_sub, bintime2timespec, timespec2bintime,
bintime2timeval and timeval2bintime.
2003-10-26 02:38:34 +00:00
Alfred Perlstein
6ff7636ea5 constify the second args to timevaladd() and timevalsub(). 2003-10-26 02:19:00 +00:00
Warner Losh
595670d932 Const poison string accessor functions. 2003-10-26 00:51:40 +00:00
Alan Cox
ee3dc7d7fe - Add some of the required vm object locking, including assertions where
the vm object lock is required and already held.
2003-10-25 23:42:17 +00:00
Warner Losh
1e56655e43 Minor style nits suggested by sam and mdodd:
o give an argument to EP_BUSY_WAIT
o use foo_locked rather than foo_body
o Add locking assertions for extra safety.
2003-10-25 21:28:40 +00:00
Warner Losh
470de03fd0 Convert to bus_space.
Make the pccard attachment work with NEWCARD
Start locking of the driver, but only the macros are defined right now

Tested on: Megahertz CC10BT/2
# (These cards are very popular on ebay these days, and run < $10 including
#  shipping from some sellers).
2003-10-25 19:56:19 +00:00
Peter Wemm
f3075be88a For the SMP case, flush the TLB at the beginning of the page zero/copy
routines.  Otherwise we run into trouble with speculative tlb preloads
on SMP systems.  This effectively defeats Jeff's revision 1.438
optimization (for his pentium4-M laptop) in the SMP case.  It breaks
other systems, particularly athlon-MP's.
2003-10-25 18:51:41 +00:00
Alan Cox
93dbd07122 - Align a comment within struct vm_page.
- Annotate the vm_page's valid field as synchronized by the containing
   vm object's lock.
2003-10-25 18:33:04 +00:00
Robert Watson
36bbf86ba6 Check (locked) before performing an advisory unlock following a failure
of vn_start_write().  Otherwise, we may inconsistently attempt to release
the advisory lock.

Pointed out by:	teggej
2003-10-25 16:43:50 +00:00
Robert Watson
c447f5b2f4 When generate a core dump, use advisory locking in an advisory way:
if we do acquire an advisory lock, great!  We'll release it later.
However, if we fail to acquire a lock, we perform the coredump
anyway.  This problem became particularly visible with NFS after
the introduction of rpc.lockd: if the lock manager isn't running,
then locking calls will fail, aborting the core dump (resulting in
a zero-byte dump file).

Reported by:	Yogeshwar Shenoy <ynshenoy@alumni.cs.ucsb.edu>
2003-10-25 16:14:09 +00:00
Robert Watson
67536f038c Allow MAC policies to block/revoke kern_alq write access to a file.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
Reviewed by:	jeff
2003-10-25 16:10:41 +00:00
Robert Watson
da77b2fa6b Make MAC_EXTERNALIZE() and MAC_INTERNALIZE() simply take the object
type, rather than "object_label" as the first argument.  This reduces
complexity a little for the consumer, and also makes it easier for
use to rename the underlying entry points in struct mac_policy_obj.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-10-25 15:28:20 +00:00
Hidetoshi Shimokawa
65290832bd Fix fwmem_strategy() race in 4-stable. 2003-10-25 15:05:59 +00:00
Hidetoshi Shimokawa
a4468d6352 Move validity check of 'xfer->fc != NULL' to right place. 2003-10-25 15:04:49 +00:00
Hidetoshi Shimokawa
b604f6e80f dcons_crom.c needs dcons and firewire. 2003-10-25 12:59:22 +00:00
Hajimu UMEMOTO
618d51bbdc revert following unwanted changes:
- __packed to __attribute__((__packed__)
  -  uintN_t back to u_intN_t

Reported by:	bde
2003-10-25 10:57:08 +00:00
Hajimu UMEMOTO
16cd67e933 correct namespace pollution.
Submitted by:	bde
2003-10-25 09:37:10 +00:00
Alan Cox
52051abcf1 - Call vnode_pager_input_old() with the vm object locked. 2003-10-25 05:21:16 +00:00
Peter Wemm
b09a77f561 GC workaround code for detecting pentium4's and disabling PSE and PG_G.
It's been ifdef'ed out for ages.
2003-10-25 05:14:38 +00:00
Nate Lawson
9b937d4836 Add devctl(4) notify support to ACPI. Various subsystems now notify
userland whenever events occur.  See the example in devd.conf below
to see how to use it.
2003-10-25 05:03:25 +00:00
Warner Losh
c365ed47e4 Whole grab-bag of changes:
o Make the driver MPSAFE
o Some changes due to diff reduction effort with vx.
o Removed some obsolete junk.

Reviewed by: sam, modd
2003-10-25 04:09:49 +00:00
Warner Losh
e0eeb66087 Start to minimize diffs between vx and ep. These latter is based on a
more advanced version of the chips supported by the former.  Matt Dodd
and I are working towards merging them, and this a step on that path.
2003-10-25 04:05:33 +00:00
Robert Watson
138f64b698 Sort type declarations together.
Remove an excess carriage return.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-10-25 03:50:44 +00:00
Warner Losh
17e02bb39b Convenience functions to generate notifications from the kernel. The ACPI
code will start using these shortly.

Reviewed by: njl
2003-10-24 22:41:54 +00:00
Doug Ambrisko
43e42f3688 Add support for another multiple serial port card based on OX16PCI954 device
id 0x950a.

MFC:	after 4.9 release.
2003-10-24 22:34:56 +00:00
Eric Anholt
4294fd5ce1 Don't try to use dev->dma_lock unless dma is initialized (dev->dma != NULL)
in bufs_info sysctl handler.  dev->dma and dev->dma_lock existence are
protected by DRM_LOCK().  Fixes panic on sysctl hw.dri when the device is
uninitialied (when you aren't in X).
2003-10-24 21:45:21 +00:00
John-Mark Gurney
0eb3b7bb7f don't allow reading from files that haven't been open'd for reading. 2003-10-24 21:07:53 +00:00
John Baldwin
8b201c42c6 - Add a DDB command 'show intrcnt' to show the non-zero interrupt counts.
- Add a DDB function to dump the contents of an ithread and optionally
  details about each handler in that ithread.  This function can be used
  by MD code to implement DDB commands that display information about
  interrupt sources and their registered handlers.
2003-10-24 21:05:30 +00:00
John Baldwin
07930cce05 A few whitespace and comment tweaks. 2003-10-24 21:02:26 +00:00
John Baldwin
fe38ebca56 - Fail to probe if acpi0 probed ok as this driver basically tries to probe
the ACPI timer and we shouldn't do that if ACPI is already around to do
  that for us.
- Set a description and tweak the order of checks in the probe function
  to more closely match other PCI drivers.

This should probably be moved to sys/dev/piix/piix.c at some point and
turned on for all i386 kernels rather than just SMP ones.
2003-10-24 21:01:31 +00:00
Hajimu UMEMOTO
c302f5bc07 remove the ip6r0_addr and ip6r0_slmap members from ip6_rthdr0{}
according to rfc2292bis.

Obtained from:	KAME
2003-10-24 20:37:05 +00:00
Hajimu UMEMOTO
5434eaa208 correct tab and order. 2003-10-24 19:51:49 +00:00
Poul-Henning Kamp
7b3c545769 Close the right consumers if we run into trouble opening them all.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2003-10-24 18:47:31 +00:00
Poul-Henning Kamp
87ac8d11c2 Fix two old/new consumer confusions.
Submitted by:    Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2003-10-24 18:46:23 +00:00
Poul-Henning Kamp
63b92d134e When grabbing vnodes to service NFS requests, make sure to call
vn_start_write() early to avoid snapshot deadlocks.

By:	mckusick
2003-10-24 18:36:49 +00:00
Hajimu UMEMOTO
f95d46333d Switch Advanced Sockets API for IPv6 from RFC2292 to RFC3542
(aka RFC2292bis).  Though I believe this commit doesn't break
backward compatibility againt existing binaries, it breaks
backward compatibility of API.
Now, the applications which use Advanced Sockets API such as
telnet, ping6, mld6query and traceroute6 use RFC3542 API.

Obtained from:	KAME
2003-10-24 18:26:30 +00:00
Hajimu UMEMOTO
234a35c714 Since dp->dom_ifattach calls malloc() with M_WAITOK, we cannot
use mutex lock directly here.  Protect ifp->if_afdata instead.

Reported by:	grehan
2003-10-24 16:57:59 +00:00
Hartmut Brandt
7298db81fe Sysctl names should not contain dots. Convert them to underlines. 2003-10-24 16:44:27 +00:00
Hidetoshi Shimokawa
869093b15d Add dumb console driver and related bits.
dcons(4): very simple console and gdb port driver
dcons_crom(4): FireWire attachment
dconschat(8): User interface to dcons

Tested with: i386, i386-PAE, and sparc64.
2003-10-24 15:44:10 +00:00
Hidetoshi Shimokawa
102ebc1f95 Fix for FW_ASYREQ.
- set send.pay_len correctly.
- copy response only if needed.
- remove unnecessary 'err = 0'.
2003-10-24 13:55:51 +00:00
Hidetoshi Shimokawa
ad5c39fe2a Don't check timeout just after booted.
Some transactions could be considered wrongly to be timeout
bacause interrupts are disabled during boot process.
2003-10-24 07:42:21 +00:00
Hartmut Brandt
0376020649 Module build infrastructure for the NgATM SAA layer. 2003-10-24 07:42:08 +00:00
Hartmut Brandt
98ef351f12 Netgraph part of the NgATM signalling AA layer. These nodes can
also be used as a general-purpose transport protocol above any
packet layer (IP, UDP).
2003-10-24 07:39:11 +00:00
Warner Losh
d2bda4e032 Backswards is as backwards does: If we're MPSAFE, then we don't need
giant, which implies that we need to take out giant it we're NOT
MPSAFE.

# I can't believe the number of people that looked at this failed to
# detect this.
2003-10-24 07:20:13 +00:00
Marcel Moolenaar
3a988c5c87 Remove unused header. See also ia64/disasm/disasm.h. 2003-10-24 06:53:43 +00:00
Marcel Moolenaar
2a0a749f39 Remove ia64_pack_bundle() and ia64_unpack_bundle(). They are not
used anymore.
2003-10-24 06:52:21 +00:00
Marcel Moolenaar
4d85274d1a Remove unused file. db_disasm() has been implemented in db_interface.c
now.
2003-10-24 06:48:41 +00:00
Alan Cox
2e3b314d3a - Push down Giant from vm_pageout() to vm_pageout_scan(), freeing
vm_pageout_page_stats() from Giant.
 - Modify vm_pager_put_pages() and vm_pager_page_unswapped() to expect the
   vm object to be locked on entry.  (All of the pager routines now expect
   this.)
2003-10-24 06:43:04 +00:00
Marcel Moolenaar
5664617492 Implement db_disasm() by using the new disassembler. Temporarily
unimplement db_write_breakpoint() and db_clear_breakpoint().
2003-10-24 06:42:03 +00:00
Mike Silbersack
0709c23335 Reduce the number of tcp time_wait structs to maxsockets / 5; this ensures
that at most 20% of sockets can be in time_wait at one time, ensuring
that time_wait sockets do not starve real connections from inpcb
structures.

No implementation change is needed, jlemon already implemented a nice
LRU-ish algorithm for tcp_tw structure recycling.

This should reduce the need for sysadmins to lower the default msl on
busy servers.
2003-10-24 05:44:14 +00:00
Arun Sharma
f47392f4c2 Use a TR of size 1 << IA64_ID_PAGE_SHIFT instead of 16M to avoid
overlapping TR/TC entries (which results in a machine check). Note
that we don't look at the size of the memory descriptor, because
it doesn't guarantee non-overlap.

With this change, a UP kernel could boot on a Intel Tiger4 machine
with the following options:

options         LOG2_ID_PAGE_SIZE=26		# 64M
options         LOG2_PAGE_SIZE=14               # 16K

Approved by: marcel
2003-10-24 04:56:58 +00:00
Peter Wemm
cedb3695c1 Add __va_copy and make it always visible, in spite of the __ISO_C_VISIBLE
setting.  Make va_copy be an alias if __ISO_C_VISIBLE >= 1999.

Why?  more than a few ports have an autoconf that looks for __va_copy
because it is available on glibc.  It is critical that we use it if
at all possible on amd64.  It generally isn't a problem for i386 and its
ilk because autoconf driven code tends to fall back to an assignment.
2003-10-24 02:50:39 +00:00