Commit Graph

40562 Commits

Author SHA1 Message Date
David E. O'Brien
16dbc7f228 Use __FBSDID(). 2003-06-10 21:29:12 +00:00
Alan Cox
2a8f9ab57f - Finish vm object and page locking in vnode_pager_setsize().
- Make some small style changes to vnode_pager_setsize(); most notably,
   move two comments to a more logical place.
2003-06-10 20:28:41 +00:00
David E. O'Brien
ee709e7024 Use __FBSDID(). 2003-06-10 18:14:05 +00:00
David E. O'Brien
9c963d873e Use __FBSDID(). 2003-06-10 17:50:20 +00:00
David E. O'Brien
61334e3b42 Use __FBSDID(). 2003-06-10 17:31:31 +00:00
David E. O'Brien
a880eba3cf Use __FBSDID(). 2003-06-10 17:10:18 +00:00
David E. O'Brien
f59584cd7f Use __FBSDID(). 2003-06-10 17:02:51 +00:00
David E. O'Brien
fa58a9089f Use __FBSDID(). 2003-06-10 16:50:43 +00:00
Hidetoshi Shimokawa
0b1739465d Fix typo in the previous revision. 2003-06-10 12:08:58 +00:00
David E. O'Brien
e9f0aa0360 Use __FBSDID(). 2003-06-10 05:05:54 +00:00
Justin T. Gibbs
a9fe95487e Sync perforce IDs. 2003-06-10 03:25:24 +00:00
Hidetoshi Shimokawa
97aad8deb4 Fix struct bus_info on big-endian machines. 2003-06-10 02:29:10 +00:00
Hidetoshi Shimokawa
efd4a0c1ec Add tx_speed sysctl variable. 2003-06-10 02:27:39 +00:00
David Xu
36407bec4f If there are signals delivered to current thread, breaks out of loop,
userret() will be called again by ast() and thread_userret() will be
called again by userret().

Reported by: tegge
2003-06-10 02:21:32 +00:00
Poul-Henning Kamp
c1f5a18201 Revert last commit, I have no idea what happened. 2003-06-09 22:51:36 +00:00
Stefan Eßer
fb9d7a4b40 Remove embededded ID string which was meant to provide information
about the driver version in case of an error report. It conflicts with
some other variable of the same name that has been added to the kernel
just recently and there haven't been any bug reports for quite some
time now, anyway ...
2003-06-09 22:16:00 +00:00
Maxime Henrion
0ca5dc1c3e style(9). 2003-06-09 21:57:48 +00:00
Poul-Henning Kamp
87eca0f99c Add new geom_ccd module 2003-06-09 21:49:54 +00:00
Poul-Henning Kamp
68bf8b56da remove old CCD module 2003-06-09 21:48:12 +00:00
John Baldwin
5499ea019d Wait for the real interval timer callout handler to finish executing if it
is currently executing when we try to remove it in exit1().  Without this,
it was possible for the callout to bogusly rearm itself and eventually
refire after the process had been free'd resulting in a panic.

PR:		kern/51964
Reported by:	Jilles Tjoelker <jilles@stack.nl>
Reviewed by:	tegge, bde
2003-06-09 21:46:22 +00:00
John Baldwin
8bccf7034e The issetugid() function is MPSAFE. 2003-06-09 21:34:19 +00:00
Scott Long
87947cad18 Track the resource id of the memory port instead of just assuming that
it is 0x0.  Cardbus-based sio/modem cards can now be ejected without
panic'ing.
2003-06-09 21:25:14 +00:00
Poul-Henning Kamp
47f94c12da A white-space nit I noticed. 2003-06-09 19:40:34 +00:00
Alan Cox
06fa71cdcc Update the vm object and page locking in exec_map_first_page(). Mark the
one still anticipated change with XXX.  Otherwise, this function is done.
2003-06-09 19:37:14 +00:00
Poul-Henning Kamp
df622d54f8 GEOMification of CCD.
You need your kernel and ccdconfig(8) to be in sync, particularly if your
source tree is on a ccd device.
2003-06-09 19:25:07 +00:00
Alan Cox
4412dc5468 - Add vm object locking to vm_pgmoveco().
- Add a comment to vm_pgmoveco() describing what remains to be done
   for vm locking.
2003-06-09 19:23:03 +00:00
Max Khon
3ba993a100 Merge NetBSD bktr_core.c rev. 1.26:
Fix broken programming of VSCALE_HI registers in yuv422_prog().

PR:		46521
Obtained from:	NetBSD
MFC after:	3 days
2003-06-09 19:13:38 +00:00
Poul-Henning Kamp
ec421aec25 Fix error handling for ENOMEM style issues. 2003-06-09 19:12:19 +00:00
Max Khon
46e0ffba9b Add two more Vendor ID's for Leadtek Winfast TV 2000
PR:		47453
Obtained from:	NetBSD (partially)
2003-06-09 19:11:01 +00:00
Juli Mallett
c02d762181 Attempt to fix Alpha build by renaming ident[] to kern_ident[]. 2003-06-09 18:19:33 +00:00
John Baldwin
bd77aaf980 When we re-route a PCI interrupt, write the new IRQ value into the intline
register.

Reviewed by:	imp
2003-06-09 18:08:46 +00:00
John Baldwin
5e26dcb560 - Add a td_pflags field to struct thread for private flags accessed only by
curthread.  Unlike td_flags, this field does not need any locking.
- Replace the td_inktr and td_inktrace variables with equivalent private
  thread flags.
- Move TDF_OLDMASK over to the private flags field so it no longer requires
  sched_lock.
2003-06-09 17:38:32 +00:00
Hiten Pandya
d4eba12bb0 Add a comment to de-obfuscate the meaning of the PQ_CACHESIZE
kernel configuration option.  This created confusion resulting
into a PR.

PR:			docs/45294
Approved by:		des (mentor)
Discussed with:		bmilekic
2003-06-09 17:09:51 +00:00
Juli Mallett
da1186f2c7 Expose kern.ident by way of OID_AUTO.
Requested by:	phk
2003-06-09 10:54:23 +00:00
Juli Mallett
c4119c76f8 Make kernel identification (`ident' in the config(8) driver) available to
userland, and the kernel.  In the kernel by way of the 'ident[]' variable
akin to all the other stuff generated by newvers.sh.  In userland it is
available to sysctl consumers via KERN_IDENT or 'kern.ident'.  It is exported
by uname(1) by the -i flag.

Reviewed by:	hackers@
2003-06-09 09:38:20 +00:00
Alan Cox
bc5b057f6c Hold the vm object's lock when performing vm_page_lookup(). 2003-06-09 07:01:05 +00:00
Alan Cox
3471677cc9 Don't use vm_object_set_flag() to initialize the vm object's flags. 2003-06-09 06:50:02 +00:00
Jeffrey Hsu
807c988d7a On a socket creation error, don't close the socket. 2003-06-09 03:44:34 +00:00
Jeff Roberson
356500a306 - Add a simple CPU load balancing algorithm. This works by executing once a
second and equalizing the load between the two most imbalanced CPU.  This
   is intended to clear up long term load imbalances that would not be handled
   by the 'pull' method in sched_choose().
 - Pull out some bits of sched_choose() into a kseq_move() function that moves
   an arbitrary thread from one kseq to another.
2003-06-09 00:39:09 +00:00
Alan Cox
138449dc19 - Properly handle the paging_in_progress case on two vm objects in
vm_object_deallocate().
 - Remove vm_object_pip_sleep().
2003-06-08 23:01:24 +00:00
Dag-Erling Smørgrav
3f0a1da2f8 Revert part of rev 1.43. We want to fail gracefully if there is no packet
waiting in the interface queue.

Submitted by:	Yeasah Pell <yeasah@apocalypse.org>
2003-06-08 18:35:25 +00:00
Yoshihiro Takahashi
82cdd526b1 Don't route PCI irq on pc98. 2003-06-08 11:18:35 +00:00
Martin Blapp
e351d778f2 Add ADMtek ADM9511 and ADM9513 device ID's.
PR:		PR51823
Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Reviewed by:	phk
MFC after:	2 days
2003-06-08 10:11:55 +00:00
Philippe Charnier
9703a107f2 The .Fn function 2003-06-08 09:53:08 +00:00
Alan Cox
fd0cc9a862 Lock the vm object when performing vm_page_grab(). 2003-06-08 07:14:30 +00:00
Yoshihiro Takahashi
3889b283ef Add help file for pc98. 2003-06-08 03:34:49 +00:00
Yoshihiro Takahashi
c7fd521917 Enable new boot menu. 2003-06-08 03:20:35 +00:00
Yoshihiro Takahashi
b16ea1159d Don't load the acpi module. 2003-06-08 03:16:59 +00:00
Yoshihiro Takahashi
c2098cc1ad Set arch-pc98 env to true for pc98. 2003-06-08 03:11:16 +00:00
Juli Mallett
d196a10856 Note that scbus is required for SCSI, not just "required" in general.
Submitted by:	Edward Kaplan (tmbg37 on IRC)
Reviewed by:	rwatson (in principle)
2003-06-08 02:03:02 +00:00
Jeff Roberson
b90816f188 - When a new thread is added to a kseq the load is incremented prior to
adding it to the nice tables.  Therefore, in kseq_add_nice, we should
   keep in mind that the load will be 1 if we are the only thread, and not
   0.
 - Assert that the sched lock is held in all the appropriate places.
 - Increase the scope of the sched lock in sched_pctcpu_update().
 - Hold the sched lock in sched_runnable().  It is not held by the caller.
2003-06-08 00:47:33 +00:00
Alan Cox
984a95d563 Lock the kernel object in kmem_alloc(). 2003-06-07 23:24:10 +00:00
Alan Cox
36d1fdf5a2 Teach vm_page_grab() how to handle the vm object's lock. 2003-06-07 23:22:04 +00:00
David E. O'Brien
1021f44ab9 This commit was generated by cvs2svn to compensate for changes in r115990,
which included commits to RCS files with non-trunk default branches.
2003-06-07 20:54:30 +00:00
David E. O'Brien
dfbebb8f61 Vendor import emu10k1.h from version 0.9.4 of the ALSA driver (which
includes some needed Audigy support).  This can be found at
ftp://ftp.alsa-project.org/pub/driver/alsa-driver-0.9.4.tar.bz2
and http://www.alsa-project.org/alsa/cvs/alsa-kernel/include/emu10k1.h
2003-06-07 20:54:30 +00:00
Warner Losh
e08a16f0df MFp4:
Migrate some common pccard code into exca.
2003-06-07 20:47:35 +00:00
Warner Losh
090555da5b MFP4:
Merge some common code from cbb into exca.
2003-06-07 20:46:39 +00:00
Alan Cox
19ba4c8e49 Assert that the vm object is locked on entry to swap_pager_freespace(). 2003-06-07 20:43:16 +00:00
Warner Losh
bb22b14154 Simplify the power code somewhat (this makes the module about 100
bytes smaller).
2003-06-07 20:18:45 +00:00
Jake Burkholder
2c7df6a555 Implement OF_interpret.
Obtained from:	netbsd
2003-06-07 18:34:04 +00:00
Jake Burkholder
3e7f1990ff - Declare sparc64_memreg and sparc64_nmemreg in machine/ofw_mem.h.
- On startup print the total physical memory, instead of what we're told is
  free by the firmware, to avoid astonishing users.
2003-06-07 18:29:29 +00:00
Jake Burkholder
9fabb18288 BKPT_INST is supposed to be a breakpoint, not 0. 2003-06-07 18:24:37 +00:00
Jake Burkholder
1030d2ba0b Use the same SEARCH_DIR as other platforms. 2003-06-07 18:23:50 +00:00
David E. O'Brien
9b8d527fef Add ${AFLAGS} to 'as' invocation. 2003-06-07 17:42:26 +00:00
Poul-Henning Kamp
84c080a85e Improve the root-dev prompt facility for printing devices which could
possibly be a root filesystem.
2003-06-07 15:46:53 +00:00
Poul-Henning Kamp
ac2ba9e3d5 Wait for everything to settle before we try to print the list of
geom devices.
2003-06-07 15:32:09 +00:00
Poul-Henning Kamp
b61e8fed30 Make sure we return an error message if the geom parameter is not
located.
2003-06-07 15:31:44 +00:00
Søren Schmidt
c283397793 Fix the setup of old Promise controllers, clocks was not setup right
causing way too low transfer rates.

Enable interrupts on old CMD64[89] chips, apparently some bogus BIOS's
doesn't get this right.
2003-06-07 15:19:16 +00:00
John Baldwin
1beb381637 - Adjust the comment about re-routing PCI interrupts to be less
ia64-specific.
- When trying to re-route interrupts, don't change cfg->intline if the
  re-route fails by returning an invalid vector.  This fixes machines
  without any way of routing interrupts such as older PC's without a
  $PIR table.

We do not currently write the new intline value back to the hardware, but
we should.  That will likely be added in a later commit.
2003-06-07 15:00:19 +00:00
John Baldwin
9dc9d63d01 Reinstate the bug fix in revision 1.2 as it is correct. The errors I saw
on my laptop after this change were the result of a bug in the ACPICA code.
2003-06-07 14:34:18 +00:00
Poul-Henning Kamp
c44c213f24 Polishing and nitpicking. 2003-06-07 11:06:44 +00:00
Poul-Henning Kamp
df2c3922e9 Drop a memory-corruption debugging test-tool. 2003-06-07 10:55:48 +00:00
Poul-Henning Kamp
a1a9b44569 Add missing va_end() calls.
Noticed by:	tmm
2003-06-07 10:16:53 +00:00
Poul-Henning Kamp
2d20f433ed Sanitize the LABELSECTOR & LABELOFFSET definitions:
Remove sparc64 definitions.
	Remove fallback definitions.
2003-06-07 09:06:39 +00:00
Yoshihiro Takahashi
d83e355c40 MFi386: revisions 1.13 and 1.14. 2003-06-07 08:36:41 +00:00
Yoshihiro Takahashi
bd7cefa085 MFi386: revision 1.30. 2003-06-07 08:23:42 +00:00
Yoshihiro Takahashi
edbced73de Fixed compile error. 2003-06-07 08:18:25 +00:00
David E. O'Brien
9ad6ff5596 Don't use a C compiler to assemble a pure asm file. 2003-06-07 08:03:19 +00:00
Peter Wemm
b37d468c2a Gah! Set LABELSECTOR and LABELOFFSET correctly for amd64. This might
explain why I've been having trouble with libdisk and sysinstall...
2003-06-07 07:07:04 +00:00
Marcel Moolenaar
6f2071769f pmap_find_vhpt() has been observed to return a NULL pointer when
the caller assumes this to not happen by means of performing an
indirection without checking the return value. Add KASSERTs to
force a kernel with INVARIANTS to panic. This is a short-term
measure. The pmap code is scheduled to be overhauled.
2003-06-07 04:17:39 +00:00
Marcel Moolenaar
f09b81f8be If we get a fault in the gateway page, which would happen if we try
to deliver a signal and the RSE backing store has been exhausted or
the backing store pointer has been clobbered, we need to make sure
we call userret() and do_ast() when we exit from trap(). Not adjusting
the local variable 'user' in this case will prevent the faulty process
from being terminated and we end up in an infinite fault repetition.

Faulty process provided by: bento
2003-06-07 04:10:07 +00:00
Alan Cox
d7fc221044 Pass the vm object to vm_object_collapse() with its lock held. 2003-06-07 02:29:17 +00:00
Justin T. Gibbs
71b2757314 When single stepping, only leave ENBUSFREE enabled
if it was already enabled.  We don't want to set it
when it shouldn't be set, we just don't want to
inadvertantly turn it off.  This should fix a recent
report of the aic7xxx driver repeatedly complaining of
"unexpected busfree while idle" in one configuration.
2003-06-06 23:53:39 +00:00
Justin T. Gibbs
176b648e01 Clear stale PCI errors during our test for
successfully mapping our registers.  This
avoids the disabling of memory mapped I/O
just because some other driver probe happened
to touch our registers.
2003-06-06 23:52:34 +00:00
Justin T. Gibbs
79234f55e6 Work around SCSI spec violation by the Quantum Atlas 10K.
This drive delays going async after receiving a WDTR
message.  We now send an SDTR message after a WDTR even
if our goal is to go async.  This should work even for
confused devices.

If we get an unexpected busfree when attempting a WDTR
or SDTR, only set the goal negotiation parameters we were
trying to negotiate to off.  This means that should a WDTR
message fail, we will still try an SDTR if our goal is
non-async.

Fix a few more places where we were looking at goal.period
instead of goal.offset for determining if we should be
negotiating sync.  This should not have any impact on
our behavior, but the offset is more definitive and should
be used.
2003-06-06 23:51:13 +00:00
Justin T. Gibbs
1d528d6792 aic7770.c:
aic79xx.c:
aic79xx.h:
aic79xx_pci.c:
aic7xxx.c:
aic7xxx.h:
aic7xxx_pci.c:
	Switch ah?_reset() to take an additional "reinit" argument.
	Use this instead of init_level to determin if the chip
	should be fully reinitialized after a chip reset.  This
	is required so that ah?_shutdown() can reset the chip
	without side-effects.

aic79xx.c:
	Implement ahd_suspend() and ahd_resume().

aic7xxx.c:
	Change ahc_loadseq() to *not* restart the sequencer.
	This brings the loadseq behavior in line with that
	of the 7902 driver and also simplifies the init routine.

	Correct the resume routine to enable interrupts and
	restart the sequencer.
2003-06-06 23:48:19 +00:00
Marcel Moolenaar
0785ee125b Use TRAPF_USERMODE() to replace an equivalent check in trap(). While
here, amend the related comment.
2003-06-06 23:44:05 +00:00
Justin T. Gibbs
447449473c Add probe entry for the 284X with BIOS disabled. 2003-06-06 23:40:48 +00:00
Justin T. Gibbs
d6b641de7f Constify a string used in our EISA probe tables.
Fix a few style nits.
2003-06-06 23:40:07 +00:00
Marcel Moolenaar
eaa7bda4a5 Have TRAPF_USERMODE() take into account that the gateway page is not
always kernel space. It should be treated as user space when run with
user privileges (which is the case for the signal trampolines). This
fixes its only use in a KASSERT in subr_trap.c.
2003-06-06 23:27:18 +00:00
Julian Elischer
b410626185 Attempt to crunch down the thread state info so that it is more likely to
fit on one line. Account for threads better.

* No need to report that it is on a sleep queue if it is actually sleeping
* "Normal" state is almost ubiquitous.. only report abnormal states.
* increment the #lines count for each separate thread shown in threaded
  programs.

makes it less likely that a threaded program will make all the data
on a screen overflow off the top of the screen.
2003-06-06 20:28:11 +00:00
Robert Watson
042bbfa3b5 When setting fragment queue pointers to NULL, or comparing them with
NULL, use NULL rather than 0 to improve readability.
2003-06-06 19:32:48 +00:00
John Baldwin
ba40a03417 - Rename nexus_pcib to legacy_pcib. I've been meaning to do this for a
while after the legacy device was added since this driver hangs from
  legacy and not nexus.
- Make several methods non-static so they can be reused in a mptable
  host -> pci bridge driver that will be added at a later date.
- Let legacy_pcib() use pcibios_pcib_route_interrupt() directly instead of
  wrapping it in a private function.  Originally, I thought I was going to
  have the nexus_pcib() driver make a runtime APIC vs. 8259A check and call
  the appropriate routing method (MPTable vs. PIR) that way, but it ended
  up being cleaner to make nexus_pcib() just work with PIR and have a
  separate host -> pci bridge driver for the mptable/apic case.
2003-06-06 17:56:30 +00:00
John Baldwin
6b9691f103 - Use IDTVEC() to declare IPI handlers since they are also IDT vectors.
- Make handlers for IPI's used by SMP kernels #ifdef SMP.
2003-06-06 17:45:25 +00:00
John Baldwin
cdd83b0ad1 Use the secondary bus number instead of the number of the bus the PCI-PCI
bridge lives on (i.e., the parent bus) when probing the PIR table for a
bus.  This could cause the PCIBIOS PCI-PCI bridge driver to bogusly attach
to bridges that weren't in the PIR but whose parent bus was in the PIR.
2003-06-06 17:27:18 +00:00
John Baldwin
e59ae32f18 - Document the thermal and performance counter LVT entries in the local
APIC.
- Add a lvt_thermal member to the LAPIC struct.
- Add constants for the SMI and INIT LVT delivery modes.
2003-06-06 17:22:15 +00:00
John Baldwin
a85b6f827b Handle the TDS_INACTIVE state by printing '[INACTIVE]' instead of
panic'ing.  Also, for unknown thread states, print out the value rather
than panic.  Panic'ing in the debugger is pointless at best.
2003-06-06 17:20:47 +00:00
John Baldwin
ac39898e7e Whitespace nits. 2003-06-06 17:19:27 +00:00
Jun Kuriyama
5b63e8fcf0 Tweak make values and targets not to build kgzldr.o at
installation stage.

Reviewed by: bde
2003-06-06 13:49:51 +00:00
Yaroslav Tykhiy
652065e01d Correct the man section number in references to kldstat(8). 2003-06-06 09:36:40 +00:00
Greg Lehey
173cc338ed Add macros for kernel debugging. These have been around for a
while, and they will need some more tuning before they're really
useful, but at the moment they're better than nothing.

Indirectly reminded by:	dwhite
2003-06-06 06:44:49 +00:00
Warner Losh
e4e7b5bc54 Add two of three workarounds for interrupt storms for o2micro parts as
obtained from o2micro.  These should only be needed for 'older'
o2micro bridges (anything before the 7xxx series of bridges), but will
work with the new bridges.

# I don't plan on porting it to oldcard, but will happily commit to
# oldcard if someone else needs them.
2003-06-06 06:00:49 +00:00
David Xu
b0bd5f38a6 thread_signal_add now is called with ps_mtx held, unlock it before
calling copyin.
2003-06-06 02:17:38 +00:00
Poul-Henning Kamp
8f16d45326 Fix NFS file swapping, I broke it 3 months ago it seems. 2003-06-05 21:57:19 +00:00
Alan Cox
40b808a842 - Extend the scope of the backing object's lock in vm_object_collapse(). 2003-06-05 20:55:27 +00:00
Prafulla Deuskar
d30350e524 Add support for Quad port adapter
Add sysctl's to display statistics/debug_info
Set WAIT_FOR_AUTONEG_DEFAULT to zero by default
Increment packet in/out statistics inline instead of every two seconds.

MFC after:	3 days
2003-06-05 17:51:38 +00:00
Jeffrey Hsu
30ef7aacc2 Protect read-modify-write increment of f_count field with file lock. 2003-06-05 06:05:57 +00:00
Robert Watson
1e9e2eb598 Implement ffs_listextattr() by breaking out that logic and special-cased
attribute name of "" from ffs_getextattr().  Invoking VOP_GETETATTR()
with an empty name is now no longer supported; user application
compatibility is provided by a system call level compatibility
wrapper.  We make sure to explicitly reject attempts to set an EA
with the name "".

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-05 05:57:39 +00:00
Robert Watson
777621799b If a system call comes in requesting to retrieve an attribute named
"", temporarily map it to a call to extattr_list_vp() to provide
compatibility for older applications using the "" API to retrieve
EA lists.

Use VOP_LISTEXTATTR() to support extattr_list_vp() rather than
VOP_GETEXTATTR(..., "", ...).

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Asssociates Laboratories
2003-06-05 05:55:34 +00:00
Robert Watson
a6f1342ff6 Add vop_listextattr(), similar to vop_getextattr() but without a
specific attribute name.  It will have the same semantics as the
older vop_getextattr() "retrieve the names" hack, returning
a buffer with ASCII nul-seperated names.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-05 05:53:35 +00:00
Robert Watson
bd38ab57a1 Don't special-case handling of the empty string in the UFS1
extended attribute retrieval code: it's no longer special-cased,
and is caught by the normal UFS1 EA validity checks (and, in
fact, returns the same error, EINVAL).

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-05 04:58:58 +00:00
Sam Leffler
bba9599afb fix typo (how did this get committed?) 2003-06-04 23:12:32 +00:00
Marcel Moolenaar
c2e4eb969f Change the second (and last) argument of cpu_set_upcall(). Previously
we were passing in a void* representing the PCB of the parent thread.
Now we pass a pointer to the parent thread itself.
The prime reason for this change is to allow cpu_set_upcall() to copy
(parts of) the trapframe instead of having it done in MI code in each
caller of cpu_set_upcall(). Copying the trapframe cannot always be
done with a simply bcopy() or may not always be optimal that way. On
ia64 specifically the trapframe contains information that is specific
to an entry into the kernel and can only be used by the corresponding
exit from the kernel. A trapframe copied verbatim from another frame
is in most cases useless without some additional normalization.

Note that this change removes the assignment to td->td_frame in some
implementations of cpu_set_upcall(). The assignment is redundant.
A previous call to cpu_thread_setup() already did the exact same
assignment. An added benefit of removing the redundant assignment is
that we can now change td_pcb without nasty side-effects.

This change officially marks the ability on ia64 for 1:1 threading.

Not tested on: amd64, powerpc
Compile & boot tested on: alpha, sparc64
Functionally tested on: i386, ia64
2003-06-04 22:46:27 +00:00
Marcel Moolenaar
3f52f44add Fix the dreaded double counting that was present on alpha as well and
got fixed two weeks after the ia64 version was copied from the alpha
version (see rev 1.32 of sys/alpha/alpha/mem.c). As such, we were
missing the same continue as on alpha.

While here, add a default case for the device minor switch and do
some general style(9) cleanups.

WARNING: this file still has bugs. When reading from region 6 or
region 7, we don't validate the physical address. One can trivially
cause a machine check by trying to read from address 0xFFFFFFFFFFFFFFF0
or something that uses the unimplemented physical address bits.

Reported by: Alan Robinson <alan.robinson@fujitsu-siemens.com>
2003-06-04 21:56:10 +00:00
Marcel Moolenaar
11e0f8e16d Change the second (and last) argument of cpu_set_upcall(). Previously
we were passing in a void* representing the PCB of the parent thread.
Now we pass a pointer to the parent thread itself.
The prime reason for this change is to allow cpu_set_upcall() to copy
(parts of) the trapframe instead of having it done in MI code in each
caller of cpu_set_upcall(). Copying the trapframe cannot always be
done with a simply bcopy() or may not always be optimal that way. On
ia64 specifically the trapframe contains information that is specific
to an entry into the kernel and can only be used by the corresponding
exit from the kernel. A trapframe copied verbatim from another frame
is in most cases useless without some additional normalization.

Note that this change removes the assignment to td->td_frame in some
implementations of cpu_set_upcall(). The assignment is redundant.
A previous call to cpu_thread_setup() already did the exact same
assignment. An added benefit of removing the redundant assignment is
that we can now change td_pcb without nasty side-effects.

This change officially marks the ability on ia64 for 1:1 threading.

Not tested on: amd64, powerpc
Compile & boot tested on: alpha, sparc64
Functionally tested on: i386, ia64
2003-06-04 21:13:21 +00:00
John Baldwin
ba90ccc69a Batton down the hatches!!!
Always route PCI interrupts on i386 UP machines.  I was planning to enable
this for i386 anyways once SMP support is done.  Having this enabled fixes
problems on many people's laptops.

Requested by:	imp
2003-06-04 21:10:15 +00:00
Alan Cox
b72b0115ee - Add further vm object locking to vm_object_deallocate(), specifically,
for accessing a vm object's shadows.
2003-06-04 21:07:42 +00:00
Alan Cox
bc73ee3fe7 - Add VM_OBJECT_TRYLOCK(). 2003-06-04 19:59:23 +00:00
Poul-Henning Kamp
d6c5e71627 Introduce g_provider_by_name() function, and use it. 2003-06-04 18:17:52 +00:00
Poul-Henning Kamp
3a3fcd72dd Make this a true GEOM class:
Attach to the component devices using GEOM semantics.
        Create a GEOM provider instead of using disk_create()
        Use the GEOM OAM api for configuration.

I saw approx ~1% speedup in througput and ~7% in latency in a
simple minded test of a two-disk striped device.

This file was repo-copied from src/sys/dev/ccd/ccd.c.

This is not yet linked into the build.
2003-06-04 18:16:09 +00:00
Sam Leffler
236266ee31 detach RNG test facility on device detach 2003-06-04 17:58:20 +00:00
Sam Leffler
345b9e2292 remove bogon (undefined struct decl) 2003-06-04 17:57:52 +00:00
Poul-Henning Kamp
ce64e0f2c9 Add a KASSERT to prevent the same GEOM class from being processed loaded
twice.

Enforce that classes should have different names while we are here.
2003-06-04 17:51:10 +00:00
Hartmut Brandt
41a753193a Make the internal statistics sysctl an array of integers rather than a string.
While a string is readable without a tool, an array is easier to process for
a monitoring application. This also prevents the extra hoops we need with
sbufs and locking.

Move the mtx_init() in en_attach() higher before the first failure point so
that we can unconditionally destroy it in en_destroy().
2003-06-04 15:38:32 +00:00
Jeffrey Hsu
f058535deb Compensate for decreasing the minimum retransmit timeout.
Reviewed by:	jlemon
2003-06-04 10:03:55 +00:00
Alan Cox
3b68228cce - Add vm object locking to vm_object_deallocate(). (Still more
changes are required.)
 - Remove special-case macros for kmem object locking.  They are
   no longer used.
2003-06-04 06:00:55 +00:00
Poul-Henning Kamp
22ee8c4f50 Add instrumentation which tells us how much work softclock() does
per invocation.
2003-06-04 05:25:58 +00:00
Hidetoshi Shimokawa
3be95df6a0 Add id for TI's 1394b link chip. 2003-06-04 04:26:14 +00:00
Robert Watson
5d5029366c Userspace prototypes for the extattr_list_*() system calls. 2003-06-04 04:04:24 +00:00
Robert Watson
8bebbb1a32 Implementations of extattr_list_fd(), extattr_list_file(), and
extattr_list_link() system calls, which return a least of extended
attributes defined for a vnode referenced by a file descriptor
or path name.  Currently, we just invoke VOP_GETEXTATTR() since
it will convert a request for an empty name into a query for a
name list, which was the old (more hackish) API.  At some point
in the near future, we'll push the distinction between get and
list down to the vnode operation layer, but this provides access
to the new API for applications in the short term.

Pointed out by:	Dominic Giampaolo <dbg@apple.com>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-04 03:57:28 +00:00
Robert Watson
31d13e2a29 Regen from syscalls.master:1.149, addition of extended attribute
list system calls for fd, file, link.
2003-06-04 03:50:20 +00:00
Robert Watson
9e18f27730 Add system calls to explicitly list extended attributes on a
file/directory/link, rather than using a less explicit hack on
the extattr retrieval API:

  extattr_list_fd()
  extattr_list_file()
  extattr_list_link()

The existing API was counter-intuitive, and poorly documented.
The prototypes for these system calls are identical to
extattr_get_*(), but without a specific attribute name to
leave NULL.

Pointed out by:	Dominic Giampaolo <dbg@apple.com>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-04 03:49:31 +00:00
Peter Wemm
7fc03ef474 Fix ALIGNED_POINTER(). sizeof((u_int32_t)) is not legal C. 2003-06-04 02:15:13 +00:00
Bernd Walter
330462a315 Change handling to support strong alignment architectures such as alpha and
sparc64.

PR:		alpha/50658
Submitted by:	rizzo
Tested on:	alpha
2003-06-04 01:17:37 +00:00
Robert Watson
0b95513444 Assert the vnode lock when returning successfully from vn_open_cred(). 2003-06-04 00:54:27 +00:00
Julian Elischer
2b035cbe5a Remove un-needed code.
Don't copyin() data we are about to overwrite.
Add a flag to tell userland that KSE is officially "DONE" with the
mailbox and has gone away.

Obtained from:	davidxu@
2003-06-04 00:12:57 +00:00
Hidetoshi Shimokawa
de7f8045e0 Don't call sbp_do_attach() recursively after agent reset
while device probing.
2003-06-03 23:01:43 +00:00
Hidetoshi Shimokawa
df7898b895 Allocate zeroed space for fwdev. 2003-06-03 22:58:22 +00:00
Hidetoshi Shimokawa
1bba1572a0 Open fwmem device exclusively. 2003-06-03 22:52:55 +00:00
Gordon Tetlow
03d26d7e42 Add a geom_vol_ffs module and hook up to the build. 2003-06-03 20:32:13 +00:00
Alan Cox
bdbfbaafcc Add vm object locking to vm_object_coalesce(). 2003-06-03 19:37:01 +00:00
Bosko Milekic
479728fd77 Fix a potential bucket leak where when freeing to an empty bucket
we failed to put the bucket back into the general cache/container.

Also, fix a bad assumption.  There was a KASSERT() that aimed to
guarantee that whenever the pcpu container's mc_starved was > 0,
that whatever the bucket we were freeing to was an empty bucket,
assuming it belonged to the pcpu container cache. However, there
is at least one case where this is not true anymore; consider:
1) All containers empty, next thread to try to alloc will touch
   a pcpu container, notice it's empty, and increment the pcpu
   container's mc_starved.
2) Some other thread frees an mbuf belonging to a bucket in
   the general cache/container.  Then it frees another mbuf
   belonging to the same bucket (still in gen container).
3) Some third thread tries to allocate an mbuf from the pcpu
   container and, since empty, grabs one mbuf now available
   in the general cache and moves the non-empty bucket from
   which it took 1 mbuf and to which the thread in (2) freed
   to, and moves it to the pcpu container.
4) A final thread tries to free an mbuf belonging to the
   NON-EMPTY bucket mentionned in (2) and (3) and, since
   the pcpu container's mc_starved is > 0, but the bucket
   is obviously non-empty, it trips on the KASSERT.
This meant that one could potentially get a panic in some
cases when out of mbufs and clusters.  The problem could
be mitigated by commenting out some cv_signal() calls,
but I'm assuming that was pure coincidence and this is
the correct fix.
2003-06-03 19:19:13 +00:00
John Baldwin
8375d3a4bc Bah, revert the previous commit for the time being due to inadequate testing
on my part.  The output asm looks correct with the previous commit in place
and it works on amd64, but on my laptop I got a spew of AE_BAD_PARAMETER
errors trying to unlock the acpi global lock.
2003-06-03 18:44:31 +00:00
Matt Jacob
7fed69ee80 Update MPILIB from code received from LSI. Make changes in the rest of
the driver based upon some somewhat gratuitous name changes.
2003-06-03 17:47:48 +00:00
John Baldwin
d234ea4e0b Fix the asm constraints so that we use the correct constants when acquiring
and releasing ACPI global locks instead of (ab)using the pointers to those
locks as the constants.  Also, rather than require that the address of
the lock be stored in a register, use a memory constraint allowing the
memory address to be used directly.

Noticed by:	peter
2003-06-03 14:46:16 +00:00
Greg Lehey
4074dedac8 Remove SI_SUB_VINUM. SI_SUB_RAID makes more sense.
Submitted by:	hmp
2003-06-03 08:41:04 +00:00
Jeff Roberson
980c75b4d8 - Remove the blocked pointer from the umtx structure.
- Use a hash of umtx queues to queue blocked threads.  We hash on pid and the
   virtual address of the umtx structure.  This eliminates cases where we
   previously held a lock across a casuptr call.

Reviwed by:	jhb (quickly)
2003-06-03 05:24:46 +00:00
Greg Lehey
14b1df077e Don't deregister the kld on resetconfig, only when we're really ready
to unload.  This would cause a panic on the second resetconfig.

Start Vinum at boot time at SI_SUB_RAID, not SI_SUB_VINUM.
SI_SUB_VINUM was there first, but there's no real distinction, and
SI_SUB_RAID is a more neutral name.

Submitted by:  hmp
2003-06-03 04:51:31 +00:00
Scott Long
795d7dc093 When scanning for changed containers, don't assume that the controller
will respond in a sane manner.

Thanks to Petri Helenius <pete@he.iki.fi> for spotting this and pestering
me to fix it.
2003-06-03 02:10:55 +00:00
Warner Losh
49d5015da8 Add support for generic PMCICA ATA CARD 2003-06-03 01:30:55 +00:00
Warner Losh
a450b32915 Sync to 1.51 2003-06-03 01:29:58 +00:00
Warner Losh
b2cd313c17 Add another PCMCIA IDE CARD 2003-06-03 01:29:01 +00:00
Kelly Yancey
ed7ea0e1ab Account for packets processed at layer-2 (i.e. net.link.ether.ipfw=1).
MFC after:	2 weeks
2003-06-02 23:54:09 +00:00
Sam Leffler
4f28f7d769 Redo locking for better SMP suport:
o adding locking to op submission
o mark interrupt handler MPSAFE
o don't use locking on detach; disabling interrupts should be sufficient
o change mutex string names so witness printouts are more meaningful

Note: locking is still pretty brute-force but it's probably not worth
improving it given the relatively low performance of hifn-based cards.
2003-06-02 23:34:59 +00:00
Sam Leffler
af2b2a7331 Redo locking for proper SMP operation:
o replace driver-global lock with three locks: one for the handling of mcr1
  operations, one for handling of mcr2 operations, and one for the mcr1
  free list
o mark the interrupt handler MPSAFE
o don't use locking on detach; disabling interrupts is sufficient (I think)
2003-06-02 23:32:03 +00:00
Sam Leffler
3569ae7f66 Flush my local cache of cryto subsystem fixes:
o add a ``done'' flag for crypto operations; this is set when the operation
  completes and is intended for callers to check operations that may complete
  ``prematurely'' because of direct callbacks
o close a race for operations where the crypto driver returns ERESTART: we
  need to hold the q lock to insure the blocked state for the driver and any
  driver-private state is consistent; otherwise drivers may take an interrupt
  and notify the crypto subsystem that it can unblock the driver but operations
  will be left queued and never be processed
o close a race in /dev/crypto where operations can complete before the caller
  can sleep waiting for the callback: use a per-session mutex and the new done
  flag to handle this
o correct crypto_dispatch's handling of operations where the driver returns
  ERESTART: the return value must be zero and not ERESTART, otherwise the
  caller may free the crypto request despite it being queued for later handling
  (this typically results in a later panic)
o change crypto mutex ``names'' so witness printouts and the like are more
  meaningful
2003-06-02 23:28:06 +00:00
Peter Wemm
babc58fd74 Fix restarted syscalls. When we rewind %rip, we also need to restore
all the argument registers etc since we have almost certainly have trashed
them by now.  Take particular car of %r10 since it held the original value
of %rcx (which we saved in tf_rcx on entry and doreti doesn't know this).
2003-06-02 21:56:08 +00:00
Peter Wemm
c35518b4ed Make this more compatable with libc_r. Make the internal types for storing
registers an array of longs rather than int.
2003-06-02 21:49:35 +00:00
Poul-Henning Kamp
0f557e0ac0 Further devilification of CCD:
Change the list interface to simplify things.
Remove old list ioctls which bogusly exported the softc to userland.
Move the softc and associated structures from the public header to
the source file.
2003-06-02 21:29:04 +00:00
Poul-Henning Kamp
189337d81f Begin deevilification of CCD:
Make CCD a GEOM class.

For now only use this for implementing a OAM config method which
can return a list of configured CCD devices in the format which
"ccdconfig -g[v]" would normally output.
2003-06-02 20:50:03 +00:00
Tor Egge
c7251aede7 Initialize td->td_pcb->pcb_ext in cpu_thread_setup() since a garbage
value (e.g. 0xd0d0d0d0) can cause a kernel panic.
2003-06-02 20:43:28 +00:00
Poul-Henning Kamp
786a6905ec Return an indicative error message. 2003-06-02 20:35:37 +00:00
Robert Watson
985a0d9735 Also implement mpo_copy_mbuf_label() for mac_lomac, or labels may
not be properly propagated across some mbuf copy operations.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-02 18:49:11 +00:00
David E. O'Brien
c1050bf144 Document new (starting with 5.x) __FreeBSD_version scheme. 2003-06-02 18:03:20 +00:00
Scott Long
9f0f54ad83 Oops, __FreeBSD_version should be 501100, not 510100. The former implies
that we are at FreeBSD 5.10

Reminded by:	everybody
Guaranteed not to break world by:	imp
2003-06-02 17:53:08 +00:00
Jens Schweikhardt
7b594d2a81 s/u_short/unsigned short/ to make this compile if _POSIX_C_SOURCE=200112
Fix a few but probably not all style bugs.

Suggested by:	bde
MFC after:	2 weeks
2003-06-02 17:23:37 +00:00
Robert Watson
f32bb0529b Use mac_biba_label_copy() and mac_mls_label_copy() to implement the
mpo_copy_mbuf_label() entry point for Biba and MLS, respectively.
Otherwise, labels in m_tags may not be properly propagated across
some classes of mbuf operations.  This problem caused these policies
to fail-stop the system with a panic.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-02 17:21:38 +00:00
David E. O'Brien
71c5a90130 Use __FBSDID(). 2003-06-02 17:01:49 +00:00
David E. O'Brien
27e0099c4a Use __FBSDID(). 2003-06-02 16:56:40 +00:00
David E. O'Brien
006124d811 Use __FBSDID(). 2003-06-02 16:32:55 +00:00
Tor Egge
ad05d58087 Add tracking of process leaders sharing a file descriptor table and
allow a file descriptor table to be shared between multiple process
leaders.

PR:		50923
2003-06-02 16:05:32 +00:00
Hartmut Brandt
d68d53d4d6 Fix a typo in an ATM media name. As this name was not use yet, no problems
should occur.
2003-06-02 09:13:08 +00:00
Maxim Konovalov
b0af6a7be5 Remove unused #ifdef BRIDGE.
Reviewed by:	nyan
2003-06-02 08:36:18 +00:00
David E. O'Brien
db31907c73 Use __FBSDID(). 2003-06-02 06:48:51 +00:00
David E. O'Brien
9676a785e7 Use __FBSDID(). 2003-06-02 06:43:15 +00:00
David E. O'Brien
cef2a2e364 Use __FBSDID(). 2003-06-02 06:16:45 +00:00
David E. O'Brien
0f0f21c394 Use __FBSDID(). 2003-06-02 06:02:49 +00:00
Peter Wemm
193b147c05 MFi386: i386/include/asm.h rev 1.11: Do not abuse ##. 2003-06-02 05:59:35 +00:00
Mike Silbersack
1104779b70 Replace if_fxp's handrolled defrag function with m_defrag.
No actual bug with the existing code, just tidying things up.

Submitted by:	hmp
2003-06-02 05:16:42 +00:00
Scott Long
46ea475783 Bump __FreeBSD_version to 510100 for 5.1-CURRENT 2003-06-02 05:05:27 +00:00
Scott Long
5f23c2b5c4 We are at 5.1-CURRENT now 2003-06-02 04:58:43 +00:00
David E. O'Brien
dfb835396a Fix a style nit.
Submitted by:	ru
2003-06-02 03:26:03 +00:00
David E. O'Brien
8d19a0584b Don't use ## to concatinate to two things that don't together make a C token.
Two tokens that don't together form a vaid preprocssor token cannot be
pasted together using ANSI-C token concatinatation.  GCC 3.2's cpp, at least,
produces the desired result w/o using "##".
2003-06-02 02:41:38 +00:00
David E. O'Brien
9f2636a8cf Don't use a C compiler to assemble a pure asm file. 2003-06-02 02:37:27 +00:00
Matt Jacob
e404e36b27 Check in some months long pending minor debug output changes.
Clarify that the implicit fallthrough was *not* intentional (thanks, Poul!)
and reorganize the code so a correct fallthrough (with /* FALLTHROUGH */)
occurs.
2003-06-02 00:37:42 +00:00
David E. O'Brien
69bb404192 Use C99 compatable asm statements. 2003-06-02 00:29:35 +00:00
Alan Cox
cccf11b865 Change kernel_object and kmem_object to (&kernel_object_store) and
(&kmem_object_store), respectively.  This allows the address of these
objects to be resolved at link-time rather than run-time.
2003-06-01 23:59:48 +00:00
Marcel Moolenaar
0fa2b83829 Improve set_mcontext:
o  Don't copy psr verbatim from the user supplied context. Only allow
   userland to change the processor settings that are part of the user
   mask.
2003-06-01 23:22:56 +00:00
Marcel Moolenaar
86f4f6f7b8 Improve on cpu_set_upcall:
o  Use pcb and tf for the new pcb and the new trapframe and use pcb0
   for the old (current) pcb. The mix of pcb, pcb2 and tf was slightly
   confusing.
o  Don't define td->td_frame here. It has already been set previously
   by cpu_thread_setup. Add a KASSERT to make sure pcb and tf are both
   non-NULL.
o  Make sure the number of dirty registers is 0 for the new thread.
   There are no user registers on the backing store because we heven't
   enter userland yet.
2003-06-01 23:19:21 +00:00
Ruslan Ermilov
234dfc904a A new API function PacketAliasRedirectDynamic() can be used
to mark a fully specified static link as dynamic; i.e. make
it a one-time link.
2003-06-01 23:15:00 +00:00
Ruslan Ermilov
f1a529f3da Make the PacketAliasSetAddress() function call optional. If it
is not called, and no static rules match an outgoing packet, the
latter retains its source IP address.  This is in support of the
"static NAT only" mode.
2003-06-01 22:49:59 +00:00
Maxime Henrion
1edc4c46b8 Change a :
bzero(ptr, sizeof(DC_RXLEN * 5));
which should obviously be:
	bzero(ptr, DC_RXLEN * 5);

Looks like this bug may have reduced the effectiveness of the
workaround for the hardware bug in the PNIC chips.

MFC after:	1 week
2003-06-01 22:09:12 +00:00
David E. O'Brien
5345d76f4a Be sloppier about the miidevs.h dependency. This reduces the maintenance
effort at the expense of making miidevs.h a dependency for very .o.

Requested by:	imp
2003-06-01 20:47:46 +00:00
David E. O'Brien
3c5dad6ef0 Accpet '1'..'5' in place of F1..F5 for serial console users.
Reviewed by:	Bruce M Simpson <bms@spc.org>
2003-06-01 20:41:04 +00:00
David E. O'Brien
4b620ec03d Shorten long comment. 2003-06-01 20:28:20 +00:00
David E. O'Brien
713c939103 Sync with i386/GENERIC ordering. 2003-06-01 20:26:38 +00:00
Maxime Henrion
0934f18afb - Style(9) fixes, most notably :
o Remove register keyword
	o ANSIfy prototypes
	o Remove "return;" at the end of void functions
	o Remove trailing spaces
	o Don't align local variables with tabs and reorder them
	o Don't use /* FOO */ at the end of a #ifdef FOO block if
	  it's a small block
- Other non-functional changes :
	o 6 -> ETHER_ADDR_LEN
	o Don't initialize if_output; ether_ifattach() does it for us
2003-06-01 19:26:34 +00:00
Matt Jacob
d8f9e010d2 Restore parentheses removed inappropriately in last commit. 2003-06-01 19:01:01 +00:00
Poul-Henning Kamp
83d771de78 Simplify the GEOM OAM api: Drop the request type, and let everything
hinge on the "verb" parameter which the class gets to interpret as
it sees fit.

Move the entire request into the kernel and move changed parameters
back when done.
2003-06-01 13:47:51 +00:00
Poul-Henning Kamp
a6c58fec6c constify g_sanity() 2003-06-01 13:30:39 +00:00
Dag-Erling Smørgrav
f834a1168c Add (but do not connect) a half-finished driver for Aureal Vortex cards.
The mixer works, pcm support is half done.
2003-06-01 11:58:46 +00:00
Poul-Henning Kamp
b3c481ae1a Remove break after return.
Add XXX comment where intent is unclear.

Found by:	FlexeLint
2003-06-01 09:27:33 +00:00
Poul-Henning Kamp
961de0b761 Remove #include <sys/disklabel.h> 2003-06-01 09:25:17 +00:00
Poul-Henning Kamp
b44f808797 Don't leak "barlist" allocation on failure.
Found by:	FlexeLint
2003-06-01 09:24:17 +00:00
Poul-Henning Kamp
4df05d61bd Remove unused variables.
Found by:       FlexeLint
2003-06-01 09:20:38 +00:00
Poul-Henning Kamp
58223589d5 Use bcmp() to compare hash strings. 2003-06-01 09:18:49 +00:00
Don Lewis
64820e19bc Don't unlock the parent directory vnode twice if the ISDOTDOT flag
is set.
2003-06-01 09:16:26 +00:00
Poul-Henning Kamp
878d4f3dda Remove unused variables.
Remove break after return.
Add XXX comment where intent is unclear.

Found by:       FlexeLint
2003-06-01 09:12:24 +00:00
Poul-Henning Kamp
04361c8c3a Make "where" an alias for "trace" 2003-06-01 09:06:23 +00:00
Poul-Henning Kamp
058675037b Add /* FALLTHROUGH */
Found by:	FlexeLint
2003-06-01 09:01:02 +00:00
Marcel Moolenaar
798c9e50b0 Implement cpu_thread_setup(). This is mostly the same as on i386,
except for the fact that trapframes have a size recorded in it
that we set here too. We need this for proper thread setup.

Pointed out by: mtm
2003-06-01 08:29:43 +00:00
Don Lewis
3a140162b4 Fix up locking problems in fifo_open() and fifo_close():
Sleep on the vnode interlock while waiting for another
	caller to increment fi_readers or fi_writers.  Hold the
	vnode interlock while incrementing fi_readers or fi_writers
	to prevent a wakeup from being missed.

	Only access fi_readers and fi_writers while holding the vnode
	lock.  Previously fifo_close() decremented their values without
	holding a lock.

	Move resource deallocation from fifo_close() to fifo_inactive(),
	which allows the VOP_CLOSE() call in the error return path in
	fifo_open() to be removed.  Fifo_open() was calling VOP_CLOSE()
	with the vnode lock held, in violation the current vnode locking
	API.  Also the way fifo_close() used vrefcnt() to decide whether
	to deallocate resources was bogus according to comments in the
	vrefcnt() implementation.

Reviewed by:	bde
2003-06-01 06:24:32 +00:00
Marcel Moolenaar
bf822712f7 Remove the ia64 hackery in threadinit() that was needed to work around
the lameness of the kstack code. The EPC overhaul de-lame-ified the
kstack code by removing the need for contigmalloc(). We can now
allocate stacks using malloc(). We probably want to make the stacks
swappable as well so that we can make it MI. But that's another story.
2003-06-01 05:57:58 +00:00
Yoshihiro Takahashi
079a4307f0 MFi386: revision 1.199 2003-06-01 04:51:07 +00:00
Yoshihiro Takahashi
de31756031 Merged from sys/isa/ppc.c revision 1.40. 2003-06-01 04:48:34 +00:00
Yoshihiro Takahashi
adeebc533e Merged from sys/isa/fd.c revision 1.250. 2003-06-01 04:46:30 +00:00
Yoshihiro Takahashi
b19a8c613b Merged from sys/dev/sio/sio.c revision 1.399. 2003-06-01 04:44:43 +00:00
Juli Mallett
b0327095f6 Use SC_NO_CUTPASTE to protect cutpaste variables correctly, fixing the
-Werror build with such option, but not other combinations.  LINT
misses this because syscons knobs in LINT turn off a lot of code.

Reviewed by:	marcel (some time ago)
2003-06-01 04:42:14 +00:00
Robert Watson
e1249def7d Return EOPNOTSUPP for attempted EA operations on VCHR vnodes in UFS2;
if we permit them to occur, the kernel panics due to our performing
EA operations using VOP_STRATEGY on the vnode.  This went unnoticed
previously because there are very for users of device nodes on UFS2
due to the introduction of devfs.  However, this can come up with
the Linux compat directories and its hard-coded dev nodes (which will
need to go away as we move away from hard-coded device numbers).
This can come up if you use EA-intensive features such as ACLs and
MAC.

The proper fix is pretty complicated, but this band-aid would be
an excellent MFC candidate for the release.
2003-06-01 02:42:18 +00:00
Robert Watson
ef2e1ca561 Attempt to further comment and clarify System V IPC logic: document
why certain exceptions are made, note an inconsistency between
FreeBSD and some other implementations regarding IPC_M, and let
suser() generate our EPERM rather than forcing it ourselves.
Remove a carriage return that crept in in the last commit.

Reviewed by:	gordon
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-31 23:31:51 +00:00
Robert Watson
a0ccd3f6ad Attempt to marginally de-obfuscate sections of the System V IPC access
control logic.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-31 23:17:30 +00:00
Peter Wemm
395aac85f8 MFi386: rev 1.56: remove break after return 2003-05-31 22:02:11 +00:00
Peter Wemm
0c5b3efcb0 MFi386: rev 1.23: use gdb_strlen()/gdb_strcpy() directly. 2003-05-31 22:00:57 +00:00
Peter Wemm
fbbfc4c335 MFi386: rev 1.50: remove unused variable 2003-05-31 21:58:55 +00:00
Marcel Moolenaar
5e7019bf32 Now that we have the signal trampolines in the gateway page and the
gateway page is considered kernel space, we can panic when we should
only SIGSEGV. Hence, add the additional constraint that for page
faults we also require running with kernel privileges. The gateway
page is the only kernel code running with user privileges, iso this
is a correct way to exclude the gateway page from kernel land.

We do not currently exclude the gateway page for other faults as it
is not always the right way to do it. Further tuning will happen on
a case by case bases.
2003-05-31 21:21:35 +00:00
Poul-Henning Kamp
89e50d0e9a If DESTDIR was specified as a makeoption in the kernelconfig file
we want to pass it on to the modules build so we don't install
the kernel under DESTDIR and the modules in /boot.
2003-05-31 21:16:12 +00:00
Marcel Moolenaar
480a728dee Implement cpu_set_upcall(). Required by libthr and used by
thr_create(2). This implementation is so far only compile tested.
But since this is also the last of the functions required to
support libthr, we're now functionally complete (for some weird
definition of functionally; and complete). Runtime testing can
commence.
2003-05-31 21:14:25 +00:00
Poul-Henning Kamp
a3e7d3f16f wrap macro in do {...} while(0) 2003-05-31 21:11:51 +00:00
Poul-Henning Kamp
b82af320cf Add "" around mutex name to make message less confusing. 2003-05-31 21:11:01 +00:00
Poul-Henning Kamp
21e1378b62 Add an XXX comment with a TODO item for next time we run a revision
on this API.
2003-05-31 21:10:01 +00:00
Marcel Moolenaar
c01da18e22 Implement set_mcontext() and get_mcontext(). Just as for sendsig() and
sigreturn(), we cheat and assume the preserved registers are still
on-chip and unmodified. This is actually the case, but more by accident
than by design. We need to use unwinding eventually or explicitly
compile the kernel in a way that the compiler steers clear from using
the preserved registers completely.
2003-05-31 21:07:08 +00:00
Marcel Moolenaar
8ef6f226da Make the regset pointers const pointers for the context restore functions.
This works better with set_mcontext() and is more precise in general.
2003-05-31 21:02:18 +00:00
Marcel Moolenaar
3893a77138 Some ia32 related finetuning for the EPC syscall path:
o  The SDM states that flushing the RSE in the cycle prior to the
   call to ia32 code yields the best performance. We don't really
   care to much about performance here, but we do the same anyway.
   I'm being paranoia and conservative here.
o  Only initialize the ia32 state registers, not the registers used
   as scratch by the ia32 engine. This saves a couple of loads from
   the trapframe, but also helps debugging: we don't clobber useful
   debugging data (engineering hints :-)
o  Make sure all general registers constituting ia32 state have been
   initialized. If there's no useful to be loaded from the trapframe,
   clear the register. This avoids accidentally leaking NaT bits.
o  Make sure we set ar.k6 prior to clobbering ar.bspstore and also
   set ar.k7 prior to setting sp. This fixes a race seen for ia64
   native code as well (and previously fixed too).
2003-05-31 20:57:26 +00:00
Poul-Henning Kamp
07c6eac9d7 Add /* FALLTHROUGH */
Move /* FALLTHROUGH */ to correct location.
Remove unused variable(s).

Found by:       FlexeLint
2003-05-31 20:46:21 +00:00
Poul-Henning Kamp
82dcf708f8 Add /* FALLTHROUGH */
Remove unused variable(s).
Order switch in canonical order.

Found by:       FlexeLint
2003-05-31 20:44:32 +00:00
Poul-Henning Kamp
bd961794c3 Add /* FALLTHROUGH */
Found by:       FlexeLint
2003-05-31 20:43:47 +00:00
Poul-Henning Kamp
35e1694a4d Remove unused variable(s).
Add XXX comment where intent is unclear.

Found by:       FlexeLint
2003-05-31 20:43:17 +00:00
Marcel Moolenaar
62931aa266 Make sure we have all the dirty registers in user frames on the
backing store before we discard them. It is possible that we
enter the kernel (due to an execve in this case) with a lot of
dirty user registers and that the RSE has only partially spilled
them (to make room for new frames). We cannot move the backing
store pointer down (to discard user registers) when not all of
the user registers are on the backing store.
So, we flush the register stack IFF this happens. Unconditionally
doing the flush is too costly, because the condition in which we
need to flush is very rare.

This change appears to fix the SIGSEGV that sometimes happen for
newly executed processes and so far also appears to fix the last
of the corruption. It is possible, although not likely, that this
change prevents some other bug from happening, even though it is
itself not a fix. Hence the uncertainty. We'll know in a couple
of months I guess :-)
2003-05-31 20:42:35 +00:00
Poul-Henning Kamp
bb0b8a23c0 Remove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:42:24 +00:00
Poul-Henning Kamp
00999c80d8 Eliminate mostly unused local variable.
Found by:       FlexeLint
2003-05-31 20:41:52 +00:00
Poul-Henning Kamp
d2f30d92a7 Add /* FALLTHROUGH */
Remove break after return

Found by:       FlexeLint
2003-05-31 20:41:08 +00:00
Poul-Henning Kamp
25371920a0 Fix indentation
Found by:       FlexeLint
2003-05-31 20:40:12 +00:00
Poul-Henning Kamp
6f75979695 Remove unused variable(s).
Add /* FALLTHROUGH */

Found by:       FlexeLint
2003-05-31 20:39:28 +00:00
Poul-Henning Kamp
4738f8c1a8 Remove return after goto.
Remove break after return;

Found by:       FlexeLint
2003-05-31 20:35:32 +00:00
Poul-Henning Kamp
60db3b9e60 Remove unused variable(s).
Remove break after return;

Found by:       FlexeLint
2003-05-31 20:34:36 +00:00
Poul-Henning Kamp
66f7a83274 Put definition of struct svr4_sockcache_entry in a .h file rather than
having two independent definitions in two .c files.
Fiddle surrounding details to match.

Found by:       FlexeLint
2003-05-31 20:33:18 +00:00
Poul-Henning Kamp
670966596b Remove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:29:34 +00:00
Poul-Henning Kamp
d1043f6d6a Remove break after return
Found by:       FlexeLint
2003-05-31 20:28:21 +00:00
Poul-Henning Kamp
85dc30cf82 Remove unused variable(s).
Put XXX comment where intent is unclear.

Found by:       FlexeLint
2003-05-31 20:27:42 +00:00
Poul-Henning Kamp
618b80ddcf Avoid unbalancing the { } count in the source file with #ifdef by
putting the opening { after the #ifdef ... #endif sequence.

Found by:       FlexeLint
2003-05-31 20:25:53 +00:00