Commit graph

56997 commits

Author SHA1 Message Date
Brian Feldman 4524204190 Fix the problems I (and others, undoubtedly) have been having for a
while with threaded software in -CURRENT acting very "weird".  It has
seemed, for example, in Mozilla that threads attempting to do host
lookups have been locking up.  That's exactly the case.

There was a race condition in the implementation of the initialization
of the mutex used to protect FILE operations, first of all: multiple
instances of FLOCKFILE() in libc could occur on the same FILE at
the same time and cause strange behavior by overwriting eachothers'
creation of the mutex and the rest of the file lock.

Secondly, it's not appropriate to test the "validity" of the file
descriptor referenced by the FILE; if the code is calling FLOCKFILE()
or FUNLOCKFILE(), it wants the FILE to be locked or unlocked, not
to be locked or unlocked on the condition that _file is >= 0.  This
also could quite easily cause leaks by failing to perform the lock or
unlock operation when it actually is needed.

Mozilla now works again on -CURRENT when linked to libc_r.so.5 and
libc.so.5.
2001-02-23 04:59:12 +00:00
Peter Wemm 4fd2864862 Flip the default for CVS_RSH to "ssh". I am tired of getting asked this
all the time, and IMHO it is long overdue.
2001-02-23 04:52:30 +00:00
Warner Losh f3cc9575fd If the symbolic links @ or machine exist, do not depend on them.
This fixes the problem where if src/sys or src/sys/$MACHINE_ARCH/include
changed at all, all the modules would be rebuilt.

Reviewed by: bde
2001-02-23 04:49:31 +00:00
Alfred Perlstein 8283130be4 Display the Joliet Extension 'level' in the log message.
PR: kern/24998
2001-02-23 03:43:05 +00:00
Peter Wemm e0f332edab Remove the camcontrol rescan $device insert events for the aic driver,
which does it itself now.  Although CAM should do the rescan itself
if the initial boot-time rescan has already been done.
2001-02-23 02:45:15 +00:00
Peter Wemm c14e19116f Sigh, nobody ever got back to me about this. So, here it is..
Implement auto scsi scan at insert time for the aic driver.
2001-02-23 02:32:31 +00:00
Peter Wemm f1532aadee Activate USER_LDT by default. The new thread libraries are going to
depend on this.  The linux ABI emulator tries to use it for some linux
binaries too.  VM86 had a bigger cost than this and it was made default
a while ago.

Reviewed by:	jhb, imp
2001-02-23 01:25:02 +00:00
Brian Feldman 7aea583ef1 Typo: "interrupt" -> "harvest_interrupt" 2001-02-23 01:12:44 +00:00
John Baldwin 4c8ccdab0f Remove undefined and unreferenced doreti_syscall_ret globl. While I'm
here, adjust comment block above doreti.  We don't have the old MP lock
anymore.
2001-02-23 00:41:05 +00:00
Peter Wemm ed53c6c5c0 Move the 'dont forget "make depend"' to be the last thing that people see,
after the warnings.
2001-02-23 00:22:04 +00:00
Brian Somers 98d7002b19 Change the 120 second timeout to 180 seconds to reflect the real default 2001-02-22 23:28:12 +00:00
John Baldwin 7de7569f50 MACHINE_ARCH is the target arch to crossbuild to, not TARGET_ARCH.
Requested by:	marcel
2001-02-22 22:58:24 +00:00
Paul Saab 6afb6d0aa9 Elminate common declaration.
Reviewed by:	peter
2001-02-22 21:53:39 +00:00
Jesper Skriver d1c54148b7 Redo the security update done in rev 1.54 of src/sys/netinet/tcp_subr.c
and 1.84 of src/sys/netinet/udp_usrreq.c

The changes broken down:

- remove 0 as a wildcard for addresses and port numbers in
  src/sys/netinet/in_pcb.c:in_pcbnotify()
- add src/sys/netinet/in_pcb.c:in_pcbnotifyall() used to notify
  all sessions with the specific remote address.
- change
  - src/sys/netinet/udp_usrreq.c:udp_ctlinput()
  - src/sys/netinet/tcp_subr.c:tcp_ctlinput()
  to use in_pcbnotifyall() to notify multiple sessions, instead of
  using in_pcbnotify() with 0 as src address and as port numbers.
- remove check for src port == 0 in
  - src/sys/netinet/tcp_subr.c:tcp_ctlinput()
  - src/sys/netinet/udp_usrreq.c:udp_ctlinput()
  as they are no longer needed.
- move handling of redirects and host dead from in_pcbnotify() to
  udp_ctlinput() and tcp_ctlinput(), so they will call
  in_pcbnotifyall() to notify all sessions with the specific
  remote address.

Approved by:	jlemon
Inspired by:    NetBSD
2001-02-22 21:23:45 +00:00
Tor Egge 9d0ddf1861 Streamline updating of switchtime (don't copy code from kern_sync.c).
Submitted by:	jhb
2001-02-22 20:16:51 +00:00
Tor Egge 35030da9f8 Backout previous commit. sched_lock is held, thus interrupts are prevented
here.

Submitted by:	jhb
2001-02-22 20:12:52 +00:00
Tor Egge 0d139b3741 Protect update of the per processor switchtime variable against
interrupts.

Protect usage of the per processor switchtime variable against
interrupts in calcru().

This seem to eliminate the "microuptime() went backwards" warnings.
2001-02-22 19:50:37 +00:00
Gregory Neil Shapiro e6c77250ef Need one additional make.conf knob, SENDMAIL_ADDITIONAL_MC to satisfy bug
report.  It allows building multiple .cf files at build time.

PR:		bin/19897
2001-02-22 19:44:16 +00:00
John Baldwin feb43c5f37 The p_md.md_regs member of proc is used in signal handling to reference
the the original trapframe of the syscall, trap, or interrupt that entered
the kernel.  Before SMPng, ast's were handled via a psuedo trap at the
end of doerti.  With the SMPng commit, ast's were broken out into a
separate ast() function that was called from doreti to match the behavior
of other architectures.  Unfortunately, when this was done, the
p_md.md_regs member of curproc was not updateda in ast(), thus when
signals are handled by userret() after an interrupt that returns to
userland, we end up using a stale trapframe that will result in the
registers from the old trapframe overwriting the real trapframe and
smashing all the registers right before we return to usermode.  The saved
%cs:%eip from where we were in usermode are saved in the trapframe for
example.
2001-02-22 19:35:20 +00:00
Gregory Neil Shapiro d1885c41cc Add a note indicating that SENDMAIL_MC should include the path. This is
necessary if you expect to be able to use this setting in both /etc/mail
and etc/sendmail.
2001-02-22 19:34:13 +00:00
Bill Paul d467c136d0 Apply patch to allow TX underrun handling without issuing a complete
chip reset. Just temporarily turn off the transmitter instead.

Submitted by:	Stephen McKay <mckay@freebsd.org>
2001-02-22 19:26:55 +00:00
Hajimu UMEMOTO 650d202dbd some reasoning why we separated ping(8) and ping6(8)
comments/additions/corrections are welcome.

Obtained from:	KAME
2001-02-22 19:00:51 +00:00
John Baldwin 51c9129957 Since the PC is a pointer to a code address, change the second parameter of
addupc_task() and addupc_intr() to be a uintptr_t instead of a u_long.
2001-02-22 18:07:31 +00:00
John Baldwin f308e0d714 - Change ast() to take a pointer to a trapframe like other architectures.
- Don't use an atomic operation to update cnt.v_soft in ast().  This is
  the only place the variable is written to, and sched_lock is always
  held when it is written, so it is already protected and the mutex release
  of sched_lock asserts a memory barrier that ensures the value will be
  updated in a timely fashion.
2001-02-22 18:05:15 +00:00
Gregory Neil Shapiro 12d67cf44c Return to the code as distributed by sendmail.org. This eliminates a
warning on Alphas.  It is still not the perfect solution for machines
which sizeof(u_long) != sizeof(void *) but it is as close as we are going
to get for now and consistent with the rest of the code.  8.12 has solved
this problem by providing a portable snprintf() which understands %p.

PR:		bin/14142
2001-02-22 17:47:24 +00:00
Julian Elischer cdee49f986 Add a 'splitter' node to separate a bidirectional
packet flow into two unidirectional flows.

Part of a suite of nodes developed for packet flow control.
More to follow as I have time to port them to 5.x or
as others do so. The ipfw node will be the hardest..

Submitted by:	"Vitaly V. Belekhov" <vitaly@riss-telecom.ru>
2001-02-22 17:14:36 +00:00
John Baldwin 640c22333f The ia64 hasn't needed machine/ipl.h included in sys/systm.h for a while
now.
2001-02-22 17:14:24 +00:00
John Baldwin 2f01e2eaf2 Axe pcb_schednest as it is no longer used. 2001-02-22 17:09:50 +00:00
John Baldwin 938f15c7c4 Rename switch_trampoline() to fork_trampoline() on the alpha and ia64.
Suggested by:	dfr
2001-02-22 16:56:53 +00:00
John Baldwin 6a7b2863ba Don't set the sched_lock lesting level for new processes as it is no
longer used.
2001-02-22 16:53:23 +00:00
John Baldwin 6efc0dc140 Catch comments up to child_return() -> fork_return() as well. 2001-02-22 16:49:36 +00:00
John Baldwin 2217ebb4df Synch up with the other architectures:
- Remove unneeded spl()'s around mi_switch() in userret().
- Don't hold sched_lock across addupc_task().
- Remove the MD function child_return() now that the MI function
  fork_return() is used instead.
- Use TRAPF_USERMODE() instead of dinking with the trapframe directly to
  check for ast's in kernel mode.
- Check astpending(curproc) and resched_wanted() in ast() and return if
  neither is true.
- Use astoff() rather than setting the non-existent per-cpu variable
  astpending to 0 to clear an ast.
2001-02-22 16:27:03 +00:00
John Baldwin 26f9f5c7c7 - Use TRAPF_PC() on the alpha to acess the PC in the trap frame.
- Don't hold sched_lock around addupc_task() as this apparently breaks
  profiling badly due to sched_lock being held across copyin().

Reported by:	bde (2)
2001-02-22 16:23:12 +00:00
John Baldwin 7def4c9ab5 Use the MI fork_return() fork trampoline callout function for child
processes instead of the MD child_return().
2001-02-22 16:05:48 +00:00
John Baldwin 29182967ef - Don't dink with sched_lock in cpu_switch() since mi_switch() does this
for us.
- Change the switch_trampoline() to call fork_exit() passing in the
  required arguments instead of calling the fork trampoline callout
  function directly.
Warning: this hasn't been tested.

Looked over by:	dfr
2001-02-22 16:05:09 +00:00
John Baldwin 0246af0995 GC unused and now obsolete assertion macros. 2001-02-22 15:45:49 +00:00
John Baldwin 5f78859e9a - Axe the now unused ASS_* assertions for interrupt status.
- Use ia64_get_psr() instead of save_intr() in mtx_legal2block().
2001-02-22 15:43:42 +00:00
John Baldwin 409b7113a1 Add a inline function to read the psr. 2001-02-22 15:39:58 +00:00
John Baldwin 7a473ad644 Add a mtx_intr_enable() macro. 2001-02-22 15:37:57 +00:00
John Baldwin 66b5727c4e Axe the astpending per-cpu variable. 2001-02-22 15:37:34 +00:00
John Baldwin 3e68dabf19 Add TRAPF_PC() and TRAPF_USERMODE() macros and redefine CLKF_PC() and
CLKF_USERMODE() in terms of them.
2001-02-22 15:35:04 +00:00
Ruslan Ermilov 9b6ee1dce8 Only descend into ${MACHINE_ARCH} subdir. 2001-02-22 15:28:57 +00:00
John Baldwin 3621af321e Cleanup and clarify the comments above switch_trampoline(). 2001-02-22 15:06:19 +00:00
Ruslan Ermilov bb1f93d519 Prepare for mdoc(7)NG. 2001-02-22 15:03:09 +00:00
Dag-Erling Smørgrav 2f9564de0f Fix formatting bugs introduced in sysctl_vm_zone() by the previous commit.
Also, if SYSCTL_OUT() returns a non-zero value, stop at once.
2001-02-22 14:44:39 +00:00
Alfred Perlstein 3cf714fef8 fix usage statement (add missing [-n devs] option)
Submitted by: Maxim Konovalov <maxim@macomnet.ru>

Silence a warning by renaming the 'pgtok' #define to 'vmstat_pgtok' so
as not to conflict with the 'pgtok' #define in sys/param.h
2001-02-22 13:55:12 +00:00
John Baldwin c978f49e20 Add a mtx_assert() in maybe_resched() just to be sure it's always called
with sched_lock held.
2001-02-22 13:47:01 +00:00
John Baldwin 3a18729505 Lock need_resched with sched_lock.
Reported by:	des
2001-02-22 13:46:09 +00:00
John Baldwin de0e830e6d Catch up to new MI astpending and need_resched handling. 2001-02-22 13:29:22 +00:00
Ruslan Ermilov 9863ddda64 mdoc(7) police: fixed misc formatting bugs. 2001-02-22 12:07:28 +00:00