Commit Graph

38864 Commits

Author SHA1 Message Date
mdodd
8d9ce6838f Assignment could be NULL, check. 2003-03-21 15:13:29 +00:00
tjr
e2606ed034 Map VAPPEND to VWRITE in nfsspec_access() - VAPPEND is never set in the
mode returned by VOP_GETATTR. This fixes incorrect "Permission denied"
errors when trying to append to a file on an NFSv2 mount.
2003-03-21 05:13:23 +00:00
jhb
55b4beb561 Use td->td_ucred instead of td->td_proc->p_ucred. 2003-03-20 21:17:40 +00:00
jhb
bccadd8dd3 Minor fixes to ffs_fserr():
- Assume that curthread is not NULL.  It never is in -current.
- Use td_ucred instead of p_ucred.
2003-03-20 21:15:54 +00:00
jhb
418ffa05f1 Use td_ucred of curthread instead of p_ucred of curproc. This required
changing sem_perm() and sem_hasopen() to take a thread instead of a proc
for the first argument.
2003-03-20 21:12:31 +00:00
dwmalone
5794e84ca9 Extend CPU_ATHLON_SSE_HACK to cover a few more revisions of Athlon CPUs.
Submitted by: Jon Kuster <kwsn@earthlink.net>
MFC after:    2 weeks
2003-03-20 20:50:22 +00:00
orion
36f84707d2 Distinguish between register sets that depend on ac97 caps (wr0, wr1,
msgd) and those that don't (dxs0-3) when reporting format caps.
2003-03-20 20:07:18 +00:00
mux
09448722ff Use atomic operations to increment and decrement the refcount
in busdma tags.  There are currently no tags shared accross
different drivers so this isn't needed at the moment, but it
will be required when we'll have a proper newbus method to get
the parent busdma tag.
2003-03-20 19:45:26 +00:00
orion
633447db7f Correct vendor id for ALC101. 2003-03-20 18:17:39 +00:00
phk
05c83e88aa Backout the getcwd changes, a more comprehensive effort will be needed. 2003-03-20 10:40:45 +00:00
grehan
677b95ea64 Enable the FPU on first use per-thread and save state across context
switches. Not as lazy as it could be. Changing FPU state with sigcontext
still TODO.

fpu.c - convert some asm to inline C, and macroize fpu loads/stores
swtch.S - call out to save/restore fpu routines
trap.c - always call enable_fpu, since this shouldn't be called once
         the FPU has been enabled for a thread
genassym.c - define for pcb fpu flag
2003-03-20 10:28:20 +00:00
grehan
0b930980b1 - Add PCI ID for Paddington i/o controller, used in old G3's
- Add ID for the Intrepid i/o controller, used in new 12"/17" PowerBooks
- put IDs in chronological order
2003-03-20 10:18:01 +00:00
mike
e15b8bee86 Update some more namespaces (forgotten in the previous revision). 2003-03-19 15:20:02 +00:00
grehan
9be217e0b3 Add machine check handler. While generally useful, it's required when
issuing PCI config cycles on MPC106-based PowerMacs, which cause machine
checks when accessing non-existent/empty slots.
2003-03-19 08:33:21 +00:00
simokawa
9623dff573 Clear channel and tag bits before set them.
This should fix the problem that if_fwe doesn't work after DV receiving.
2003-03-19 07:04:11 +00:00
jake
479761bc56 - Remove unused cache flushing routines. These will not necessary work
on future UltraSPARC cpus for which the data cache is not direct mapped.
- Move UltraSPARC I and II (spitfire, blackbird, sapphire, sabre) specific
  functions to spitfire.c, and add cheetah.c for UltraSPARC III specific
  functions.  Initially just cache flushing, but there are a few other
  functions that will need to move here.
- Add an ipi handler for data cache flushing on UltraSPARC III.
- Use function pointers to select the right cache flushing functions based
  on cpu_impl.

With this it is possible to boot single user from an mfs root on UltraSPARC
III systems, including spinning up secondary processors.  There is currently
no support for the host to pci bridge, and no documentation for it is
publically available.

Thanks to Oleg Derevenetz for providing access to a system with UltraSPARC
III+ cpus.
2003-03-19 06:55:37 +00:00
jake
91f31ddbac - Set cpu_impl early in sparc64_init so that we can use it to detect
UltraSPARC III and higher cpus and do needed setup.
- Disable the "system tick" interrupt for UltraSPARC III.  This avoids
  an interrupt storm on startup since we're not prepared for these at
  all.  This feature has questionable use anyway.
- Clear tick on startup and then leave it alone.
2003-03-19 05:51:21 +00:00
davidxu
38a6446279 Adjust code for userland preemptive. Userland can set a quantum in
kse_mailbox to schedule an upcall, this is useful for userland timeout
routine, for example pthread_cond_timedwait().

Also extract upcall scheduling code from kse_reassign and create
a new function called thread_switchout to include these code.

Reviewed by: julain
2003-03-19 05:49:38 +00:00
jake
ede6df2801 Remove a workaround for mysterious junk appearing in the tlb of secondary
cpus.  It turned out to be a bug in the loader.
2003-03-19 05:05:08 +00:00
jake
8e6e921cb8 Implement db_print_backtrace. This may need to flush out the windows
as well.
2003-03-19 02:58:53 +00:00
silby
ff296c070e Make sure to free the correct resources when the card fails to attach
properly.  (Broken in the previous commit.)

Noticed by:	"Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
2003-03-19 01:48:14 +00:00
des
abd7bf7976 Unregisterize, ansify. 2003-03-19 00:49:40 +00:00
mux
0808d4fe70 Remove an empty comment. 2003-03-19 00:34:43 +00:00
des
8574c05076 Whitespace cleanup. 2003-03-19 00:33:38 +00:00
jake
30fc88a8de long != int. Use SYSCTL_UINT for kern.devstat.generation. Fixes booting
on sparc64.
2003-03-18 23:32:27 +00:00
sobomax
b552d09bc1 Brucify.
Requested and reviewed by:	bde
MFC after:	2 weeks
2003-03-18 21:26:28 +00:00
gallatin
7ceb3995c6 Fix a race condition in socow_setup(): The page must be wired before
sf_buf_alloc() is called, as sf_buf_alloc() may sleep.  If it does sleep,
the page might be reclaimed before wiring occurs.

Reported by: alc
2003-03-18 18:27:33 +00:00
sanpei
22f55064b6 Add support for Planex FNW-3800-TX(CardBus 100M/10M).
Submitted by:	Kunihiro Arai <araik@attglobal.net>
Obtained from:	[bsd-nomads:16625]
2003-03-18 14:57:09 +00:00
phk
aed563caa4 Missed in last commit: don't compile now non-existent geom_stats.c 2003-03-18 09:53:03 +00:00
phk
d05d6b6751 Retire the GEOM private statistics code and use devstat instead. 2003-03-18 09:42:33 +00:00
phk
72b9baaf8e If devstat_new_entry() is passed a unit number of -1 assume that
the devstat is for an "interior" GEOM node and register using the
name argument as a geom identity pointer.  Do not put these devstat
structures on the list returned by the sysctl.

This gives us the ability to tell the two kinds of nodes apart and
leave the current "strictly physical" view of devstat intact without
modifications, yet be able to use devstat for both kinds of devices.

It also saves us bloating struct devstat with another 48 bytes of
space for the name.  At least for now.

Reviewed by:    ken
2003-03-18 09:30:31 +00:00
phk
25f8576d1a Make devstat fully Giant agnostic:
Add a mutex and protect the allocation and traversal of the list with it.

When we allocate a page for devstat use we drop the mutex and use
M_WAITOK this is not nice, but under the given circumstances the
best we can do.

In the sysctl handler for returning the devstat entries we do not want to
hold the mutex across copyout(9) calls, so we keep a very careful eye on
the devstat_generation count, and abandon with EBUSY if it changes under
our feet.

Specifically test for BIO_WRITE, rather than default non-read,non-deletes
as write.  Make the default be DEVSTAT_NO_DATA.

Add atomic increments of the sequence[01] fields so applications using the
mmap'ed view stand a chance of detecting updates in progress.

Reviewed by:    ken
2003-03-18 09:20:20 +00:00
phk
f2ac891f06 Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
2003-03-18 08:45:25 +00:00
jake
82a5abf878 Remove unused fields. 2003-03-18 08:15:24 +00:00
phk
53284ea456 Make devstat_new_entry() take a const void * rather than const char *
argument, GEOM nodes are not identified by ascii string.
2003-03-18 07:52:59 +00:00
silby
e3ca15cf01 Instead of relying on a compile time define to determine whether the xl
driver should use port or memory based IO, determine it dynamically
at runtime, preferring MMIO where possible.  This helps us support newer
arches which dislike port based access better.

Tested on i386 & sparc64, with 3c900, 905, 905b, and 905C cards.
(in varying combinations by both jake and myself)
2003-03-18 06:29:51 +00:00
imp
a1671ab1e0 o Lucent cards don't seem to like multiple buffers for tx. Use only
one tx buffer for these cards.  The old driver only used one.  We use
  1 for symbol, and 3 for prism cards.
o Don't do the maximum loops thing in the ISR.  In fact, revert to the
  old interrupt handler.  Lucent cards don't seem to work too well if
  you don't disable/enable interrupts from the card in the ISR.

Between these two changes, Lucent cards suck less.  They work in
autoselect mode only.  And seem to get 1Mbps or 2Mbps only.  Setting a
specific media speed doesn't work, and I've had a few issues even with
these patches.  They turn a former brick into a nearly useful card.

These patches work on the prism 2 and 2.5 PC Card cards that I have.
I've not tested this on PCI cards.  I suspect, but couldn't find
proof, that they were the reason that the ISR was changed so radically
from its FreeBSD roots in NetBSD.  We might need to have a variant ISR
if so.
2003-03-18 04:22:42 +00:00
imp
79fa378645 Move symbol reset detection code back into wi_reset. This is a more
reliable way to detect if the symbol cards have been reset or not.
This makes symbol cards work better.

Submitted by: deischen
2003-03-18 02:54:39 +00:00
imp
096503db32 Add DLINK DWL650H
From NetBSD by way of deischen
2003-03-18 02:47:53 +00:00
imp
57d6715e3d Add SMC 2602W pci card, from a post to mobile@ 2003-03-18 02:45:29 +00:00
imp
e50e52e4a3 Use %jd and a cast to intmax_t instead of a cast to long.
Minor style nit while I'm here.
2003-03-18 02:40:40 +00:00
imp
b04e26e230 Tag longling_addr as maybe using a bad type, I'm not sure. 2003-03-18 02:38:33 +00:00
imp
35e31bc2b3 Regenerate for 1.45 2003-03-18 02:37:25 +00:00
imp
c62af2a284 Add DLINK DWL650H
From NetBSD by way of deichen
2003-03-18 02:36:54 +00:00
jhb
e3728ed108 Expand the APIC ID mask field of the ICR register to 8 bits intead of just
4 bits.  This reportedly fixes booting on the SW7500CW2.  Much thanks to
the submitter for tracking this down!

Submitted by:	Brian Buchanan <brian@ncircle.com>
Reviewed by:	peter
MFC after:	3 days
2003-03-17 19:14:13 +00:00
jake
e3b998c8d0 Clean up /dev/mem now that pmap handles illegal aliases properly. Don't
allow access to device memory through /dev/mem, or try to make modifying
kernel text through /dev/mem safe (it is not).
2003-03-17 18:53:02 +00:00
jeff
c5e3d1d4dd - Unlock the target bp and not the pager buf bp in a failure case in
cluster_wbuild().  This was causing strange panics that were widely
   reported on current@.

Big Pointy Hat to:	jeff
2003-03-17 18:38:49 +00:00
mux
5de23b6537 - Lock down the bounce pages structures. We use the same locking scheme
as with the alpha backend because both implementations of bounce pages
  are identical.
- Remove useless splhigh()/splx() calls.
2003-03-17 18:34:34 +00:00
mux
72ddefa2ee Tidy up the locking of the bounce pages structures.
- Use SYSINIT to initialize the structures instead of checking
  total_bpages against 0 in alloc_bounce_pages(), which could lead
  to several initializations being done at the same time.
- Add missing locking in bus_dmamap_load(), the bounce pages mutex
  must be held when calling reserve_bounce_pages() and when touching
  the bounce_map_waitinglist list.
- Remove the useless splhigh() and splx() calls.
- Assert that the bounce pages mutex is held in reserve_bounce_pages()
  to catch regressions.
2003-03-17 17:26:39 +00:00
imp
70fd13c4a9 Remove bogus KASSERT. The 802.11 layer and the resume from suspend
code both seem to call wi_start (directly or via the if_start pointer)
without checking to see if OACTIVE is 0.  In addition, I think that
with the use of 3 transmit buffers this routine can be called with
OACTIVE set, but I might be mistaken about that (and it doesn't
matter).

Reviewed by: sam
Noticed by: imp, alfred, ambrisko
2003-03-17 13:19:28 +00:00
phk
22c811ec53 (This commit certainly increases the need for a wash&clean of vfs_cache.c,
but I decided that it was important for this patch to not bit-rot, and
since it is mainly moving code around, the total amount of entropy is
epsilon /phk)

This is a patch to move the common parts of linux_getcwd() back into
kern/vfs_cache.c so that the standard FreeBSD libc getcwd() can use it's
extended functionality.  The linux syscall linux_getcwd() in
compat/linux/linux_getcwd.c has been rewritten to use it too.  It should
be possible to simplify libc's getcwd() after this.  No doubt this code
needs some cleaning up, since I've left in the sysctl variables I used
for debugging.

PR:	48169
Submitted by:	James Whitwell <abacau@yahoo.com.au>
2003-03-17 12:21:08 +00:00
phk
bd88919f09 Fix malloc() without legal mode flag. 2003-03-17 07:28:01 +00:00
phk
f8451ad8b4 Fix a malloc() with no legal modeflag. 2003-03-17 07:26:25 +00:00
jake
97ae94080f Ensure that kstack0 has physical colour equal to virtual colour, so that
illegal aliases will not be created in the data cache if its accessed
through another such mapping.
2003-03-17 03:18:56 +00:00
jake
e60f7f183b Subtract the memory that backs the vm_page structures from phys_avail
after mapping it.  This makes it possible to determine if a physical
page has a backing vm_page or not.
2003-03-17 03:16:00 +00:00
phk
27e546cff6 Add a #define for the device name of the mmap device for devstat.
Constify the geom identification pointer.
2003-03-16 23:20:05 +00:00
phk
ad448fcb3d #ifdef notyet a bit of code which needs not yet committed refcounting to
work correctly.
2003-03-16 16:29:04 +00:00
sos
9b24954e73 Fix the cable detection and properly find the host bridge on
older SiS chips.
2003-03-16 16:26:51 +00:00
tjr
31be6ebf42 Make udf_allocv() return an unlocked vnode instead of a locked one
to avoid a "locking against myself" panic when udf_hashins() tries
to lock it again. Lock the vnode in udf_hashins() before adding it to
the hash bucket.
2003-03-16 11:19:54 +00:00
alc
7fad887435 Pass the sf buf to MEXTADD() as the optional argument. This permits
the simplification of socow_iodone() and sf_buf_free(); they don't
have to reverse engineer the sf buf from the data's address.
2003-03-16 07:19:12 +00:00
jake
4f8dd3b959 Made the prototypes for pmap_kenter and pmap_kremove MD. These functions
are machine dependent because they are not required to update the tlb when
mappings are added or removed, and doing so is machine dependent.
In addition, an implementation may require that pages mapped with pmap_kenter
have a backing vm_page_t, which is not necessarily true of all physical
pages, and so may choose to pass the vm_page_t to pmap_kenter instead of the
physical address in order to make this requirement clear.
2003-03-16 04:16:03 +00:00
mdodd
9f76bd93cc Catch up with bpf_mtap() changes. 2003-03-16 00:30:02 +00:00
mdodd
e9cb4c3333 Catch up with recent infrastructure changes. 2003-03-16 00:24:18 +00:00
mdodd
0bc153f9c5 - Use IFP2AC().
- Support IFF_MONITOR.
- Borrow some consistency for if_input() routines from if_ethersubr.c.
- Correct comments regarding fddi_input() that no longer apply.
2003-03-16 00:17:44 +00:00
jake
b5519ed5ba Implement is_physical_memory. Accessing memory which doesn't exist causes
traps that are difficult to recover from, so we check against the memory
map returned by the prom.
2003-03-15 23:59:00 +00:00
mdodd
8a78fec96e Fix whitespace issues. 2003-03-15 23:55:33 +00:00
mdodd
ce6eeab378 Register module dependencies. 2003-03-15 23:26:41 +00:00
mdodd
0d768cf4d9 Don't build if_iso88025subr.c into the oltr module. 2003-03-15 23:24:17 +00:00
mdodd
58f34e88cb G/C unused varilable. 2003-03-15 23:21:32 +00:00
mdodd
a166a64907 Catch up with recent changes. 2003-03-15 23:20:10 +00:00
mdodd
81778cd400 Bump __FreeBSD_version for token-ring changes. 2003-03-15 23:10:05 +00:00
mdodd
f28fab8bf3 Don't strip header from packets before input routine is called. 2003-03-15 23:08:40 +00:00
mdodd
9457d96b7c Use if_printf(). 2003-03-15 23:02:36 +00:00
mdodd
b49399143f iso88025_ifattach() changes:
- Call if_attach().
- Conditionally call bpfattach() based on second function argument.
2003-03-15 22:52:23 +00:00
mdodd
489a90424e - Style(9) changes.
- Remove unneeded assignment.
- Increment if_oerrors as per if_fddisubr.c.
- Wrap ISO code with conditional.
2003-03-15 22:37:11 +00:00
mdodd
24c357e347 Stray } forgotten by manual merging. 2003-03-15 22:28:51 +00:00
mdodd
b43e84b215 - Remove stray ).
- Add missing breaks.
- Add missing if_noproto++.
2003-03-15 22:25:06 +00:00
phk
61ef4d0b23 One devstat_start_transaction_bio() is enough. 2003-03-15 22:20:38 +00:00
mdodd
564965b944 Revert part of 1.37; use bcopy() like if_fddisubr.c. 2003-03-15 22:09:29 +00:00
mdodd
797615a094 - Increment ifp->if_noproto when appropriate.
- Use 'goto dropanyway' when appropriate.
- Move dropanyway label out of switch for readability.
2003-03-15 21:59:11 +00:00
phk
cce6017a6a Run a revision of the devstat interface:
Kernel:

Change statistics to use the *uptime() timescale (ie: relative to
boottime) rather than the UTC aligned timescale.  This makes the
device statistics code oblivious to clock steps.

Change timestamps to bintime format, they are cheaper.

Remove the "busy_count", and replace it with two counter fields:
"start_count" and "end_count", which are updated in the down and
up paths respectively.  This removes the locking constraint on
devstat.

Add a timestamp argument to devstat_start_transaction(), this will
normally be a timestamp set by the *_bio() function in bp->bio_t0.
Use this field to calculate duration of I/O operations.

Add two timestamp arguments to devstat_end_transaction(), one is
the current time, a NULL pointer means "take timestamp yourself",
the other is the timestamp of when this transaction started (see
above).

Change calculation of busy_time to operate on "the salami principle":
Only when we are idle, which we can determine by the start+end
counts being identical, do we update the "busy_from" field in the
down path.  In the up path we accumulate the timeslice in busy_time
and update busy_from.

Change the byte_* and num_* fields into two arrays: bytes[] and
operations[].

Userland:

Change the misleading "busy_time" name to be called "snap_time" and
make the time long double since that is what most users need anyway,
fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same
timescale as the kernel fields.

Change devstat_compute_etime() to operate on struct bintime.

Remove the version 2 legacy interface: the change to bintime makes
compatibility far too expensive.

Fix a bug in systat's "vm" page where boot relative busy times would
be bogus.

Bump __FreeBSD_version to 500107

Review & Collaboration by:	ken
2003-03-15 21:59:06 +00:00
mdodd
053c0a390e Update interface statistics after MAC and IFF_UP|IFF_RUNNING checks. 2003-03-15 21:51:39 +00:00
mdodd
f0bf90e91d - Adopt tests for (IFF_UP|IFF_RUNNING) and non local unicast packets
in promiscuous mode from if_fddisubr.c.
- Add comment to reduce diffs.
2003-03-15 21:42:19 +00:00
mdodd
390688382a Add MAC support.
This is the same code that was added in 1.70 of if_fddisubr.c
2003-03-15 21:30:00 +00:00
mdodd
ed231d20e5 Use llc_control rather than llc_snap.control. 2003-03-15 20:35:19 +00:00
mdodd
3a12ab5342 - Add comment.
- Whitespace fixes.
2003-03-15 20:33:30 +00:00
mdodd
c339938a35 Reduce code differences. 2003-03-15 19:37:44 +00:00
mdodd
cf21a82a02 Use ISO88025_ADDR_LEN where appropriate. 2003-03-15 19:25:00 +00:00
mdodd
64c5df2c6b Don't use etherbroadcastaddr; use iso88025_broadcastaddr. 2003-03-15 19:16:39 +00:00
mdodd
ec0d0b87d8 - Remove definition of senderr() from iso88025.h.
- Use definition of senderr() from if_ethersubr.c.
2003-03-15 19:10:19 +00:00
sobomax
b8e959461b Remove duplicate line introduced in the previous commit.
Submitted by:	bde
MFC after:	2 weeks
2003-03-15 18:49:41 +00:00
mdodd
a82bd5bb3d Some whitespace/style/readability changes. 2003-03-15 17:54:49 +00:00
mdodd
4e2727ed85 Add iso88025_resolvemulti().
Cribbed from net/if_fddisubr.c
2003-03-15 16:49:08 +00:00
mdodd
9d6ba2c0d8 Fix formatting of iso88025_ifattach(). 2003-03-15 16:41:35 +00:00
mdodd
76cf715401 Re-order and prune includes. 2003-03-15 16:37:28 +00:00
sobomax
3fa073234e - Add minimal support for TI16754 4xUART chip into sio(4) driver and remove
now unnecessary hack from the previous commit;
- Add support for Interrupt Latch Register (ILR) into puc(4). So far only
  ILRs compatible with specifications from Digi International are supported.
  Support for other types of ILRs could be easily added later;
- Correct clock frequency for IC Book Labs Dreadnought x16 Lite board;
- Enable ILR detection/usage for IC Book Labs Dreadnought x16 boards.

Sponsored by:   IC Book Labs
MFC after:      2 weeks
2003-03-15 16:25:40 +00:00
mdodd
5eadb25e88 Add module data and version. 2003-03-15 15:38:02 +00:00
mdodd
ae74f2cf81 s/llc_un.type_snap/llc_snap/g 2003-03-15 15:35:25 +00:00
mdodd
73ad9b181a Formatting and whitespace changes. 2003-03-15 15:09:11 +00:00
takawata
0e93265644 Add module dependency. This makes udbp.ko to be loaded. 2003-03-15 13:03:30 +00:00
phk
28813b6c75 Fix a bug I introduced by overlooking the fact that "unit number" can
be one of several things in this driver.

Spotted & Tested by:	alfred
2003-03-15 12:16:33 +00:00
phk
a2ffb5ee4c Don't use the devstat->busy_count for state decisions in the device
drivers.  Doing so imposes atomicity and locking constraints on the
devstat API.

By:	ken
2003-03-15 11:00:56 +00:00
phk
c499b5c75d Call devstat_start_transaction_bio() instead of devstat_start_transaction(). 2003-03-15 10:56:19 +00:00
phk
67812854ff Call devstat_start_transaction_bio() instead of devstat_start_transaction() 2003-03-15 10:50:44 +00:00
phk
fbb2d505ca Use devstat_{start,end}_transaction_bio().
Remember to set bio_resid correctly first.
2003-03-15 10:49:26 +00:00
phk
183ed146b6 Add a devstat_start_transaction_bio() to match the
devstat_end_transaction_bio() we already have.

For now it just calls devstat_start_transaction(), but that will change
shortly.
2003-03-15 10:33:32 +00:00
cjc
24fb057128 Add a 'verrevpath' option that verifies the interface that a packet
comes in on is the same interface that we would route out of to get to
the packet's source address. Essentially automates an anti-spoofing
check using the information in the routing table.

Experimental. The usage and rule format for the feature may still be
subject to change.
2003-03-15 01:13:00 +00:00
mike
e8d4351bc0 Add missing types, update standard namespaces, and use variable types
that don't require <sys/types.h>.
2003-03-14 16:09:48 +00:00
mux
90f311efb8 Bah, get it right this time and add sys/lock.h before sys/mutex.h. 2003-03-14 13:30:31 +00:00
jake
0d087301f6 lock.h must be included before mutex.h. 2003-03-14 07:19:29 +00:00
jeff
a400940b78 - Add a forgotten BUF_LOCK()
Most sincere apologies to:	jake
2003-03-14 05:13:19 +00:00
davidxu
5790b70bec Export current time when returning from never blocked syscall. 2003-03-14 03:52:16 +00:00
mux
62daf20ba8 Oops, add missing includes. Pass me the pointy hat.
Reported by:	jake
2003-03-14 00:04:37 +00:00
jhb
ebf0ff8f56 Trim some trailing whitespace. 2003-03-13 23:07:09 +00:00
scottl
ef9362c01f Now that bus_dmamem_alloc() handles its Giant mutex requirements itself,
don't bother doing the same in the code that calls it.
2003-03-13 22:56:11 +00:00
jhb
bd2a1c12dc - Change the linux_[gs]et_os{name, release, s_version}() functions to
take a thread instead of a proc for their first argument.
- Add a mutex to protect the system-wide Linux osname, osrelease, and
  oss_version variables.
- Change linux_get_prison() to take a thread instead of a proc for its
  first argument and to use td_ucred rather than p_ucred.  This is ok
  because a thread's prison does not change even though it's ucred might.
- Also, change linux_get_prison() to return a struct prison * instead of
  a struct linux_prison * since it returns with the struct prison locked
  and this makes it easier to safely unlock the prison when we are done
  messing with it.
2003-03-13 22:45:43 +00:00
jhb
bf46f14d90 Add a new userland-visible ktrace flag KTR_DROP and an internal ktrace flag
KTRFAC_DROP to track instances when ktrace events are dropped due to the
request pool being exhausted.  When a thread tries to post a ktrace event
and is unable to due to no available ktrace request objects, it sets
KTRFAC_DROP in its process' p_traceflag field.  The next trace event to
successfully post from that process will set the KTR_DROP flag in the
header of the request going out and clear KTRFAC_DROP.

The KTR_DROP flag is the high bit in the type field of the ktr_header
structure.  Older kdump binaries will simply complain about an unknown type
when seeing an entry with KTR_DROP set.  Note that KTR_DROP being set on a
record in a ktrace file does not tell you anything except that at least one
event from this process was dropped prior to this event.  The user has no
way of knowing what types of events were dropped nor how many were dropped.

Requested by:	phk
2003-03-13 18:31:15 +00:00
jhb
13891daa83 - Cache a reference to the credential of the thread that starts a ktrace in
struct proc as p_tracecred alongside the current cache of the vnode in
  p_tracep.  This credential is then used for all later ktrace operations on
  this file rather than using the credential of the current thread at the
  time of each ktrace event.
- Now that we have multiple ktrace-related items in struct proc that are
  pointers, rename p_tracep to p_tracevp to make it less ambiguous.

Requested by:	rwatson (1)
2003-03-13 18:24:22 +00:00
mux
f834cef113 Grab Giant around calls to contigmalloc() and contigfree() so
that drivers converted to be MP safe don't have to deal with it.
2003-03-13 17:18:48 +00:00
mux
35953f3b7d Memory allocated with contigmalloc() should be freed with
contigfree(), not with free().
2003-03-13 17:10:54 +00:00
harti
a48fa24f97 This corrects a longstanding endian bug in processing LLC/SNAP encoded
frames. A comment in if_atm.h suggests that both macros, that for extracting
the ethertype and that for inserting it, handle their argument in host
byte order. In fact, the inserting macro treated its argument as an opposite
host order short and the calling code feeds it the result of htons(). This
happens to work on i386, but fails on sparc. Make the macro use real host
endianess.

Reviewed by:	kjc, atm@
2003-03-13 12:44:06 +00:00
hsu
9cad3f378d Greatly simplify the unlocking logic by holding the TCP protocol lock until
after FIN_WAIT_2 processing.

Helped with debugging:	Doug Barton
2003-03-13 11:46:57 +00:00
sos
d4177ef8a4 Remove the check for more than one open if one is a write op.
This allows using DVD+RW and DVD-RW as random storage, provided
the 32K blocksize is honoured for DVD-RW (DVD+RW has built in
read-modify-write).
2003-03-13 09:12:17 +00:00
sos
983068b66b Dont free the stats struct, this has been changed by the new stat code.
Spotted by: Ian Dowse <iedowse@maths.tcd.ie>
2003-03-13 09:09:10 +00:00
sos
37201eb88c Dont call dma->free unless dma is there.
Spotted by: Ian Dowse <iedowse@maths.tcd.ie>
2003-03-13 09:04:55 +00:00
iedowse
710d5c379e In m_dup_pkthdr(), convert the supplied `how' argument into malloc
flags when passing it into m_tag_copy_chain(), as m_tag* functions
use malloc, not mbuf flags.
2003-03-13 09:02:19 +00:00
sos
328dd76438 Add pci id# for the sis648 2003-03-13 07:55:53 +00:00
jeff
41b360d7d2 - Add a lock for protecting against msleep(bp, ...) wakeup(bp) races.
- Create a new function bdone() which sets B_DONE and calls wakup(bp). This
   is suitable for use as b_iodone for buf consumers who are not going
   through the buf cache.
 - Create a new function bwait() which waits for the buf to be done at a set
   priority and with a specific wmesg.
 - Replace several cases where the above functionality was implemented
   without locking with the new functions.
2003-03-13 07:31:45 +00:00
jeff
0cd05b6f75 - Remove a dead check for bp->b_vp == vp in vtruncbuf(). This has not been
possible for some time.
 - Lock the buf before accessing fields.  This should very rarely be locked.
 - Assert that B_DELWRI is set after we acquire the buf.  This should always
   be the case now.
2003-03-13 07:22:53 +00:00
jeff
1edba4995f - Remove a race between fsync like functions and flushbufqueues() by
requiring locked bufs in vfs_bio_awrite().  Previously the buf could
   have been written out by fsync before we acquired the buf lock if it
   weren't for giant.  The cluster_wbuild() handles this race properly but
   the single write at the end of vfs_bio_awrite() would not.
 - Modify flushbufqueues() so there is only one copy of the loop.  Pass a
   parameter in that says whether or not we should sync bufs with deps.
 - Call flushbufqueues() a second time and then break if we couldn't find
   any bufs without deps.
2003-03-13 07:19:23 +00:00
jeff
883549405e - Lock the buf before clearing flags. 2003-03-13 07:07:16 +00:00
jeff
7d8fd04a64 - Lock bufs before inspecting their flags. 2003-03-13 07:05:22 +00:00
jeff
51a7414bd1 - Lock the buf before inspecting its contents. 2003-03-13 07:04:11 +00:00
alfred
166e40d4c4 Make sure we actually have a dev before dereferencing in case someone
botches and sends us a NULL pointer.  The other code in this file seems
to expect it to be able to handle it behaving this way.
2003-03-13 06:29:44 +00:00
jeff
e739ae1aa5 - Tune down read_max. For single disks we get no gain out of reading more
than a MAXPHYS size block ahead.  Having this set too high just leaves
   other processes starved for IO and screws up interactive response.  Let the
   users with RAID set it higher when they need it.
2003-03-13 06:17:59 +00:00
hsu
5da0ae152a Add support for RFC 3390, which allows for a variable-sized
initial congestion window.
2003-03-13 01:43:45 +00:00
tjr
9fe675b183 Tidy up previous change: move comment about obtaining an exclusive
reference where it belongs, and remove a blank line to make it more
obvious what the comment applies to.
2003-03-13 00:57:47 +00:00
tjr
32fe2a41fe Back out previous. The locking here needs a rethink. 2003-03-13 00:54:53 +00:00
mux
f10f9c46bb Pass the correct malloc flags to m_tag_alloc(). 2003-03-13 00:30:31 +00:00
das
45e9bd9785 - When the VM daemon is out of swap space and looking for a
process to kill, don't block on a map lock while holding the
  process lock.  Instead, skip processes whose map locks are held
  and find something else to kill.
- Add vm_map_trylock_read() to support the above.

Reviewed by:	alc, mike (mentor)
2003-03-12 23:13:16 +00:00
hsu
0e9062f1d0 Implement the Limited Transmit algorithm (RFC 3042). 2003-03-12 20:27:28 +00:00
jhb
0be30c484d - Various little style fixes.
- If SYSCTL_OUT() fails in sysctl_kern_proc_args(), return the error
  instead of ignoring it if we have new arguments for the process.
- If the new arguments for a process are too long, return ENOMEM instead of
  returning success but not doing the actual copy.

Submitted by:	bde
2003-03-12 20:17:40 +00:00
sobomax
d0852f7c93 Correct clock frequency for the IC Book Labs' cards, so that it's possible
to use speeds higher than 115200.

Sponsored by:	IC Book Labs
MFC after:	2 weeks
2003-03-12 17:56:03 +00:00
sobomax
673e556649 Add initial support for IC Book Labs Dreadnought x16 Pro 16-ports card. Since
this card is based on 16750 UART, modify sio(4) a bit to ignore 16750-specific
7th bit of MCR when probing card. This allows card to be detected and attached
as 16550A-compatible device. More work needs to be done in order to enable
nice 16750-specific features such as larger fifo buffer and higher speeds.

Sponsored by:	IC Book Labs
MFC after:	2 weeks
2003-03-12 17:20:24 +00:00
jhb
c615a78847 - Avoid dropping the proc lock around a simple permissions check and just
hold hold it across the check to avoid extra lock operations in the
  common case.
- Copy in the new args to a temporary pargs structure before we drop the
  reference to the old one.  Thus, if the copyin() fails, the process
  arguments are unchanged rather than being deleted.  Also, p_args is no
  longer NULL during the sysctl operation.
2003-03-12 16:14:55 +00:00
sos
f481f8fd98 Correct the last commit, only look for subfunctions on the same PCI slot. 2003-03-12 15:45:52 +00:00
orion
621cc343ad Correct CS4205 base vendor id.
Reported by:    Christophe Juniet and Mark Santcroos.
2003-03-12 15:11:25 +00:00
sam
cc02a7a61a correct two more flag misuses; m_tag* use malloc flags 2003-03-12 14:45:22 +00:00
ru
bbd0f8e149 Simplify the assignment statement. 2003-03-12 14:32:46 +00:00
sos
0d86fbf68f Cleanup the probe code a bit. 2003-03-12 12:05:17 +00:00