Compare commits

...
177 Commits
Author SHA1 Message Date
Scott Long bbe327aea6 Revert 1.228.2.2.2.1, it causes more problems than it fixes.
Approved by: re
2005-05-07 17:51:09 +00:00
Colin Percival 5ba518022a MFC: Fix two issues which were missed in FreeBSD-SA-05:08.kmem.
Reported by:	Uwe Doering
Approved by:	re (kensmith)
2005-05-07 03:58:25 +00:00
Hiroki Sato ba70bc6e15 Merge from the English version:
relnotes/common/new.sgml 1.761.2.41.2.8 -> 1.761.2.41.2.9

Submitted by:	den
Approved by:	re (implicitly)
2005-05-06 18:57:44 +00:00
Ken Smith 22deffbacf I think that's a wrap for 5.4...
Approved by:	re (implicit)
2005-05-06 04:12:22 +00:00
Ken Smith 02b33ff2e3 MFC v1.14.6.1 and v1.14.6.2:
> Log:
>   enclose getservbyport(3) call with mutex lock.
>   since our getservbyport(3) is thread-safe on CURRENT, we don't need
>   this workaround on CURRENT.  however, it is not MFC'ed to RELENG_5,
>   yet.  so, we need this for RELENG_5.
>   this fix is candidate for MFS to be in time for 5.4-RELEASE.
>
>   Found by:       tools/regression/lib/libc/resolv/resolv -r
>   Reviewed by:    hrs
>   Tested by:      hrs

Work done by:	ume (he requested merge but I approved it too late)
Approved by:	re (scottl approved me doing merge so tagging can be done)
2005-05-06 04:10:44 +00:00
Ken Smith 3b0a25cccd Prep for 5.4-RELEASE tagging.
Approved by:	re (implicit)
2005-05-06 03:43:10 +00:00
Colin Percival be80f612ee If we are going to
1. Copy a NULL-terminated string into a fixed-length buffer, and
2. copyout that buffer to userland,
we really ought to
0. Zero the entire buffer
first.

Security: FreeBSD-SA-05:08.kmem
Approved by: re (kensmith)
2005-05-06 02:51:10 +00:00
Colin Percival be5dc24f94 Correctly validate inputs to the i386_get_ldt syscall.
Security: FreeBSD-SA-05:07.ldt
Approved by: re (kensmith)
2005-05-06 02:40:49 +00:00
Colin Percival 00e16d3fa9 Correct improper permissions on /dev/iir. The earlier permissions
of 0644 allowed for people to do Evil Things via ioctl(2).

Security: FreeBSD-SA-05:06.iir
Approved by: re (kensmith)
2005-05-06 02:34:18 +00:00
Scott Long dff6e84daf MFC: Properly lock calls to xpt_done()
Approved by: re
2005-05-06 00:54:02 +00:00
Scott Long f37ba22470 MFC: Don't forget a comma.
Approved by: re
2005-05-06 00:52:59 +00:00
Scott Long 1aa89243d3 MFC: Remove an extra mutex unlock.
Approved by: re
2005-05-06 00:52:14 +00:00
Scott Long aae011bfe0 MFC: Don't ask busdma for an alignment for buffers.
Approved by: re
2005-05-06 00:51:29 +00:00
Doug White 66e427da10 Insta-MFC 1.86:
Fix link on IBM/Intel blade servers

Approved by:	re
2005-05-06 00:38:51 +00:00
Doug White 17b308027d MFC rev 1.228.2.4:
Workaround for ttwwakeup() panic.

Approved by:	re
2005-05-06 00:34:42 +00:00
Marcel Moolenaar 3d66f11761 MFC rev 1.6: Put gnome-lite and kde-lite on disc2 for ia64.
Approved by: re (kensmith)
2005-05-05 22:18:36 +00:00
Xin LI 4c25218bf6 MFen 1.761.2.41.2.8-9
Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (hrs)
2005-05-05 18:33:08 +00:00
Hiroki Sato 3842db4c80 Bump the following version numbers:
release.current		-> 5.4-RELEASE
	release.manpath.xorg	-> 6.8.2
	release.manpath.netbsd	-> 2.0.2
	release.manpath.freebsd	-> 5.4-RELEASE

Approved by:	re (implicitly)
2005-05-05 17:53:27 +00:00
Hiroki Sato 2a6a51ca62 New release notes (MFS): syslogd(8) -S option.
Approved by:	re (implicitly)
2005-05-05 17:49:08 +00:00
Hiroki Sato 02c3c9457e Add -S option which allows to change the pathname of the privileged
socket /var/run/logpriv.  MFS from:

	src/usr.sbin/syslogd/syslogd.8  1.52.2.5
	src/usr.sbin/syslogd/syslogd.c  1.131.2.3

Approved by:	re (kensmith)
2005-05-05 17:46:04 +00:00
Denis Peplin 0b7961b3a6 Merge the following from the English version:
1.761.2.41.2.7 -> 1.761.2.41.2.8 new.sgml

Approved by:	re (murray)
2005-05-05 13:21:56 +00:00
Murray Stokely c261f93c42 Typo fixes.
Approved by:	re@ (hrs)
2005-05-05 12:42:22 +00:00
Denis Peplin 6517c12a2d Merge the following from the English version:
1.761.2.41.2.5 -> 1.761.2.41.2.7 new.sgml

Approved by:	re (hrs)
2005-05-04 16:23:58 +00:00
Maxim Konovalov 5b4be67cb6 MFC rev. 1.86: fix a typo.
Approved by:	re (kensmith)
2005-05-03 12:49:12 +00:00
Xin LI 414d57e978 MFen 1.761.2.41.2.5 -> 1.761.2.41.2.7
Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (hrs)
2005-05-02 14:21:37 +00:00
Scott Long b707caaa0b Merge rev 1.57: Fix speaker output for the AD1888 codec.
Approved by: re
2005-05-01 14:32:06 +00:00
Ken Smith 77ee37cea9 Prep for the RC4 builds.
Approved by:	re (implicit)
2005-05-01 14:26:31 +00:00
Poul-Henning Kamp 02448814a1 MFC/R5:
Open slices in R/W so we can modify.

Approved by:	re
2005-05-01 09:50:52 +00:00
Poul-Henning Kamp f49c59d493 MFC/R5:
Add new solaris slice type
	Don't prefix /dev if it is already an absolute path.
	Use correct open mode (possibly r/w) if we resort to opening a slice.

Approved by:	re
2005-05-01 08:41:35 +00:00
Tim J. Robbins 313835fdb7 MFC rev. 1.29.2.1: correctly handle inputs with missing newline at EOF
in -f mode.

Approved by:	re
2005-05-01 06:55:21 +00:00
Yoshihiro Takahashi 100673fad4 MFC: Fix the apm module on pc98.
Approved by:    re (scottl)
2005-05-01 06:13:31 +00:00
Yoshihiro Takahashi 27890edae1 MFC: Add KDB_STOP_NMI option.
Approved by:	re (scottl)
2005-05-01 06:11:35 +00:00
Doug White c01523e674 MFC: KDB_STOP_NMI functionality.
Insta-MFC cleared by RE to facilitate 5.4-RC4.
Approved by:	re
2005-05-01 05:38:14 +00:00
Colin Percival b5e23bcbcd MFC revision 1.26: Add PROC_UNLOCK(p) to PTRACESTOP_SC(p, td, flag), in
order to catch up to changes in the behaviour of ptracestop().

Approved by:	re (kensmith)
2005-05-01 04:03:06 +00:00
Ken Smith 483c19239b MFC of revision 1.5 :
> date: 2005/04/17 23:30:20;  author: kensmith;  state: Exp;  lines: +0 -3
> Needed to drop "lang/gnat", "print/teTeX", and "textproc/docproj-jadetex"
> to make the packages fit on the CDs...

Approved by:	re (scottl)
2005-05-01 03:52:37 +00:00
Doug Barton 806a92ef13 MFC 1.17 - 1.21
1. Make sure that the /etc/namedb symlink is pointing to the right place.
2. Unmount the devfs when stop'ing (including on shutdown).
3. Require cleanvar.

Approved by:	re (kensmith)
2005-05-01 01:29:12 +00:00
Marcel Moolenaar 5e1e66a5c5 MFC 1.12: Make the Z8530 more reliable as low-level console.
Approved by: re (kensmith)
2005-05-01 01:06:40 +00:00
Doug White 350704e3ae Merge from RELENG_5:
src/sys/amd64/amd64/mp_machdep.c 1.242.2.9
  src/sys/i386/i386/mp_machdep.c 1.235.2.8

  Workaround Opteron Errata 106 by enabling interrupts in SMP TLB
  shootdowns.

Approved by:	re
2005-04-30 19:42:56 +00:00
Marius Strobl 8ab91ddc08 Merge from RELENG_5: 1.19.2.2
Some changes to intr_execute_handlers():
- Fix NULL pointer dereferences caused when an ithread or a handler is
  NULL which happens when a stray interrupt triggers after the respective
  device interrupt was torn down.
- Remove the critical section around INTR_FAST handlers which actually
  was a nested critical section. Both tl0_intr() and tl1_intr() already
  enter a critical section for calling intr_execute_handlers().

Approved by:	re (kensmith)
2005-04-30 16:19:04 +00:00
Marius Strobl 6bd958bd4a Merge from RELENG_5: cpufunc.h 1.18.2.1; tick.c 1.14.4.2
- Add a workaround for a bug in BlackBird CPUs (said to be part of the
  SpitFire erratum #54) which can cause writes to the TICK_CMPR register
  to fail. This seems to fix the dying clocks problem reported by jhb@
  and kris@.
- In tick_init() just use tick_stop() for stopping the tick interrupts
  until a proper handler is set up later. This also stops the system
  tick interrupt on USIII systems earlier.
- Some minor changes, e.g. use FBSDID, remove unused headers, etc.

Requested by:	kris
Approved by:	re (kensmith)
2005-04-30 16:17:23 +00:00
Scott Long 6ec0c47759 Merge rev 1.2.2.2: Don't pretend to support CAM_DATA_PHYS.
Approved by: re
2005-04-30 15:58:47 +00:00
Scott Long c5a42ff778 MFC rev 1.9.2.5: Don't include the EHCI driver in the PAE kernel.
Approved by: re
2005-04-30 15:55:39 +00:00
Scott Long 2faed283c5 MFC Rev 1.64.2.2: Create the alias rdpt device.
Approved by: re
2005-04-30 15:53:24 +00:00
Dag-Erling Smørgrav ea1859161d Revert part of rev 1.221.2.7 which MFCed documentation for a feature which
does not yet exist in RELENG_5.

Approved by:	re (scottl)
2005-04-30 15:45:07 +00:00
David Xu 6d8c0121ab MFC Revision 1.261:
Wake up swapper process.

Approved by: re (kersmith)
2005-04-28 23:45:03 +00:00
David Xu 4cb957245c MFC:
Fix race between thread_stopped and kern_wait.

Approved by:	re (kensmith)
2005-04-28 23:42:10 +00:00
Kris Kennaway 7ece111a77 MFC:
Add the vm.exec_map_entries tunable and read-only sysctl, which controls
  the number of entries in exec_map (maximum number of simultaneous execs
  that can be handled by the kernel).  The default value of 16 is
  insufficient on heavily loaded machines (particularly SMP machines), and
  if it is exceeded then executing further processes will generate a SIGABRT.

  This is a workaround until a better solution can be implemented.

Approved by:    re (kensmith)
2005-04-28 23:41:38 +00:00
David Xu bcd1792f88 MFC Revision 1.251:
Inherit signal mask from parent process.

Approved by: re (kensmith)
2005-04-28 23:37:19 +00:00
Paul Saab bf1c6b47c8 MFC:
Add support for the P600 and name the E400

Approved by:	re
2005-04-28 20:45:58 +00:00
Paul Saab c07afcbd58 MFC:
Provide a way to soft reset a proxy controller such as an MSA20 or MSA500.

Approved by:	re
2005-04-28 20:43:28 +00:00
Peter Wemm c492d367ac MF5: add i386_[gs]et_[fg]sbase(2) stubs to make a usable libc.so.5 for
6.x's compat5x packages when paired with 6.x's libpthread.so.0.

Approved by:  re (kensmith)
2005-04-27 17:53:47 +00:00
John Baldwin 5c0810fd60 MF5: Close a race between sleepq_broadcast() and sleepq_catch_signals() by
merging sleepq_resume_thread() and sleepq_remove_thread().  This also
reduces the overall number of lock operations for sleep queue operations.

Approved by:	re (kensmith)
2005-04-27 17:39:30 +00:00
Bruce A. Mah cf2e0c761d MFC: SA-05:05.cvs, restore(8) reads FreeBSD 1 dumps, syslogd(8)
supports more characters in hostname specifications.

Approved by:	re (hrs)
2005-04-26 14:45:56 +00:00
Denis Peplin 502b7b503d Merge the following from the English version:
1.227.2.25 -> 1.227.2.26.2.2 hardware/common/dev.sgml

Update also Russian override of dev-auto.sgml

Approved by:	re (hrs)
2005-04-26 06:38:34 +00:00
Scott Long fe63e4ed5a Remove the ACPI_MAX_THREADS option.
Approved by: re
2005-04-25 20:15:49 +00:00
Alexander Kabaev a66ada6e0d MFC r1.14:
Do not try to store 64 bits into 32 bit errno variable.

Approved by:	re (kensmith)
2005-04-25 20:04:53 +00:00
Gleb Smirnoff 7769e9694b MFC 1.53:
Fix panics with misconfigured routing:
  - Backout previous revision, the check is useless.
  - Turn node to queue mode, since it is edge node.

Approved by:	re (kensmith)
2005-04-25 17:24:36 +00:00
Gleb Smirnoff 03f11d66e2 MFC 1.28:
Fix error in synproxy connection completion. Source and
  destination windows were confused, one instead of other.

Approved by:	re (kensmith)
2005-04-25 15:24:30 +00:00
Nate Lawson 1ebf3f597e MFC: Add and document the debug.acpi.max_threads tunable and return the
default number of task threads to start to 3.

Approved by:	re (kensmith but earlier version)
2005-04-22 23:31:31 +00:00
Colin Percival f4d8a36ff7 MFC revision 1.31: Use bsdtar instead of GNU tar
Approved by:	re (kensmith)
2005-04-22 20:31:22 +00:00
Simon L. B. Nielsen 6cb7df1410 MFC:
Correct multiple security related errors: a buffer overflow, NULL
pointer dereferences, possible use of uninitialized variables, and
memory leaks.

Security:	CAN-2005-0753
Security:	FreeBSD-SA-05:05.cvs
Approved by:	re (kensmith)
2005-04-22 18:03:18 +00:00
Warner Losh 3e39a3949a MFC: sync usage and fix nomatch parsing.
Approved by: re@ (kensmith)
2005-04-22 03:44:07 +00:00
Warner Losh 3f81cab9c9 MFC: 1.158 Initialize mii/phy before probing same.
Approved by: re@ (kensmith)
2005-04-22 03:41:09 +00:00
cvs2svn 79c906b550 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-20 19:11:07 +00:00
Murray Stokely 7b100a2efc Fix two typos.
Approved by:	re (hrs@)
2005-04-20 00:51:39 +00:00
Denis Peplin 6af1363d65 Merge the following from the English version:
1.761.2.41.2.3 -> 1.761.2.41.2.5 new.sgml

Approved by:	re (hrs)
2005-04-19 14:55:53 +00:00
Xin LI 6580f0566a MFen 1.761.2.41.2.3 -> 1.761.2.41.2.5
Approved by:	re (hrs)
2005-04-19 09:37:18 +00:00
Peter Wemm dfa501bf79 MFC: stop i386_vm86() from either panicing or trashing random pages.
Approved by:  re (kensmith)
2005-04-18 21:36:17 +00:00
Nate Lawson f289f17a0b MFC 1.10: Fix overflow of buf.
Approved by:	re (kensmith)
2005-04-18 17:11:05 +00:00
Denis Peplin 0fb661888e Print amd64-specific security advisory only for amd64
Reviewed by:	re (hrs)
Approved by:	re (hrs)
2005-04-18 08:33:40 +00:00
Denis Peplin 0c4f8ab0cf Merge the following from the English version:
1.761.2.39 -> 1.761.2.41.2.3 relnotes/common/new.sgml

Approved by:	re (hrs)
2005-04-18 08:26:08 +00:00
Simon L. B. Nielsen 6c61725859 MF5STABLE 1.21.2.5:
- Add Dell PERC 4ei to the list of supported devices.  It's an
  alias used by Dell sometimes for PERC 4e/Si. [1]
- Delete some trailing whitespace.

Rapported by:	Jon Kuster <[email protected]> [1]
Approved by:	re (hrs)
2005-04-16 18:26:19 +00:00
Ken Smith 6b08a716a5 Getting ready for the RC3 builds.
Approved by:	re (implicit)
2005-04-16 16:09:44 +00:00
Simon L. B. Nielsen b74412017b MFC 1.844:
Document FreeBSD-SA-05:04.ifconf.

Approved by:	re (hrs)
2005-04-16 14:45:30 +00:00
John Baldwin 779211dd4d MFC: Explicitly install linux_base 8.
Approved by:	re (kensmith)
2005-04-15 22:20:20 +00:00
Gleb Smirnoff e48427cae5 MFC 1.27:
Fix mss byte order, only affects synproxy code path.

  Submitted by:   John L. Scarfone via OpenBSD
  Reviewed by:    mlaier
  Obtained from:  OpenBSD, rev. 1.483

Approved by:    re (kensmith)
2005-04-15 13:23:12 +00:00
Denis Peplin bc7ab9788a Merge the following from the English version:
1.27.2.2 -> 1.27.2.3 install.sgml
   1.9 -> 1.8.2.1 layout.sgml
   1.16 -> 1.14.2.1 trouble.sgml

Approved by:	re (hrs)
2005-04-15 07:06:26 +00:00
Colin Percival 45d20371c6 Zero the ifr.ifr_name buffer in ifconf() in order to avoid
accidental disclosure of kernel memory to userland.

Security:	FreeBSD-SA-05:04.ifconf
Approved by:	re (kensmith)
2005-04-15 01:52:03 +00:00
Doug Barton 2363b25b38 MFC fixes for rc.d/random:
/var/db/entropy -> /var/db/entropy-file, and
Fix error message when save fails.

Approved by:	re (kensmith)
2005-04-14 21:58:55 +00:00
Doug Barton d6c8e37642 MFC bug fix from 1.3 re entropy_save_sz.
Approved by:	re (kensmith)
2005-04-14 21:51:33 +00:00
Ian Dowse 4b74345a1c Merge from RELENG_5 revision 1.51.2.3: fix the handling of the
UCS_RXSTOP flag so that it always tracks whether or not the receive
pipe is stopped. This ensures that we do not attempt to start the
same transfer twice, and it allows ucomstop() to skip the restarting
of the read pipe if it was not originally running, such as when
called indirectly from ucomreadcb().

Approved by:	re (kensmith)
2005-04-14 20:20:51 +00:00
Christian Brueffer bbf8b98b0b MFC:
Autogenerate hardware notes for snd_als4000.4, snd_fm801.4 and snd_via8233.4.

Approved by:	re (hrs)
2005-04-14 08:41:34 +00:00
Robert Watson 5d6b2bcc74 Merge sched_4bsd.4:1.11-1.2 and sched_ule.4:1.1 from RELENG_5 to RELENG_5_4:
Add rudimentary man pages for kernel options sched_4bsd and sched_ule,
  which document some of the sysctls available for configuring 4bsd, some
  of the bullet features of ule, and that ule is considered experimental
  still.

  Fix small spelling error.

Approved by:	re (kensmith)
2005-04-13 16:15:22 +00:00
Christian Brueffer 0d491b6d00 MF5:
Quote sound device names which contain numbers.

Note that this change does not apply to -CURRENT, because config(8)
there has been modified not to require the quoting.

Approved by:	re (hrs)
2005-04-13 12:44:43 +00:00
John Baldwin 516752e4bf MF5: Fix some 64-bit issues including problems with mmap2.
Approved by:	re (kensmith)
2005-04-12 16:56:38 +00:00
Christian Brueffer a8b25c237c MFC: rev. 1.249 by simon
Auto generate device listings for the following drivers: snd_csa(4) and
snd_gusc(4).

Approved by:	re (hrs)
2005-04-12 14:42:44 +00:00
Christian Brueffer fe34d2453e MFC: rev. 1.57 by simon
- Fix device names for snd_vibes(4) and snd_via82c686(4).
- Bump copyright year.

Approved by:	re (hrs)
2005-04-12 14:41:30 +00:00
Pawel Jakub Dawidek d81d05420d MFC: sys/geom/geom_ctl.c 1.35
Fix a long-standing bug. Error string has to be copyied from the user
process context.

Approved by:	phk
Approved by:	re (kensmith)
2005-04-12 13:34:34 +00:00
David Malone bfab35ea0a Sync with -current. Includes man page updates and syslogd.c changes:
1.141   Check facility is not too big.
1.140   Allow : and % in hostnames for IPv6.
1.139   Deal with using whitespace as a hostname delimiter.

Approved by:	re@ (ken)
2005-04-12 12:46:08 +00:00
Hiroki Sato 1a9b676a6d The next release candidate is -RC3.
Approved by:	re (implicitly)
2005-04-12 06:08:15 +00:00
cvs2svn 4099316dd0 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-10 18:12:09 +00:00
Warner Losh c15d1db7d1 MF RELENG_5: improve ability to read FreeBSD 2.x and newer tapes. Fix
FreeBSD 1.x tapes.

Approved by: re@
2005-04-10 05:45:06 +00:00
Ken Smith aec0946bff Ready for RC2...
Approved by:	re (implicit)
2005-04-10 01:04:18 +00:00
Ken Smith b8ce7802ce MFR5: revision 1.132.2.4
> date: 2005/04/08 12:05:37;  author: jeff;  state: Exp;  lines: +1 -3
>  - Fix kern/78664, restore the old ioctl length verification code for 5.x.
>
> Contributed by: Dan Nelson

Actual work by:	jeff
Approved by:	re (kensmith, scottl) - I approved commit but couldn't find
		Jeff in time for him to do this before RC2, scottl said
		we should go ahead with it so RC2 can be started.
2005-04-10 00:53:36 +00:00
Ken Smith 2c4d92fe22 MFR5: revision 1.421.2.12
> date: 2005/04/09 17:00:17;  author: kensmith;  state: Exp;  lines: +4 -1
> Disable the NO_MIXED_MODE option by default but leave it as a commented
> entry to make it easy to find.  It causes some popular motherboards to
> fail and the magic required to make them work isn't widely known.
>
> Requested by:   des and others whose email address I've lost
> Discussed with: peter, obrien, re@
> Tested by:      various folks on amd64@, des, kensmith

Approved by:	re (scottl)
2005-04-09 17:28:37 +00:00
Ruslan Ermilov eb568d7fb0 MF5: 1.438.2.21: Fix two buglets in build32 on amd64.
Approved by:	re (kensmith)
2005-04-09 13:26:35 +00:00
Hidetoshi Shimokawa 95d2e9d5f1 Add missing sources.
Approved by:	re
2005-04-09 06:47:24 +00:00
Xin LI 73aa45ba49 MFen to 1.17
Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (blanket)
2005-04-09 06:24:30 +00:00
Xin LI 9c529159c4 MFen to 1.10
Obtained from:	The FreeBSD Simplified Chinese Project
Approved by:	re (blanket)
2005-04-09 03:14:18 +00:00
Nate Lawson e7b245eb84 MFC 1.244: Set default freq to high on boot
Approved by:	re (kensmith)
2005-04-08 21:43:50 +00:00
Gleb Smirnoff aefc5021d2 MFC 1.18:
When a packet has been reinjected into ipfw(4) after dummynet(4) processing
   we have a non-NULL args.rule. If the same packet later is subject to "tee"
   rule, its original is sent again into ipfw_chk() and it reenters at the same
   rule. This leads to infinite loop and frozen router.

   Assign args.rule to NULL, any time we are going to send packet back to
   ipfw_chk() after a tee rule. This is a temporary workaround, which we
   will leave for RELENG_5. In HEAD we are going to make divert(4) save
   next rule the same way as dummynet(4) does.

   PR:             kern/79546
   Submitted by:   Oleg Bulyzhin
   Reviewed by:    maxim, andre

Approved by:    re (kensmith)
2005-04-08 12:37:59 +00:00
Gleb Smirnoff db432e34f3 MFC 1.5, 1.6:
- Be more informative about advbase and advskew.
   - Fix ifconfig commands.

Approved by:    re (kensmith)
2005-04-08 12:32:52 +00:00
Gleb Smirnoff ff557f9b2b MFC:
part of revision 1.8:
  - Xref flowctl.8
  revision 1.6, 1.5, 1.4:
  - Added the SYNOPSIS section.
  - Sort sections.
  - Markup style.
  revision 1.3:
  1. To give the user a clue about the expiration timeout values, mention
     the default timeouts of 1800 (activity) and 15 (inactivity) seconds.
  2. Fix the "ifinfo" ASCII control message description:
     it requires the interface number as an argument.

Approved by:    re (kensmith)
2005-04-08 12:01:51 +00:00
Matthew N. Dodd c4ab8e1d0b MFC: In ata_finish() don't reset callout if request has timed out.
Thanks to Karl Denninger for finding and testing earlier patches.

Reviewed by:	scottl, sos
Approved by:	re
2005-04-08 03:27:11 +00:00
Peter Wemm 3f1913ff3c MFC: Fix sign extension bug in sigreturn(2) that broke signals.
Approved by: re (kensmith)
2005-04-08 03:13:15 +00:00
Ken Smith 4e72bc11a7 MFR5 changing the hw.ata.atapi_dma default setting so ATAPI drives
run in PIO mode:

> sys/dev/ata/ata-all.c:
> revision 1.222.2.11
> date: 2005/04/04 16:42:35;  author: kensmith;  state: Exp;  lines: +1 -1
> Change the default for hw.ata.atapi_dma so that DMA is off.  We are
> seeing a lot of install problems that get fixed by turning DMA
> off.  The sparc64 mailing list sees the most reports of this but it
> does come up on others.  Changing the default should give us a more
> robust install, at the expense of people who need DMA for burning
> CDs needing to turn it on (maybe).
>
> The same change will be made in HEAD shortly by the ata maintainer.
>
> Discussed with: sos, scottl
>
> ---------
>
> share/man/man4/ata.4
> revision 1.46.2.3
> date: 2005/04/04 17:23:16;  author: kensmith;  state: Exp;  lines: +1 -1
> Default for hw.ata.atapi_dma is now PIO.
>
> Reminded by:    Joel Dahl <joel (at) automatvapen (dot) se>

Approved by:	re (scottl)
2005-04-07 14:26:34 +00:00
Xin LI 1790ef461b MFen 1.761.2.41.2.1-1.761.2.41.2.3
Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (blanket)
2005-04-07 03:01:32 +00:00
Hiroki Sato 82c4100ef6 MFC: FreeBSD-SA-05:03.amd64.
Approved by:	re (implicitly)
2005-04-06 18:40:08 +00:00
Pawel Jakub Dawidek 2311d5b0d9 - Add a missing g_io_deliver() in case of allocation failure - we didn't
completed I/O requests here.
- First allocate all needed bios, so if any of allocations fail, we can
  free memory before sending any I/O requests down.

Reported by:	Pawel Malachowski
Approved by:	re (kensmith)
2005-04-06 13:08:24 +00:00
Colin Percival 1a63efc257 Fully initialize the required TSS fields so that the io permission
bitmap is set correctly.

Patch from:	peter
Security:	FreeBSD-SA-05:03.amd64
Approved by:	re (kensmith)
2005-04-06 01:06:15 +00:00
Bruce A. Mah 45ac7ec44d MFC: SA-05:02.sendfile.
Approved by:	re (blanket)
2005-04-06 00:36:01 +00:00
Jacques Vidrine 9e7fc1c6c5 MFC 1.39: Correct type mismatch.
Approved by:	re (implicit, follow-up commit)
2005-04-05 18:28:33 +00:00
Jacques Vidrine 1451658eda MFC rev 1.37, 1.38: Correct a typo that resulted in rexecd behaving as
if the `-i' option was always specified.  Correct some mostly
theoretical bugs related to misuse of the static buffer returned by
getpwnam.

Security: rexecd's document default policy of disallowing root logins
          was not enforced.
Approved by: re
2005-04-05 15:28:51 +00:00
Colin Percival 4cfafdce19 MFC revision 1.103.
Security:	FreeBSD-SA-05:02.sendfile
Approved by:	re (kensmith, scottl)
2005-04-04 23:52:35 +00:00
Xin LI 80ba82634a Use 5.4-RELEASE for RELENG_5_4.
Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (blanket)
2005-04-03 18:06:46 +00:00
Xin LI b5b8199a7b MFR5 1.1.2.2 (effectively MFen 1.27.2.2 -> 1.27.2.3)
Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (blanket)
2005-04-03 17:48:52 +00:00
Xin LI 4d3f0fb9f5 MFR5 1.1.2.3
Effectively MFen 1.227.2.25 -> 1.227.2.26

Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (blanket)
2005-04-03 17:13:26 +00:00
Xin LI 12e699bac8 MF5 (1.1.2.5)
MFen 1.761.2.41 -> 1.761.2.41.2.1

Obtained from:	The FreeBSD Simplified Chinese Project CVS
Approved by:	re (blanket)
2005-04-03 16:17:54 +00:00
Hiroki Sato 4664ca31df Replace &release.prev.historic; with &release.prev;.
This distinction is no longer needed.

Approved by:	re (implicitly)
2005-04-03 11:10:42 +00:00
Hiroki Sato ddae5986aa Fix and update several entities for 5.4R. Set &release.current; to
"5.4-RC1" and &release.manpath.freebsd; to "5.3-stable" temporarily.

Approved by:	re (implicitly)
2005-04-03 11:02:03 +00:00
Ken Smith cf4f815cc6 Add packages-5.4-release.
Approved by:	re (implicit)
2005-04-03 07:55:14 +00:00
Ken Smith 9abd780b07 Adjust __FreeBSD_version for 5.4.
Approved by:	re (implicit)
2005-04-03 07:51:13 +00:00
Ken Smith 6d7cc9779d Prep for RC1.
Approved by:	re (implicit)
2005-04-03 07:49:19 +00:00
Ken Smith a87e42d1b7 Update branch tag to RELENG_5_4.
Approved by:	re (implicit)
2005-04-03 07:48:09 +00:00
Ken Smith 3309ac9046 Update version numbers to reflect 5.4 as the release.
Approved by:	re (implicit)
2005-04-03 07:42:12 +00:00
Ken Smith 0eaaff6020 Update for RELENG_5_4.
Approved by:	re (implicit)
2005-04-03 07:35:58 +00:00
Ken Smith 269b619acf Bump version numbers for 5.4.
Approved by:	re (implicit)
2005-04-03 07:28:50 +00:00
Ken Smith d79b0bf5ac Change cvs update target to RELENG_5_4.
Approved by:	re (implicit)
2005-04-03 07:26:42 +00:00
cvs2svn 31367afb7a This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-03 06:01:08 +00:00
cvs2svn 13470b0f3c This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-02 23:29:43 +00:00
cvs2svn d74c3c27b0 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-02 19:44:13 +00:00
cvs2svn 09ae67cc5b This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-02 19:44:12 +00:00
cvs2svn 0b8475aff4 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-02 16:37:59 +00:00
cvs2svn 08f55ce621 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-02 16:20:35 +00:00
cvs2svn ea8b8bec69 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-02 13:28:16 +00:00
cvs2svn 0f27669d82 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-01 22:45:58 +00:00
cvs2svn 310bbb5df8 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-01 15:28:26 +00:00
cvs2svn 9b52520a06 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-01 13:45:49 +00:00
cvs2svn 6b5f092535 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-04-01 13:11:05 +00:00
cvs2svn 5e969c1ab7 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-27 17:11:15 +00:00
cvs2svn 85b4d6e1ad This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-26 19:15:13 +00:00
cvs2svn 4162d6fdf5 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-26 07:18:06 +00:00
cvs2svn 53abed6ee9 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-23 04:50:27 +00:00
cvs2svn 13fd91dbab This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-21 17:41:01 +00:00
cvs2svn 89c3c62d5e This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-21 16:05:37 +00:00
cvs2svn e6dc8ed99a This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-19 21:12:20 +00:00
cvs2svn 9c782c5902 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-19 05:55:42 +00:00
cvs2svn f321284c0d This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-15 16:50:39 +00:00
cvs2svn 9bb683f9ef This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-07 21:37:31 +00:00
cvs2svn 74ce2178ee This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-04 18:10:28 +00:00
cvs2svn 9d45eb1ae7 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-03 00:46:33 +00:00
cvs2svn 963c41e4f7 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-02 12:06:05 +00:00
cvs2svn baa292ab0c This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-01 14:22:32 +00:00
cvs2svn b79d878908 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-03-01 09:30:20 +00:00
cvs2svn 4bb1a32a18 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-02-28 19:32:25 +00:00
cvs2svn 25d53bf2fa This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-02-27 15:40:18 +00:00
cvs2svn 9e58ba9611 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-02-27 04:06:58 +00:00
cvs2svn 38d7b711d8 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-02-27 02:42:56 +00:00
cvs2svn dea010c75b This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-02-24 01:58:52 +00:00
cvs2svn 3de3e2f556 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-02-05 01:02:06 +00:00
cvs2svn d80a98f365 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-01-31 23:27:05 +00:00
cvs2svn 49f582e1de This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-01-30 01:00:14 +00:00
cvs2svn 781e6923ae This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-01-28 13:42:30 +00:00
cvs2svn bca5d40a61 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2005-01-25 09:39:18 +00:00
cvs2svn 71592928dd This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-12-06 19:34:09 +00:00
cvs2svn bc993ae43e This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-11-25 22:54:05 +00:00
cvs2svn 8547fd010b This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-11-10 19:37:04 +00:00
cvs2svn 85b00aafe6 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-10-24 09:23:11 +00:00
cvs2svn 57071de8c8 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-10-24 09:23:10 +00:00
cvs2svn bd341bd243 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-10-10 09:50:55 +00:00
cvs2svn 22fb2ebd4c This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-09-05 14:11:18 +00:00
cvs2svn 98ff413ef3 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-08-18 16:37:13 +00:00
cvs2svn 67de537959 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-08-18 16:37:12 +00:00
cvs2svn f0151a4632 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-08-18 16:37:11 +00:00
cvs2svn d5548e810c This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-08-18 16:37:10 +00:00
cvs2svn db808aebaa This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-08-18 16:37:09 +00:00
cvs2svn 94063f9bc7 This commit was manufactured by cvs2svn to create branch 'RELENG_5_4'. 2004-08-18 16:37:08 +00:00
187 changed files with 4137 additions and 47959 deletions

No files matched your search

+1 -1
View File
@@ -83,7 +83,7 @@ CLEANDIR= cleandir
.endif
CVS?= cvs
CVSFLAGS?= -r RELENG_5 -P -d -I!
CVSFLAGS?= -r RELENG_5_4 -P -d -I!
SUP?= /usr/local/bin/cvsup
SUPFLAGS?= -g -L 2 -P -
.if defined(SUPHOST)
+95 -87
View File
@@ -6,7 +6,35 @@ done items, please see the COMMON ITEMS: section later in the file.
Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running
portupgrade.
portupgrade. Important recent entries: 20040724 (default X changes).
20050509:
FreeBSD 5.4-RELEASE.
20050507: FreeBSD-SA-05:08.kmem
Correct two issues which missed from the earlier commit.
20050506: FreeBSD-SA-05:08.kmem
Correct several local kernel memory disclosure bugs.
20050506: FreeBSD-SA-05:07.ldt
Correctly validate inputs to the i386_get_ldt syscall.
20050506: FreeBSD-SA-05:06.iir
Correct overly liberal permissions on /dev/iir.
20050422: FreeBSD-SA-05:05.cvs
Correct several vulnerabilities in CVS.
20050414: FreeBSD-SA-05:04.ifconf
Zero a buffer in ifconf() in order to avoid accidental
disclosure of kernel memory to userland.
20050406: FreeBSD-SA-05:03.amd64
Correctly initialize the I/O permission bitmap on amd64.
20050404: FreeBSD-SA-05:02.sendfile
Correct kernel memory disclosure bug in sendfile(2).
20050302:
The full packet destination manipulation for 'ipfw fwd' is
@@ -1845,19 +1873,19 @@ COMMON ITEMS:
# space on /.
<make sure you have good level 0 dumps>
<maybe fix /etc/fstab> [1]
make buildworld [2]
make buildkernel KERNCONF=YOUR_KERNEL_HERE [3]
cp sys/${MACHINE}/conf/GENERIC.hints /boot/device.hints [4]
<maybe fix /etc/fstab> [7]
make buildworld [9]
make buildkernel KERNCONF=YOUR_KERNEL_HERE [8]
cp sys/${MACHINE}/conf/GENERIC.hints /boot/device.hints [2]
make installkernel KERNCONF=YOUR_KERNEL_HERE
cd sys/boot ; make STRIP="" install [5]
[6]
<reboot in single user> [7]
/usr/src/etc/rc.d/preseedrandom [8]
mergemaster -p [9]
cd sys/boot ; make STRIP="" install [6]
[1]
<reboot in single user> [3]
/usr/src/etc/rc.d/preseedrandom [10]
mergemaster -p [5]
rm -rf /usr/include/g++
make installworld
mergemaster -i [10]
mergemaster -i [4]
<reboot>
Make sure that you've read the UPDATING file to understand the
@@ -1872,92 +1900,72 @@ COMMON ITEMS:
messages there. If in doubt, please track -stable which has
much fewer pitfalls.
If you have any ports or packages installed on the system, please
see /usr/ports/UPDATING. The following items are known to cause
problems with the upgrade:
(a) Kerberos upgrades are hard, and evidentally don't work. More
on this later.
(b) Old ports and packages can sometimes have subtle problems with
newer libraries. portupgrade -f is recommended where possible
after the upgrade. portupgrade -P will be faster since it uses
packages. There are many known issues with running a mix of
4.x built packages and 5.x built packages, and this avoids them.
(c) Perl based ports may also have the wrong version of perl hard
coded into the headers. Spamassassin is one such port.
(d) Startup scripts have significantly changed. Make sure that you
verify that all expected daemons start. Modifications of /etc/rc*
(except rc.conf) may cause problems.
(e) Device names have changed and MAKEDEV is gone.
(f) The boot loader defaults have changed, which may cause confusion.
[1] If you have third party modules, such as vmware, you
should disable them at this point so they don't crash your
system on reboot.
[1] Before you upgrade, please make sure that you are not using
compatibility slices. These are device names of the form, on i386 and
other architectures that use MBR slicing, /dev/ad0a without the actual
slice name. Chances are excellent that these will break. You
generally must update these entries to use the post FreeBSD 2.x form
of /dev/ad0s1a.
[2] If you have legacy ISA devices, you may need to create
your own device.hints to reflect your unique hardware
configuration.
[2] When checking out sources, you must include the -P flag to have
cvs prune empty directories. Also, if CPUTYPE is defined in your
/etc/make.conf, make sure to use the "?=" instead of the "="
assignment operator, so that buildworld can override the CPUTYPE if it
needs to. In case you would like to avoid installing new packages of
everything, you might want to uncomment the "COMPAT4X= YES" entry, so
that 4.x compatibility libraries are built which should allow you to
continue using your existing software for a while.
[3] In order to have a kernel that can run the 4.x or earlier binaries
needed to do an installworld, you must include the COMPAT_FREEBSD4
option in your kernel. Failure to do so may leave you with a system
that is hard to boot to recover. If you have a.out binaries, then you
need to add COMPAT_AOUT option too. If you are updating a system
that's been updated from 2.x and/or 3.x in the past, enable both of
these to be safe.
[4] If you have legacy ISA devices, you may need to create your own
device.hints to reflect your unique hardware configuration.
[5] 4.x boot loader can be used to boot a 5.x system, however it is
difficult to do that at best. If you wish to try, then you should
interrupt the boot and at the ok prompt type:
ok unload
ok boot /boot/kernel/kernel
If this fails to work, you must install a new boot loader as described
here.
[6] If you have third party modules, such as vmware, you should
disable them at this point so they don't crash your system on reboot.
[7] From the bootblocks, boot -s, and then do
[3] From the bootblocks, boot -s, and then do
fsck -p
mount -u /
mount -a
cd /usr/src
adjkerntz -i # if CMOS is wall time
Also, when doing a major release upgrade, it is required that you boot
into single user mode to do the installworld. For the 4.x -> 5.x
upgrade, you will also see many messages about needing to recompile
your userland. These are harmless and can be ignored while you
proceed to the next step.
Also, when doing a major release upgrade, it is required that
you boot into single user mode to do the installworld.
For the 4.x -> 5.x upgrade, you will also see many messages about
needing to recompile your userland. These are harmless and can
be ignored while you proceed to the next step.
[8] In order to create temporary files, /dev/random must be
[4] Note: This step is non-optional. Failure to do this step
can result in a significant reduction in the functionality of the
system. Attempting to do it by hand is not recommended and those
that pursue this avenue should read this file carefully, as well
as the archives of freebsd-current and freebsd-hackers mailing lists
for potential gotchas.
[5] Usually this step is a noop. However, from time to time
you may need to do this if you get unknown user in the following
step. It never hurts to do it all the time. You may need to
install a new mergemaster (cd src/usr.sbin/mergemaster && make
install) after the buildworld before this step if you last updated
from current before 20020224 or from -stable before 20020408.
[6] 4.x boot loader can be used to boot a 5.x system, however
it is difficult to do that at best. If you wish to try, then
you should interrupt the boot and at the ok prompt type:
ok unload
ok boot /boot/kernel/kernel
If this fails to work, you must install a new boot loader as
described here.
[7] Before you upgrade, please make sure that you are not using
compatibility slices. These are device names of the form, on i386
and other architectures that use MBR slicing, /dev/ad0a without the
actual slice name. Chances are excellent that these will break.
You generally must update these entries to use the post FreeBSD
2.x form of /dev/ad0s1a.
[8] In order to have a kernel that can run the 4.x binaries
needed to do an installworld, you must include the COMPAT_FREEBSD4
option in your kernel. Failure to do so may leave you with a system
that is hard to boot to recover.
[9] When checking out sources, you must include the -P flag to have
cvs prune empty directories. Also, if CPUTYPE is defined in your
/etc/make.conf, make sure to use the "?=" instead of the "=" assignment
operator, so that buildworld can override the CPUTYPE if it needs to.
In case you would like to avoid installing new packages of everything,
you might want to uncomment the "COMPAT4X= YES" entry, so that 4.x
compatibility libraries are built which should allow you to continue
using your existing software for a while.
[10] In order to create temporary files, /dev/random must be
initialized by feeding data into it. /usr/src/etc/rc.d/preseedrandom
takes care of this.
[9] Usually this step is a noop. However, from time to time you may
need to do this if you get unknown user in the following step. It
never hurts to do it all the time. You may need to install a new
mergemaster (cd src/usr.sbin/mergemaster && make install) after the
buildworld before this step if you last updated from current before
20020224 or from -stable before 20020408.
[10] Note: This step is non-optional. Failure to do this step can
result in a significant reduction in the functionality of the system.
Attempting to do it by hand is not recommended and those that pursue
this avenue should read this file carefully, as well as the archives
of freebsd-current and freebsd-hackers mailing lists for potential
gotchas.
FORMAT:
This file contains a list, in reverse chronological order, of major
+1 -1
View File
@@ -103,7 +103,7 @@ The options are as follows:
.Bl -tag -width indent
.It Fl a
Display information about other users' processes as well as your own.
This will skip any processes which do not have a controlling teminal,
This will skip any processes which do not have a controlling terminal,
unless the
.Fl x
option is also specified.
+1 -1
View File
@@ -116,7 +116,7 @@ password_entry_parseline (cvsroot_canonical, warn, linenumber, linebuf)
if (isspace(*(linebuf + 1)))
/* special case since strtoul ignores leading white space */
entry_version = 0;
q = linebuf + 1;
else
entry_version = strtoul (linebuf + 1, &q, 10);
+4 -3
View File
@@ -385,6 +385,7 @@ patch_fileproc (callerdat, finfo)
struct utimbuf t;
char *vers_tag, *vers_head;
char *rcs = NULL;
char *rcs_orig = NULL;
RCSNode *rcsfile;
FILE *fp1, *fp2, *fp3;
int ret = 0;
@@ -415,7 +416,7 @@ patch_fileproc (callerdat, finfo)
if ((rcsfile->flags & VALID) && (rcsfile->flags & INATTIC))
isattic = 1;
rcs = xmalloc (strlen (finfo->file) + sizeof (RCSEXT) + 5);
rcs_orig = rcs = xmalloc (strlen (finfo->file) + sizeof (RCSEXT) + 5);
(void) sprintf (rcs, "%s%s", finfo->file, RCSEXT);
/* if vers_head is NULL, may have been removed from the release */
@@ -757,8 +758,8 @@ failed to read diff file header %s for %s: end of file", tmpfile3, rcs);
free (vers_tag);
if (vers_head != NULL)
free (vers_head);
if (rcs != NULL)
free (rcs);
if (rcs_orig)
free (rcs_orig);
return ret;
}
+5 -4
View File
@@ -3041,8 +3041,7 @@ RCS_getdate (rcs, date, force_tag_match)
if (retval != NULL)
return (retval);
if (!force_tag_match ||
(vers != NULL && RCS_datecmp (vers->date, date) <= 0))
if (vers && (!force_tag_match || RCS_datecmp (vers->date, date) <= 0))
return xstrdup (vers->version);
else
return NULL;
@@ -4139,7 +4138,7 @@ RCS_checkout (rcs, workfile, rev, nametag, options, sout, pfn, callerdat)
size_t len;
int free_value = 0;
char *log = NULL;
size_t loglen;
size_t loglen = 0;
Node *vp = NULL;
#ifdef PRESERVE_PERMISSIONS_SUPPORT
uid_t rcs_owner = (uid_t) -1;
@@ -7457,7 +7456,7 @@ RCS_deltas (rcs, fp, rcsbuf, version, op, text, len, log, loglen)
for (ln = 0; ln < headlines.nlines; ++ln)
{
char buf[80];
char *buf;
/* Period which separates year from month in date. */
char *ym;
/* Period which separates month from day in date. */
@@ -7468,10 +7467,12 @@ RCS_deltas (rcs, fp, rcsbuf, version, op, text, len, log, loglen)
if (prvers == NULL)
prvers = vers;
buf = xmalloc (strlen (prvers->version) + 24);
sprintf (buf, "%-12s (%-8.8s ",
prvers->version,
prvers->author);
cvs_output (buf, 0);
free (buf);
/* Now output the date. */
ym = strchr (prvers->date, '.');
+1 -1
View File
@@ -151,7 +151,7 @@ the base port number used in probes (default is 33434).
Traceroute hopes that nothing is listening on UDP ports
.I base
to
.I base + nhops * nprobes - 1
.I base + nhops - 1
at the destination host (so an ICMP PORT_UNREACHABLE message will
be returned to terminate the route tracing). If something is
listening on a port in the default range, this option can be used
-18
View File
@@ -1,18 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: bsnmpd
# REQUIRE: NETWORKING syslogd
# KEYWORD: nojail
. /etc/rc.subr
name="bsnmpd"
rcvar=`set_rcvar`
command="/usr/sbin/${name}"
pidfile="/var/run/snmpd.pid"
load_rc_config $name
run_rc_command "$1"
+14 -1
View File
@@ -5,8 +5,9 @@
#
# PROVIDE: named
# REQUIRE: SERVERS
# REQUIRE: SERVERS cleanvar
# BEFORE: DAEMON
# KEYWORD: shutdown
. /etc/rc.subr
@@ -14,6 +15,7 @@ name="named"
rcvar=`set_rcvar`
start_precmd="named_precmd"
start_postcmd="make_symlinks"
stop_postcmd="named_poststop"
required_dirs="$named_chrootdir" # if it is set, it must exist
extra_commands="reload"
@@ -48,6 +50,10 @@ chroot_autoupdate()
else
ln -s ${named_chrootdir}/etc/namedb /etc/namedb
fi
else
# Make sure it points to the right place.
ln -shf ${named_chrootdir}/etc/namedb /etc/namedb
fi
# Mount a devfs in the chroot directory if needed
@@ -77,6 +83,13 @@ make_symlinks()
ln -fs "${named_chrootdir}${pidfile}" ${pidfile}
}
named_poststop()
{
if [ -n "${named_chrootdir}" -a -c ${named_chrootdir}/dev/null ]; then
umount ${named_chrootdir}/dev 2>/dev/null || true
fi
}
named_precmd()
{
local confgen_chroot
-18
View File
@@ -1,18 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: powerd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: nojail
. /etc/rc.subr
name="powerd"
rcvar=`set_rcvar`
command="/usr/sbin/powerd"
load_rc_config $name
run_rc_command "$1"
-67
View File
@@ -1,67 +0,0 @@
# $FreeBSD$
#
# Example configuration file for bsnmpd(1).
#
#
# Set some common variables
#
host := foo.bar.com
location := "Room 200"
contact := "[email protected]"
system := 1 # FreeBSD
traphost := noc.bar.com
trapport := 162
# Change this!
read := "public"
write := "geheim"
trap := "mytrap"
#
# Configuration
#
%snmpd
begemotSnmpdDebugDumpPdus = 2
begemotSnmpdDebugSyslogPri = 7
begemotSnmpdCommunityString.0.1 = $(read)
begemotSnmpdCommunityString.0.2 = $(write)
begemotSnmpdCommunityDisable = 1
# open standard SNMP ports
begemotSnmpdPortStatus.[$(host)].161 = 1
begemotSnmpdPortStatus.127.0.0.1.161 = 1
# open a unix domain socket
begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
# send traps to the traphost
begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
sysContact = $(contact)
sysLocation = $(location)
sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system)
snmpEnableAuthenTraps = 2
#
# Load MIB-2 module
#
begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"
#
# Netgraph module
#
#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
#
#%netgraph
#begemotNgControlNodeName = "snmpd"
#
# pf(4) module
#
#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so"
+2 -2
View File
@@ -1170,7 +1170,7 @@ LibAliasIn(struct libalias *la, char *ptr, int maxpacketsize)
if (la->packetAliasMode & PKT_ALIAS_REVERSE) {
la->packetAliasMode &= ~PKT_ALIAS_REVERSE;
iresult = LibAliasOut(la, ptr, maxpacketsize);
iresult = PacketAliasOut(ptr, maxpacketsize);
la->packetAliasMode |= PKT_ALIAS_REVERSE;
return (iresult);
}
@@ -1264,7 +1264,7 @@ LibAliasOutTry(struct libalias *la, char *ptr, /* valid IP packet */
if (la->packetAliasMode & PKT_ALIAS_REVERSE) {
la->packetAliasMode &= ~PKT_ALIAS_REVERSE;
iresult = LibAliasIn(la, ptr, maxpacketsize);
iresult = PacketAliasIn(ptr, maxpacketsize);
la->packetAliasMode |= PKT_ALIAS_REVERSE;
return (iresult);
}
-1
View File
@@ -15,7 +15,6 @@ SRCS= rpoll.c
INCS= rpoll.h
MAN= rpoll.3
CLEANFILES= rpoll.3
rpoll.3: rpoll.man
cat ${.ALLSRC} > ${.TARGET}
+1 -2
View File
@@ -8,8 +8,7 @@ _snmp_atm= snmp_atm
SUBDIR= ${_snmp_atm} \
snmp_mibII \
snmp_netgraph \
snmp_pf
snmp_netgraph
INCS= snmpmod.h
INCSDIR= ${INCLUDEDIR}/bsnmp
File diff suppressed because it is too large. Load diff
-15
View File
@@ -1,15 +0,0 @@
# $FreeBSD$
#
# Author: Philip Paeps <[email protected]>
CONTRIB=${.CURDIR}/../../../../contrib/bsnmp
MOD= pf
SRCS= pf_snmp.c
WARNS?= 6
XSYM= begemotPf
DEFS= ${MOD}_tree.def
BMIBS= BEGEMOT-PF-MIB.txt
.include <bsd.lib.mk>
File diff suppressed because it is too large. Load diff
-195
View File
@@ -1,195 +0,0 @@
#
# Copyright (c) 2005 Philip Paeps <philip@FreeBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
#
(1 internet
(4 private
(1 enterprises
(12325 fokus
(1 begemot
(200 begemotPf
(1 begemotPfObjects
(1 pfStatus
(1 pfStatusRunning INTEGER pf_status GET)
(2 pfStatusRuntime TIMETICKS pf_status GET)
(3 pfStatusDebug INTEGER pf_status GET)
(4 pfStatusHostId OCTETSTRING pf_status GET)
)
(2 pfCounter
(1 pfCounterMatch COUNTER64 pf_counter GET)
(2 pfCounterBadOffset COUNTER64 pf_counter GET)
(3 pfCounterFragment COUNTER64 pf_counter GET)
(4 pfCounterShort COUNTER64 pf_counter GET)
(5 pfCounterNormalize COUNTER64 pf_counter GET)
(6 pfCounterMemDrop COUNTER64 pf_counter GET)
)
(3 pfStateTable
(1 pfStateTableCount UNSIGNED32 pf_statetable GET)
(2 pfStateTableSearches COUNTER64 pf_statetable GET)
(3 pfStateTableInserts COUNTER64 pf_statetable GET)
(4 pfStateTableRemovals COUNTER64 pf_statetable GET)
)
(4 pfSrcNodes
(1 pfSrcNodesCount UNSIGNED32 pf_srcnodes GET)
(2 pfSrcNodesSearches COUNTER64 pf_srcnodes GET)
(3 pfSrcNodesInserts COUNTER64 pf_srcnodes GET)
(4 pfSrcNodesRemovals COUNTER64 pf_srcnodes GET)
)
(5 pfLimits
(1 pfLimitsStates UNSIGNED32 pf_limits GET)
(2 pfLimitsSrcNodes UNSIGNED32 pf_limits GET)
(3 pfLimitsFrags UNSIGNED32 pf_limits GET)
)
(6 pfTimeouts
(1 pfTimeoutsTcpFirst INTEGER32 pf_timeouts GET)
(2 pfTimeoutsTcpOpening INTEGER32 pf_timeouts GET)
(3 pfTimeoutsTcpEstablished INTEGER32 pf_timeouts GET)
(4 pfTimeoutsTcpClosing INTEGER32 pf_timeouts GET)
(5 pfTimeoutsTcpFinWait INTEGER32 pf_timeouts GET)
(6 pfTimeoutsTcpClosed INTEGER32 pf_timeouts GET)
(7 pfTimeoutsUdpFirst INTEGER32 pf_timeouts GET)
(8 pfTimeoutsUdpSingle INTEGER32 pf_timeouts GET)
(9 pfTimeoutsUdpMultiple INTEGER32 pf_timeouts GET)
(10 pfTimeoutsIcmpFirst INTEGER32 pf_timeouts GET)
(11 pfTimeoutsIcmpError INTEGER32 pf_timeouts GET)
(12 pfTimeoutsOtherFirst INTEGER32 pf_timeouts GET)
(13 pfTimeoutsOtherSingle INTEGER32 pf_timeouts GET)
(14 pfTimeoutsOtherMultiple INTEGER32 pf_timeouts GET)
(15 pfTimeoutsFragment INTEGER32 pf_timeouts GET)
(16 pfTimeoutsInterval INTEGER32 pf_timeouts GET)
(17 pfTimeoutsAdaptiveStart INTEGER32 pf_timeouts GET)
(18 pfTimeoutsAdaptiveEnd INTEGER32 pf_timeouts GET)
(19 pfTimeoutsSrcNode INTEGER32 pf_timeouts GET)
)
(7 pfLogInterface
(1 pfLogInterfaceName OCTETSTRING pf_logif GET)
(2 pfLogInterfaceIp4BytesIn COUNTER64 pf_logif GET)
(3 pfLogInterfaceIp4BytesOut COUNTER64 pf_logif GET)
(4 pfLogInterfaceIp4PktsInPass COUNTER64 pf_logif GET)
(5 pfLogInterfaceIp4PktsInDrop COUNTER64 pf_logif GET)
(6 pfLogInterfaceIp4PktsOutPass COUNTER64 pf_logif GET)
(7 pfLogInterfaceIp4PktsOutDrop COUNTER64 pf_logif GET)
(8 pfLogInterfaceIp6BytesIn COUNTER64 pf_logif GET)
(9 pfLogInterfaceIp6BytesOut COUNTER64 pf_logif GET)
(10 pfLogInterfaceIp6PktsInPass COUNTER64 pf_logif GET)
(11 pfLogInterfaceIp6PktsInDrop COUNTER64 pf_logif GET)
(12 pfLogInterfaceIp6PktsOutPass COUNTER64 pf_logif GET)
(13 pfLogInterfaceIp6PktsOutDrop COUNTER64 pf_logif GET)
)
(8 pfInterfaces
(1 pfInterfacesIfNumber INTEGER32 pf_interfaces GET)
(2 pfInterfacesIfTable
(1 pfInterfacesIfEntry : INTEGER32 pf_iftable
(1 pfInterfacesIfIndex INTEGER32)
(2 pfInterfacesIfDescr OCTETSTRING GET)
(3 pfInterfacesIfType INTEGER GET)
(4 pfInterfacesIfTZero TIMETICKS GET)
(5 pfInterfacesIfRefsState UNSIGNED32 GET)
(6 pfInterfacesIfRefsRule UNSIGNED32 GET)
(7 pfInterfacesIf4BytesInPass COUNTER64 GET)
(8 pfInterfacesIf4BytesInBlock COUNTER64 GET)
(9 pfInterfacesIf4BytesOutPass COUNTER64 GET)
(10 pfInterfacesIf4BytesOutBlock COUNTER64 GET)
(11 pfInterfacesIf4PktsInPass COUNTER64 GET)
(12 pfInterfacesIf4PktsInBlock COUNTER64 GET)
(13 pfInterfacesIf4PktsOutPass COUNTER64 GET)
(14 pfInterfacesIf4PktsOutBlock COUNTER64 GET)
(15 pfInterfacesIf6BytesInPass COUNTER64 GET)
(16 pfInterfacesIf6BytesInBlock COUNTER64 GET)
(17 pfInterfacesIf6BytesOutPass COUNTER64 GET)
(18 pfInterfacesIf6BytesOutBlock COUNTER64 GET)
(19 pfInterfacesIf6PktsInPass COUNTER64 GET)
(20 pfInterfacesIf6PktsInBlock COUNTER64 GET)
(21 pfInterfacesIf6PktsOutPass COUNTER64 GET)
(22 pfInterfacesIf6PktsOutBlock COUNTER64 GET)
)
)
)
(9 pfTables
(1 pfTablesTblNumber INTEGER32 pf_tables GET)
(2 pfTablesTblTable
(1 pfTablesTblEntry : INTEGER32 pf_tbltable
(1 pfTablesTblIndex INTEGER32)
(2 pfTablesTblDescr OCTETSTRING GET)
(3 pfTablesTblCount INTEGER32 GET)
(4 pfTablesTblTZero TIMETICKS GET)
(5 pfTablesTblRefsAnchor INTEGER32 GET)
(6 pfTablesTblRefsRule INTEGER32 GET)
(7 pfTablesTblEvalMatch COUNTER64 GET)
(8 pfTablesTblEvalNoMatch COUNTER64 GET)
(9 pfTablesTblBytesInPass COUNTER64 GET)
(10 pfTablesTblBytesInBlock COUNTER64 GET)
(11 pfTablesTblBytesInXPass COUNTER64 GET)
(12 pfTablesTblBytesOutPass COUNTER64 GET)
(13 pfTablesTblBytesOutBlock COUNTER64 GET)
(14 pfTablesTblBytesOutXPass COUNTER64 GET)
(15 pfTablesTblPktsInPass COUNTER64 GET)
(16 pfTablesTblPktsInBlock COUNTER64 GET)
(17 pfTablesTblPktsInXPass COUNTER64 GET)
(18 pfTablesTblPktsOutPass COUNTER64 GET)
(19 pfTablesTblPktsOutBlock COUNTER64 GET)
(20 pfTablesTblPktsOutXPass COUNTER64 GET)
)
)
(3 pfTablesAddrTable
(1 pfTablesAddrEntry : INTEGER32 pf_tbladdr
(1 pfTablesAddrIndex INTEGER32)
(2 pfTablesAddrNet IPADDRESS GET)
(3 pfTablesAddrMask INTEGER32 GET)
(4 pfTablesAddrTZero TIMETICKS GET)
(5 pfTablesAddrBytesInPass COUNTER64 GET)
(6 pfTablesAddrBytesInBlock COUNTER64 GET)
(7 pfTablesAddrBytesOutPass COUNTER64 GET)
(8 pfTablesAddrBytesOutBlock COUNTER64 GET)
(9 pfTablesAddrPktsInPass COUNTER64 GET)
(10 pfTablesAddrPktsInBlock COUNTER64 GET)
(11 pfTablesAddrPktsOutPass COUNTER64 GET)
(12 pfTablesAddrPktsOutBlock COUNTER64 GET)
)
)
)
(10 pfAltq
(1 pfAltqQueueNumber INTEGER32 pf_altq GET)
(2 pfAltqQueueTable
(1 pfAltqQueueEntry : INTEGER32 pf_altqq
(1 pfAltqQueueIndex INTEGER32)
(2 pfAltqQueueDescr OCTETSTRING GET)
(3 pfAltqQueueParent OCTETSTRING GET)
(4 pfAltqQueueScheduler INTEGER GET)
(5 pfAltqQueueBandwidth UNSIGNED32 GET)
(6 pfAltqQueuePriority INTEGER32 GET)
(7 pfAltqQueueLimit INTEGER32 GET)
)
)
)
)
)
)
)
)
)
)
-4
View File
@@ -1,4 +0,0 @@
# $FreeBSD$
MDSRCS+= bcmp.S bcopy.S bzero.S memcmp.S memcpy.S memmove.S memset.S \
strcat.S strcmp.S strcpy.S
-24
View File
@@ -1,24 +0,0 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
#if 0
RCSID("$NetBSD: bcmp.S,v 1.1 2001/06/19 00:25:04 fvdl Exp $")
#endif
ENTRY(bcmp)
cld /* set compare direction forward */
movq %rdx,%rcx /* compare by words */
shrq $3,%rcx
repe
cmpsq
jne L1
movq %rdx,%rcx /* compare remainder by bytes */
andq $7,%rcx
repe
cmpsb
L1:
setne %al
movsbl %al,%eax
ret
-88
View File
@@ -1,88 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from locore.s.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
#if 0
RCSID("$NetBSD: bcopy.S,v 1.2 2003/08/07 16:42:36 agc Exp $")
#endif
/*
* (ov)bcopy (src,dst,cnt)
* ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
*/
#ifdef MEMCOPY
ENTRY(memcpy)
#else
#ifdef MEMMOVE
ENTRY(memmove)
#else
ENTRY(bcopy)
#endif
#endif
#if defined(MEMCOPY) || defined(MEMMOVE)
movq %rdi,%rax /* return dst */
#else
xchgq %rdi,%rsi
#endif
movq %rdx,%rcx
movq %rdi,%r8
subq %rsi,%r8
cmpq %rcx,%r8 /* overlapping? */
jb 1f
cld /* nope, copy forwards. */
shrq $3,%rcx /* copy by words */
rep
movsq
movq %rdx,%rcx
andq $7,%rcx /* any bytes left? */
rep
movsb
ret
1:
addq %rcx,%rdi /* copy backwards. */
addq %rcx,%rsi
std
andq $7,%rcx /* any fractional bytes? */
decq %rdi
decq %rsi
rep
movsb
movq %rdx,%rcx /* copy remainder by words */
shrq $3,%rcx
subq $7,%rsi
subq $7,%rdi
rep
movsq
cld
ret
-43
View File
@@ -1,43 +0,0 @@
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
* Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
*/
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
#if 0
RCSID("$NetBSD: bzero.S,v 1.2 2003/07/26 19:24:38 salo Exp $")
#endif
ENTRY(bzero)
cld /* set fill direction forward */
xorq %rax,%rax /* set fill data to 0 */
/*
* if the string is too short, it's really not worth the overhead
* of aligning to word boundries, etc. So we jump to a plain
* unaligned set.
*/
cmpq $16,%rsi
jb L1
movq %rdi,%rcx /* compute misalignment */
negq %rcx
andq $7,%rcx
subq %rcx,%rsi
rep /* zero until word aligned */
stosb
movq %rsi,%rcx /* zero by words */
shrq $3,%rcx
andq $7,%rsi
rep
stosq
L1: movq %rsi,%rcx /* zero remainder by bytes */
rep
stosb
ret
-41
View File
@@ -1,41 +0,0 @@
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
* Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
*/
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
#if 0
RCSID("$NetBSD: memcmp.S,v 1.2 2003/07/26 19:24:39 salo Exp $")
#endif
ENTRY(memcmp)
cld /* set compare direction forward */
movq %rdx,%rcx /* compare by longs */
shrq $3,%rcx
repe
cmpsq
jne L5 /* do we match so far? */
movq %rdx,%rcx /* compare remainder by bytes */
andq $7,%rcx
repe
cmpsb
jne L6 /* do we match? */
xorl %eax,%eax /* we match, return zero */
ret
L5: movl $8,%ecx /* We know that one of the next */
subq %rcx,%rdi /* eight pairs of bytes do not */
subq %rcx,%rsi /* match. */
repe
cmpsb
L6: xorl %eax,%eax /* Perform unsigned comparison */
movb -1(%rdi),%al
xorl %edx,%edx
movb -1(%rsi),%dl
subl %edx,%eax
ret
-5
View File
@@ -1,5 +0,0 @@
/* $NetBSD: memcpy.S,v 1.1 2001/06/19 00:25:05 fvdl Exp $ */
/* $FreeBSD$ */
#define MEMCOPY
#include "bcopy.S"
-5
View File
@@ -1,5 +0,0 @@
/* $NetBSD: memmove.S,v 1.1 2001/06/19 00:25:05 fvdl Exp $ */
/* $FreeBSD$ */
#define MEMMOVE
#include "bcopy.S"
-60
View File
@@ -1,60 +0,0 @@
/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
* Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
*/
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
#if 0
RCSID("$NetBSD: memset.S,v 1.3 2004/02/26 20:50:06 drochner Exp $")
#endif
ENTRY(memset)
movq %rsi,%rax
andq $0xff,%rax
movq %rdx,%rcx
movq %rdi,%r11
cld /* set fill direction forward */
/*
* if the string is too short, it's really not worth the overhead
* of aligning to word boundries, etc. So we jump to a plain
* unaligned set.
*/
cmpq $0x0f,%rcx
jle L1
movb %al,%ah /* copy char to all bytes in word */
movl %eax,%edx
sall $16,%eax
orl %edx,%eax
movl %eax,%edx
salq $32,%rax
orq %rdx,%rax
movq %rdi,%rdx /* compute misalignment */
negq %rdx
andq $7,%rdx
movq %rcx,%r8
subq %rdx,%r8
movq %rdx,%rcx /* set until word aligned */
rep
stosb
movq %r8,%rcx
shrq $3,%rcx /* set by words */
rep
stosq
movq %r8,%rcx /* set remainder by bytes */
andq $7,%rcx
L1: rep
stosb
movq %r11,%rax
ret
+1 -1
View File
@@ -55,7 +55,7 @@ HIDENAME(cerror):
pushq %rax
call PIC_PLT(CNAME(__error))
popq %rcx
movq %rcx,(%rax)
movl %ecx,(%rax)
movq $-1,%rax
movq $-1,%rdx
ret
+1
View File
@@ -4,6 +4,7 @@
.if !defined(COMPAT_32BIT)
SRCS+= i386_clr_watch.c i386_get_ioperm.c i386_get_ldt.c i386_set_ioperm.c \
i386_set_ldt.c i386_set_watch.c i386_vm86.c
SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_set_fsbase.c i386_set_gsbase.c
.else
SRCS+= _amd64_get_fsbase.c _amd64_get_gsbase.c _amd64_set_fsbase.c _amd64_set_gsbase.c
.endif
+24 -2
View File
@@ -46,6 +46,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "namespace.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -53,10 +54,12 @@ __FBSDID("$FreeBSD$");
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <netdb.h>
#include <pthread.h>
#include <resolv.h>
#include <string.h>
#include <stddef.h>
#include <errno.h>
#include "un-namespace.h"
static const struct afd {
int a_af;
@@ -85,6 +88,19 @@ static int ip6_parsenumeric(const struct sockaddr *, const char *, char *,
static int ip6_sa2str(const struct sockaddr_in6 *, char *, size_t, int);
#endif
/*
* XXX: Many dependencies are not thread-safe. So, we share lock between
* getaddrinfo() and getipnodeby*(). Still, we cannot use
* getaddrinfo() and getipnodeby*() in conjunction with other
* functions which call them.
*/
#include "libc_private.h"
extern pthread_mutex_t __getaddrinfo_thread_lock;
#define THREAD_LOCK() \
if (__isthreaded) _pthread_mutex_lock(&__getaddrinfo_thread_lock);
#define THREAD_UNLOCK() \
if (__isthreaded) _pthread_mutex_unlock(&__getaddrinfo_thread_lock);
int
getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
const struct sockaddr *sa;
@@ -136,6 +152,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
* servlen == 0 means that the caller does not want the result.
*/
} else {
THREAD_LOCK();
if (flags & NI_NUMERICSERV)
sp = NULL;
else {
@@ -143,15 +160,20 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
(flags & NI_DGRAM) ? "udp" : "tcp");
}
if (sp) {
if (strlen(sp->s_name) + 1 > servlen)
if (strlen(sp->s_name) + 1 > servlen) {
THREAD_UNLOCK();
return EAI_MEMORY;
}
strlcpy(serv, sp->s_name, servlen);
} else {
snprintf(numserv, sizeof(numserv), "%u", ntohs(port));
if (strlen(numserv) + 1 > servlen)
if (strlen(numserv) + 1 > servlen) {
THREAD_UNLOCK();
return EAI_MEMORY;
}
strlcpy(serv, numserv, servlen);
}
THREAD_UNLOCK();
}
switch (sa->sa_family) {
-50
View File
@@ -1,50 +0,0 @@
/*-
* Copyright 2005 Colin Percival
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _SHA256_H_
#define _SHA256_H_
#include <sys/types.h>
typedef struct SHA256Context {
uint32_t state[8];
uint32_t count[2];
unsigned char buf[64];
} SHA256_CTX;
__BEGIN_DECLS
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX *, const unsigned char *, size_t);
void SHA256_Final(unsigned char [32], SHA256_CTX *);
char *SHA256_End(SHA256_CTX *, char *);
char *SHA256_File(const char *, char *);
char *SHA256_FileChunk(const char *, char *, off_t, off_t);
char *SHA256_Data(const unsigned char *, unsigned int, char *);
__END_DECLS
#endif /* !_SHA256_H_ */
-299
View File
@@ -1,299 +0,0 @@
/*-
* Copyright 2005 Colin Percival
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/endian.h>
#include <sys/types.h>
#include <string.h>
#include "sha256.h"
#if BYTE_ORDER == BIG_ENDIAN
/* Copy a vector of big-endian uint32_t into a vector of bytes */
#define be32enc_vect(dst, src, len) \
memcpy((void *)dst, (const void *)src, (size_t)len)
/* Copy a vector of bytes into a vector of big-endian uint32_t */
#define be32dec_vect(dst, src, len) \
memcpy((void *)dst, (const void *)src, (size_t)len)
#else /* BYTE_ORDER != BIG_ENDIAN */
/*
* Encode a length len/4 vector of (uint32_t) into a length len vector of
* (unsigned char) in big-endian form. Assumes len is a multiple of 4.
*/
static void
be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len)
{
size_t i;
for (i = 0; i < len / 4; i++)
be32enc(dst + i * 4, src[i]);
}
/*
* Decode a big-endian length len vector of (unsigned char) into a length
* len/4 vector of (uint32_t). Assumes len is a multiple of 4.
*/
static void
be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len)
{
size_t i;
for (i = 0; i < len / 4; i++)
dst[i] = be32dec(src + i * 4);
}
#endif /* BYTE_ORDER != BIG_ENDIAN */
/* Elementary functions used by SHA256 */
#define Ch(x, y, z) ((x & (y ^ z)) ^ z)
#define Maj(x, y, z) ((x & (y | z)) | (y & z))
#define SHR(x, n) (x >> n)
#define ROTR(x, n) ((x >> n) | (x << (32 - n)))
#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))
#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))
/* SHA256 round function */
#define RND(a, b, c, d, e, f, g, h, k) \
t0 = h + S1(e) + Ch(e, f, g) + k; \
t1 = S0(a) + Maj(a, b, c); \
d += t0; \
h = t0 + t1;
/* Adjusted round function for rotating state */
#define RNDr(S, W, i, k) \
RND(S[(64 - i) % 8], S[(65 - i) % 8], \
S[(66 - i) % 8], S[(67 - i) % 8], \
S[(68 - i) % 8], S[(69 - i) % 8], \
S[(70 - i) % 8], S[(71 - i) % 8], \
W[i] + k)
/*
* SHA256 block compression function. The 256-bit state is transformed via
* the 512-bit input block to produce a new state.
*/
static void
SHA256_Transform(uint32_t * state, const unsigned char block[64])
{
uint32_t W[64];
uint32_t S[8];
uint32_t t0, t1;
int i;
/* 1. Prepare message schedule W. */
be32dec_vect(W, block, 64);
for (i = 16; i < 64; i++)
W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16];
/* 2. Initialize working variables. */
memcpy(S, state, 32);
/* 3. Mix. */
RNDr(S, W, 0, 0x428a2f98);
RNDr(S, W, 1, 0x71374491);
RNDr(S, W, 2, 0xb5c0fbcf);
RNDr(S, W, 3, 0xe9b5dba5);
RNDr(S, W, 4, 0x3956c25b);
RNDr(S, W, 5, 0x59f111f1);
RNDr(S, W, 6, 0x923f82a4);
RNDr(S, W, 7, 0xab1c5ed5);
RNDr(S, W, 8, 0xd807aa98);
RNDr(S, W, 9, 0x12835b01);
RNDr(S, W, 10, 0x243185be);
RNDr(S, W, 11, 0x550c7dc3);
RNDr(S, W, 12, 0x72be5d74);
RNDr(S, W, 13, 0x80deb1fe);
RNDr(S, W, 14, 0x9bdc06a7);
RNDr(S, W, 15, 0xc19bf174);
RNDr(S, W, 16, 0xe49b69c1);
RNDr(S, W, 17, 0xefbe4786);
RNDr(S, W, 18, 0x0fc19dc6);
RNDr(S, W, 19, 0x240ca1cc);
RNDr(S, W, 20, 0x2de92c6f);
RNDr(S, W, 21, 0x4a7484aa);
RNDr(S, W, 22, 0x5cb0a9dc);
RNDr(S, W, 23, 0x76f988da);
RNDr(S, W, 24, 0x983e5152);
RNDr(S, W, 25, 0xa831c66d);
RNDr(S, W, 26, 0xb00327c8);
RNDr(S, W, 27, 0xbf597fc7);
RNDr(S, W, 28, 0xc6e00bf3);
RNDr(S, W, 29, 0xd5a79147);
RNDr(S, W, 30, 0x06ca6351);
RNDr(S, W, 31, 0x14292967);
RNDr(S, W, 32, 0x27b70a85);
RNDr(S, W, 33, 0x2e1b2138);
RNDr(S, W, 34, 0x4d2c6dfc);
RNDr(S, W, 35, 0x53380d13);
RNDr(S, W, 36, 0x650a7354);
RNDr(S, W, 37, 0x766a0abb);
RNDr(S, W, 38, 0x81c2c92e);
RNDr(S, W, 39, 0x92722c85);
RNDr(S, W, 40, 0xa2bfe8a1);
RNDr(S, W, 41, 0xa81a664b);
RNDr(S, W, 42, 0xc24b8b70);
RNDr(S, W, 43, 0xc76c51a3);
RNDr(S, W, 44, 0xd192e819);
RNDr(S, W, 45, 0xd6990624);
RNDr(S, W, 46, 0xf40e3585);
RNDr(S, W, 47, 0x106aa070);
RNDr(S, W, 48, 0x19a4c116);
RNDr(S, W, 49, 0x1e376c08);
RNDr(S, W, 50, 0x2748774c);
RNDr(S, W, 51, 0x34b0bcb5);
RNDr(S, W, 52, 0x391c0cb3);
RNDr(S, W, 53, 0x4ed8aa4a);
RNDr(S, W, 54, 0x5b9cca4f);
RNDr(S, W, 55, 0x682e6ff3);
RNDr(S, W, 56, 0x748f82ee);
RNDr(S, W, 57, 0x78a5636f);
RNDr(S, W, 58, 0x84c87814);
RNDr(S, W, 59, 0x8cc70208);
RNDr(S, W, 60, 0x90befffa);
RNDr(S, W, 61, 0xa4506ceb);
RNDr(S, W, 62, 0xbef9a3f7);
RNDr(S, W, 63, 0xc67178f2);
/* 4. Mix local working variables into global state */
for (i = 0; i < 8; i++)
state[i] += S[i];
}
static unsigned char PAD[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* Add padding and terminating bit-count. */
static void
SHA256_Pad(SHA256_CTX * ctx)
{
unsigned char len[8];
uint32_t r, plen;
/*
* Convert length to a vector of bytes -- we do this now rather
* than later because the length will change after we pad.
*/
be32enc_vect(len, ctx->count, 8);
/* Add 1--64 bytes so that the resulting length is 56 mod 64 */
r = (ctx->count[1] >> 3) & 0x3f;
plen = (r < 56) ? (56 - r) : (120 - r);
SHA256_Update(ctx, PAD, (size_t)plen);
/* Add the terminating bit-count */
SHA256_Update(ctx, len, 8);
}
/* SHA-256 initialization. Begins a SHA-256 operation. */
void
SHA256_Init(SHA256_CTX * ctx)
{
/* Zero bits processed so far */
ctx->count[0] = ctx->count[1] = 0;
/* Magic initialization constants */
ctx->state[0] = 0x6A09E667;
ctx->state[1] = 0xBB67AE85;
ctx->state[2] = 0x3C6EF372;
ctx->state[3] = 0xA54FF53A;
ctx->state[4] = 0x510E527F;
ctx->state[5] = 0x9B05688C;
ctx->state[6] = 0x1F83D9AB;
ctx->state[7] = 0x5BE0CD19;
}
/* Add bytes into the hash */
void
SHA256_Update(SHA256_CTX * ctx, const unsigned char *src, size_t len)
{
uint32_t bitlen[2];
uint32_t r;
/* Number of bytes left in the buffer from previous updates */
r = (ctx->count[1] >> 3) & 0x3f;
/* Convert the length into a number of bits */
bitlen[1] = ((uint32_t)len) << 3;
bitlen[0] = (uint32_t)(len >> 29);
/* Update number of bits */
if ((ctx->count[1] += bitlen[1]) < bitlen[1])
ctx->count[0]++;
ctx->count[0] += bitlen[0];
/* Handle the case where we don't need to perform any transforms */
if (len < 64 - r) {
memcpy(&ctx->buf[r], src, len);
return;
}
/* Finish the current block */
memcpy(&ctx->buf[r], src, 64 - r);
SHA256_Transform(ctx->state, ctx->buf);
src += 64 - r;
len -= 64 - r;
/* Perform complete blocks */
while (len >= 64) {
SHA256_Transform(ctx->state, src);
src += 64;
len -= 64;
}
/* Copy left over data into buffer */
memcpy(ctx->buf, src, len);
}
/*
* SHA-256 finalization. Pads the input data, exports the hash value,
* and clears the context state.
*/
void
SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx)
{
/* Add padding */
SHA256_Pad(ctx);
/* Write the hash */
be32enc_vect(digest, ctx->state, 32);
/* Clear the context state */
memset((void *)ctx, 0, sizeof(*ctx));
}
+1 -1
View File
@@ -64,7 +64,7 @@ The buffer pointed to by
.Fa buffer
must be at least
.Fa len
bytes long.
bytes bytes long.
.Pp
If the formatted number (including
.Fa suffix )
+9 -3
View File
@@ -26,8 +26,8 @@ BASE = 5.4
BUILDNAME?=${BASE}-${DATE}-SNAP
#
#CHROOTDIR=/junk/release
# If this is a -stable snapshot, then set
#RELEASETAG=RELENG_5
# If this is a security/errata branch snapshot, then set
#RELEASETAG=RELENG_5_4
#
# To test a release with a source tree containing patches and
# other work. This tree will get copied instead of getting the
@@ -155,7 +155,7 @@ RELEASEDISTFILES?= ${.CURDIR}/../../ports/distfiles
AUTO_KEYBOARD_DETECT?= 0
.if !defined(NODOC)
DIST_DOCS_ARCH_INDEP= readme errata
DIST_DOCS_ARCH_INDEP= readme errata early-adopter
DIST_DOCS_ARCH_DEP= installation relnotes hardware
.endif
@@ -730,6 +730,8 @@ release.8:
done
@mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT \
${RD}/mfsfd/stand/help/INSTALL.TXT
@mv ${RD}/mfsfd/stand/help/EARLY-ADOPTER.TXT \
${RD}/mfsfd/stand/help/MIGRATE5.TXT
.endif
-test -f ${.CURDIR}/install.cfg \
&& cp ${.CURDIR}/install.cfg ${RD}/mfsfd
@@ -873,6 +875,8 @@ ftp.1:
@cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
@mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
@mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
@mv ${FD}/EARLY-ADOPTER.TXT ${FD}/MIGRATE5.TXT
@mv ${FD}/EARLY-ADOPTER.HTM ${FD}/MIGRATE5.HTM
.endif
@echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
touch ${.TARGET}
@@ -935,6 +939,8 @@ cdrom.2:
@cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
@mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
@mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
@mv ${CD_DISC1}/EARLY-ADOPTER.TXT ${CD_DISC1}/MIGRATE5.TXT
@mv ${CD_DISC1}/EARLY-ADOPTER.HTM ${CD_DISC1}/MIGRATE5.HTM
.endif
@echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
.if defined(SEPARATE_LIVEFS)
+1
View File
@@ -7,6 +7,7 @@ SUBDIR+= hardware
SUBDIR+= readme
SUBDIR+= errata
SUBDIR+= installation
SUBDIR+= early-adopter
COMPAT_SYMLINK = en
@@ -0,0 +1,18 @@
# $FreeBSD$
RELN_ROOT?= ${.CURDIR}/../..
.ifdef NO_LANGCODE_IN_DESTDIR
DESTDIR?= ${DOCDIR}/early-adopter
.else
DESTDIR?= ${DOCDIR}/en_US.ISO8859-1/early-adopter
.endif
DOC?= article
FORMATS?= html
INSTALL_COMPRESSED?=gz
INSTALL_ONLY_COMPRESSED?=
SRCS+= article.sgml
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
@@ -0,0 +1,922 @@
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
<!ENTITY % articles.ent PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Articles Entity Set//EN">
%articles.ent;
<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN">
%release;
<!ENTITY release.4x "4.<replaceable>X</replaceable>">
<!ENTITY release.5x "5.<replaceable>X</replaceable>">
<!ENTITY release.4last "4.11-RELEASE">
<!ENTITY release.5branchpoint "5.3-RELEASE">
]>
<article>
<articleinfo>
<title>&os; &release.current; Migration Guide</title>
<authorgroup>
<corpauthor>The &os; Release Engineering Team</corpauthor>
</authorgroup>
<pubdate>$FreeBSD$</pubdate>
<copyright>
<year>2002</year>
<year>2003</year>
<year>2004</year>
<year>2005</year>
<holder role="mailto:[email protected]">The &os; Release
Engineering Team</holder>
</copyright>
<legalnotice id="trademarks" role="trademarks">
&tm-attrib.freebsd;
&tm-attrib.apple;
&tm-attrib.ibm;
&tm-attrib.ieee;
&tm-attrib.intel;
&tm-attrib.microsoft;
&tm-attrib.sparc;
&tm-attrib.general;
</legalnotice>
<abstract>
<para>This article describes major differences between &os;
&release.4x; and &os; &release.current;, from the
viewpoint of a user or administrator upgrading an existing
system. It provides a brief overview of &os; release
engineering. It then describes some of the new features in
&os; &release.5x;, as well as some changes that might be of
particular interest to users accustomed to working with the
&release.4x; series of releases. This article also describes
binary- and source-based upgrading procedures for existing
systems. Earlier versions of this article appeared in prior
&os; &release.5x; releases. Prior to &os; &release.5branchpoint;,
this article was known as the <quote>Early Adopters
Guide</quote>.</para>
</abstract>
</articleinfo>
<sect1 id="intro">
<title>Introduction</title>
<para>&os; &release.current; is the latest version of &os; in the
<quote>&os.stable;</quote> series of releases. This and future
releases in the &release.5x; series are targeted
toward production usage in much the same way as the prior
&release.4x; series of releases.</para>
<para>This article addresses a number of topics and issues
of interest to users updating from a &release.4x; release to
&release.current;. It begins with a brief overview of
current release engineering practices and then describes some of
the new features available with the &os; &release.5x; series.
Perhaps the most important section lists issues
where major changes have taken place, user-visible behavior has
changed, or external software interfaces have been modified.
Last are some notes on upgrading existing &os; &release.4x;
systems to &os; &release.current;, from binaries or
from source.</para>
</sect1>
<sect1 id="release-overview">
<title>An Overview of the &os; Release Process</title>
<para>&os; employs a development model relying on multiple
branches within the source code repository. The main branch is called
<quote>CURRENT</quote>, and is referred to in the CVS repository
with the <literal>HEAD</literal> tag. New features are
committed first to this branch; although CURRENT
is the first to see new functionality, it also
occasionally suffers from breakages as new features are
added and debugged.</para>
<para>Most &os; releases are made from one of several
<quote>STABLE</quote> branches. Features are added to
these branches only after some amount of testing in CURRENT. For the
past two years,
the only STABLE branch under active development
was known as <quote>4-STABLE</quote>, and all of the
&os; &release.4x; releases were based on
it. This branch has the tag <literal>RELENG_4</literal> in the
CVS repository.</para>
<para>The past two stable branches (3-STABLE and 4-STABLE) were
created very early in their development cycles
(their branchpoints were 3.1 and 4.0, respectively). In hindsight, this
practice did not give sufficient time for either CURRENT
to stabilize before the new branches were
created. This in turn resulted in wasted effort porting bug
fixes between branches, as well as creating some architectural changes
that could not be ported between branches at all.</para>
<para>The &release.5x; releases have been handled slightly
differently.
&os; 5.0, 5.1, and 5.2 were based on the CURRENT branch. The
first of these releases was made after over two years of development
(prior to these, the
last release from HEAD was &os; 4.0, in March 2000).</para>
<para>Unlike prior <quote>STABLE</quote> branches, the
<quote>5-STABLE</quote> branch in CVS (with the branch tag
<literal>RELENG_5</literal>) was created
more than a year after the first &release.5x; release
(specifically, during the 5.3 release cycle). This delay gave
time for the development team to complete needed architectural
changes, stabilize the system, finalize various interfaces, and
create a good starting point for the remaining
&release.5x; releases.</para>
<para>Aside from general improvements and bug fixes, a major
priority for development on the 5-STABLE branch is
the preservation of Application Binary Interface (ABI) and
Application Program Interface (API) compatibility. Any changes that
could break backward compatibility (including kernel or library
interfaces) are strongly discouraged, and will not be permitted
except as a last-resort solution to a critical problem.</para>
<para>The next release from CURRENT will likely be 6.0-RELEASE,
created from CVS <literal>HEAD</literal>. There is no firm date for 6.0,
as of this writing, although it is
expected sometime in the third quarter of 2005. Future release
engineering plans call for new major releases approximately
every eighteen months, with minor releases approximately every
four months.</para>
<para>The last planned release along the 4-STABLE development
branch was &release.4last;, which was announced in January 2005.
No new major features are planned for the 4-STABLE branch at
this time, and any future work will likely be limited to bug
fixes and security patches. For especially
conservative users, it may be reasonable to continue using the
&release.4x; releases for a time. The
&a.security-officer; will continue to support releases made from
the 4-STABLE branch in accordance with their published policies,
which can be found on the <ulink
url="&url.base;/security/index.html">Security page</ulink> on
the &os; web site.</para>
<para>More information on &os; release engineering processes can be found
on the <ulink
url="&url.base;/releng/index.html">Release
Engineering Web pages</ulink> and in the <ulink
url="&url.articles.releng;/index.html"><quote>&os; Release
Engineering</quote></ulink> article.</para>
</sect1>
<sect1 id="new">
<title>New Features</title>
<para>A major attraction of &os; &release.5x; is a number of new
features, generally involving
large architectural changes that were not feasible to port back to
the &os; 4-STABLE development branch. (By contrast, many
self-contained enhancements, such as new device drivers or
updates to
userland utilities, have already been ported.) A brief, but not
exhaustive list includes:</para>
<itemizedlist>
<listitem>
<para>SMPng: The <quote>next generation</quote> support for
Symmetric MultiProcessor (SMP) machines.
Ongoing work aims to perform fine-grained locking of various
kernel subsystems to increase the number of threads of
execution that can be running in the kernel. Particular
attention has been paid to the performance of the network
stack and storage drivers. More
information can be found on the
<ulink url="&url.base;/smp/index.html">FreeBSD SMP
Project</ulink> page.</para>
</listitem>
<listitem>
<para>KSE: Kernel Scheduled Entities allow a single process
to have multiple kernel-level threads, similar to Scheduler
Activations. The <filename>libpthread</filename>
and <filename>libthr</filename> threading libraries make this
feature available to multi-threaded userland programs,
using the &man.pthread.3; API.
<filename>libpthread</filename> is now the default threading
library.</para>
</listitem>
<listitem>
<para>New architectures: Support for the amd64, ia64, pc98, and sparc64
architectures, in addition to the i386 and
alpha. Other platforms under development include powerpc
(which runs on many &powerpc;-based &macintosh; platforms) and arm.</para>
</listitem>
<listitem>
<para>GCC: The compiler toolchain is now based on GCC
3.4.<replaceable>X</replaceable>, rather than GCC
2.95.<replaceable>X</replaceable>.</para>
</listitem>
<listitem>
<para>MAC: Support for extensible, loadable Mandatory Access
Control policies.</para>
</listitem>
<listitem>
<para>GEOM: A flexible, modular framework for transformation of disk
I/O requests. This system supports a number of features
related to disks and volumes, such as: recognition of disk
partitions, the &man.gbde.4; disk encryption facility,
various levels of RAID functionality, network export of disk
devices (with &man.ggated.8 and related utilities), and
transparent disk decompression. The geom_vinum system
brings GEOM compatibility to the VINUM volume manager.</para>
</listitem>
<listitem>
<para>FFS: The FFS file system now supports background
&man.fsck.8; operations (for faster crash recovery) and
file system snapshots.</para>
</listitem>
<listitem>
<para>UFS2: A new UFS2 on-disk format has been added, which
supports extended per-file attributes and larger file
sizes. UFS2 is now the default format for &man.newfs.8;.
On all platforms except pc98, file systems created from
within &man.sysinstall.8; will use UFS2 by default.</para>
</listitem>
<listitem>
<para>New networking features: A number of new networking
features have made their debut in &release.5x; releases,
including support for TCP SACK (selective acknowledgements),
the &man.pf.4; packet filter from OpenBSD, and the
ALTQ packet queueing system.
</listitem>
<listitem>
<para>New hardware support: Support for more hardware devices,
such as Cardbus, Bluetooth devices, and IEEE 802.11a/b/g
network interfaces based on Atheros chipsets. Also,
on the i386 architecture, some network devices not
explicitly supported by &os; drivers may be supported using
vendor drivers for &microsoft; &windows; and the
&man.ndis.4; compatibility layer.</para> </listitem>
</itemizedlist>
<para>A more comprehensive list of new features can be found in
the release notes for the various &os; &release.5x; releases.</para>
</sect1>
<sect1 id="drawbacks">
<title>Notable Changes</title>
<para>Some of the differences between &os; &release.4x; and
&release.5x; deserve special mention because they involve
major architectural changes, or break backwards compatibility in
some way. While these changes are unlikely to cause a loss of
data, they could cause some confusion for the unwary. Some
notable examples are:</para>
<itemizedlist>
<!-- General stuff -->
<listitem>
<para>Several parts of &os;'s base system functionality have
been moved to the &os; Ports Collection, usually because
they are easier to maintain in that form or because they
were not really essential parts of the system.
The most noticeable example of this is
<application>Perl</application> (available in the &os; Ports
Collection as <filename
role="package">lang/perl5.8</filename>), whose former
location in the base system made upgrades problematic.
Utilities in the base system that formerly relied on
<application>Perl</application> have been either rewritten
(if still applicable) or removed (if obsolete).<para>
<para>Other examples include <application>UUCP</application>
(available in the Ports Collection as <filename
role="package">net/freebsd-uucp</filename>), the <command>doscmd</command>
utility (<filename
role="package">emulators/doscmd</filename>), and many of the
traditional games (<filename
role="package">games/freebsd-games</filename>).</para>
</listitem>
<!-- Kernel ABI changes -->
<listitem>
<para>Changes in kernel data structures and ABIs/APIs meant
many third-party binary device drivers had to be modified before they would
work correctly under &os; &release.5x;.
In
some (hopefully rare) cases, user-visible data structures
have changed, requiring recompilation of applications or
reinstallation of ports/packages. As with the
&release.4x; series, the &os; development team has
the goal of not allowing incompatible changes in future
releases on the &release.5x; branch.</para>
</listitem>
<listitem>
<para>A shortage of users and maintainers for some parts of
the base system has caused them
to fall into disrepair.
These have been removed. Examples include the
generation of <filename>a.out</filename>-style executables,
<footnote>
<para>Note that execution of <filename>a.out</filename>
executables on the i386 and pc98 is still supported
with the <literal>COMPAT_AOUT</literal> kernel
option. Some of the compilers in the Ports Collection
(for example,
<filename role="package">lang/gcc28</filename>) are
still capable of generating <filename>a.out</filename>
format executables.</para>
</footnote>
XNS networking
support, and the X-10 controller driver. A number of other
drivers for old ISA-based devices have been discovered to be
non-working and have been removed. More details are given
in the release notes.</para>
</listitem>
<listitem>
<para>On &os;/i386
&release.4x;, the configuration of ISA devices was initially
specified in the kernel configuration. These could be
modified at boot-time with an interactive
<application>UserConfig</application> utility. On &os;
&release.5x;, both of these mechanisms have been replaced by
the &man.device.hints.5; mechanism, which eliminates the
need to hard-code ISA configuration parameters in the
kernel. Boot-time ISA configuration is no longer
menu-driven, but is performed by entering new parameters to
the boot loader command line prompt.</para>
</listitem>
<listitem>
<para><filename>MAKEDEV</filename> is no longer available, nor
is it required. &os; &release.5x; uses a device
file system, which automatically creates device nodes on
demand. Configuration of the entries in the device
filesystem can be performed with the &man.devfs.8; utility
or with the <filename>/etc/devfs.conf</filename>
mechanism.
More information can be found in the &man.devfs.5;
manual page.</para>
</listitem>
<listitem>
<para>UFS2 is the default on-disk format for file systems
created using &man.newfs.8;. For all platforms except pc98,
it is also the default for file systems created using the
disk labeling screen within &man.sysinstall.8;. Because
&os; &release.4x; only understands UFS1 (not UFS2), disk
partitions that must be accessed by both &release.5x; and
&release.4x; must be created with UFS1. This can be
specified using the <option>-O1</option> option to
&man.newfs.8;, or on the disk labeling screen in
&man.sysinstall.8;. This situation most often arises with a
a single machine that dual-boots &os; &release.4x; and &os;
&release.5x;. Note that there is no way to convert file
systems between the two on-disk formats (other than backing
up, re-creating the file system, and restoring).</para>
</listitem>
<!-- Userland -->
<listitem>
<para>Due to the upgraded <application>GCC</application>
compiler, C++ programs generally need to be recompiled and
reinstalled. This requirement comes from changes in the C++
ABI.</para>
</listitem>
<listitem>
<para>Running executables compiled for &os; &release.4x; may
be possible with the aid of the
<filename>compat4x</filename> distribution (or the
equivalent <filename role="package">misc/compat4x</filename>
package/port). However, if any of the ports or packages on
a system require upgrading, rebuilding and reinstalling
<emphasis>all</emphasis> of the installed ports on a system
is generally advised. This will prevent problems that can
occur with programs being linked against some combination of
old and new libraries. The
<filename role="package">sysutils/portupgrade</filename>
utility may be helpful in reinstalling ports.</para>
<para>Note that in any case, there are a number of known instances of backward
incompatibility. For example, the <filename
role="package">devel/gnomevfs2</filename>, <filename
role="package">mail/postfix</filename>, and <filename
role="package">security/cfs</filename> ports need to be
recompiled due to changes in the <literal>statfs</literal>
structure.</para>
</listitem>
<listitem>
<para>The <filename>host.conf</filename> resolver services
configuration file has been replaced by the (much more
general) &man.nsswitch.conf.5; name-service switch
configuration mechanism.</para>
</listitem>
<listitem>
<para><application>BIND</application> has been updated from
version 8 to version 9. There are numerous differences
between BIND 8 and 9. Users with critical &man.named.8;
installations should read the migration documentation in
<filename>/usr/share/doc/bind9/misc/migration</filename>.
There is also a new instruction manual in
<filename>/usr/share/doc/bind9/arm</filename>. On systems
that run &man.named.8;, it now runs by default in a
&man.chroot.8; environment in
<filename>/var/named</filename>. Users with existing
&man.named.8; configurations in
<filename>/var/named</filename> should back up the contents
of this directory before upgrading to avoid them being
overwritten by the &man.named.8; startup script.</para>
</listitem>
<!-- Ports -->
<listitem>
<para>The <application>&xorg;</application> implementation of
the X Window System is the default for &os; &release.5x;
beginning with 5.3-RELEASE. As of this writing,
<application>&xfree86;</application> remains the default for
&os; &release.4x;. More information on the differences
between these versions, as well as upgrade
information for existing systems, can be found in the <ulink
url="&url.books.handbook;/x11.html">X Window System</ulink>
chapter in the &os; Handbook.</para>
</listitem>
<!-- Documentation -->
<listitem>
<para>Documentation (such as the &os; <ulink
url="&url.books.handbook;/index.html">Handbook</ulink>
and <ulink
url="&url.books.faq;/index.html">FAQ</ulink>)
is still being updated to reflect changes recently made to &os; &release.5x;.</para>
</listitem>
</itemizedlist>
<para>More information can be found in the release notes for the
various &os; &release.5x; releases, as well as the
<filename>src/UPDATING</filename> file in the &os; source
tree. Notable changes to the &os; Ports Collection are listed
in the <filename>ports/UPDATING</filename> and
<filename>ports/CHANGES</filename> files in the ports tree.</para>
</sect1>
<sect1 id="upgrade">
<title>Notes on Upgrading from &os; &release.4x;</title>
<para>For those users with existing &os; systems, this section
offers a few notes on upgrading a &os;
&release.4x; system to
&release.5x;. As with any &os; upgrade, it
is crucial to read the release notes and the errata for the
version in question, as well as
<filename>src/UPDATING</filename> in the case of source upgrades.</para>
<sect2>
<title>Binary Upgrades</title>
<para>Probably the most straightforward approach is that of
<quote>backup everything, reformat, reinstall, and restore
user data</quote>. This eliminates problems of incompatible
or obsolete executables and configuration files polluting the
new system. It allows new file systems to be created to take
advantage of new functionality (most notably, the UFS2
defaults).</para>
<para>As of this writing, the binary upgrade option in
&man.sysinstall.8; has not been well-tested for
cross-major-version upgrades. Use of this feature is not
recommended.</para>
<para>Several changes may be of interest to those users
accustomed to the &os; &release.4x; boot media.
Installation floppies (on platforms that support them,
such as i386), are organized somewhat differently than
on prior releases. On &release.4x; releases, the floppy set
contained a stripped-down kernel with just
enough functionality to install the system. This arrangement
allowed the kernel to fit on a single floppy
disk, but it lacked the device drivers required by
certain hardware configurations. Beginning with &os;
5.3-RELEASE, the installation floppies contain a standard
<literal>GENERIC</literal> kernel segmented across multiple
disks, with a much more complete set of drivers
and features. The boot loader prompts for the insertion of
additional disks as required. Users downloading floppy images
(perhaps to perform a network-based installation) should
note that the floppy disk set now includes three
disks: <filename>boot.flp</filename>,
<filename>kern1.flp</filename>, and
<filename>kern2.flp</filename>.</para>
<para>The installation CDROMs for the i386 architecture now use
a <quote>no-emulation</quote> boot loader. This allows, among
other things, the use of a <literal>GENERIC</literal> kernel,
rather than the stripped-down kernels used on the floppy
images in previous versions.
Generally, any system capable of booting the &microsoft;
&windowsnt;&nbsp;4, &windows2k;, or &windowsxp; installation
CDROMs should be able to boot the &os; &release.5x; CDROMs.</para>
<para>The layout of CDROMs has changed from the &release.4x;
series. Beginning with 5.4-RELEASE, the installation image
and the <quote>live filesystem</quote> are now contained on
the first disk on all architectures except for ia64 (ia64
releases use separate installation and live filesystem disks
due to disk space constraints). Common packages are now
contained on the second and succeeding disks of a release.</para>
</sect2>
<sect2>
<title>Source Upgrades</title>
<note>
<para>Many users and developers have found it easier
to backup all their data and configuration files (a wise
precaution in any case), perform a binary installation
(such as from CDROM), and restore their data. Compared to a
source upgrade, the binary upgrade removes the need to deal
with leftover files and programs on the disk, and allows the
system to take advantage of new file system features such as the
UFS2 file system layout.</para>
<para>Users unfamiliar with the
<literal>buildworld</literal>/<literal>installworld</literal> procedures for
updating &os; from source should <emphasis>not</emphasis>
attempt a source upgrade, but should instead perform a binary
installation after backing up all data.</para>
</note>
<para>A source-based upgrade procedure builds and
installs a set of binaries compiled from source on the
local machine. It is based on the
<literal>buildworld</literal>/<literal>installworld</literal>
procedure often used by advanced &os; users to track changes
along a development branch (such as &os.stable; or
&os.current;). In general, this procedure involves more
effort than the binary upgrade procedure,
but may be useful when a system's
configuration files are complex or have been highly
customized. A source upgrade can also be useful for
a remote system where an administrator has remote
console access but no physical access (and therefore cannot
insert installation media).</para>
<para>Reading <filename>src/UPDATING</filename> is absolutely
essential. The section entitled <quote>To upgrade in-place from
4.x-stable to current</quote> contains a step-by-step update
procedure, which must be followed exactly, without
making use of the <quote>shortcuts</quote> that some users
occasionally employ. An annotated list of these steps is
presented below:</para>
<orderedlist>
<listitem>
<para>Make backups.</para>
<para>The importance of this step cannot be overstated. It
is important to make backups of all user data and
configuration files. Level zero dumps with &man.dump.8;
are an excellent way to do this, although there are of
course many workable alternatives.</para>
</listitem>
<listitem>
<para>Ensure that there is about 30MB of free disk space on
the <filename>/</filename> file system.</para>
<para>&os; &release.5x; uses more space than &os;
&release.4x;. If the <filename>/tmp</filename> directory
resides on the <filename>/</filename> file system (as is
frequently the case), deleting all of the content from
this directory may help to free up needed space.</para>
</listitem>
<listitem>
<para>Fix <filename>/etc/fstab</filename> if required.</para>
<para>This item probably only affects older &os;/i386 systems.
On systems that use MBR-style disk slices,
&os; used to support <quote>compatibility
slices</quote>, where disk partition names could take the
form <filename>/dev/ad0a</filename> (without specifying a
slice name explicitly). These are no longer supported;
disk partitions must be named according to the form
<filename>/dev/ad0s1a</filename>. In other words, disk
partitions must now completely specify a disk device, a
slice number, and a partition letter.</para>
<para>Note that <quote>compatibility slices</quote> have
generally not been used by default since &os;
2.2.6-RELEASE. This item does not apply to &os;/alpha at
all, or to systems using <quote>dangerously dediated</quote>
mode.</para>
</listitem>
<listitem>
<para>Using &man.cvs.1; or other means,
obtain a copy of the &os; base system sources (the
<filename>src/</filename> module). To check out 5.4-RELEASE
from the &os; CVS repository, use the
<literal>RELENG_5_4_0_RELEASE</literal> tag. For the 5.4
release and errata branch, use the
<literal>RELENG_5_4</literal> tag. To track the &os;
5-STABLE development branch, use the <literal>RELENG_5</literal> branch tag.
When using CVS to
check out the source tree, it is important to pass the
<option>-P</option> flag to CVS so that it prunes away
empty directories.</para>
</listitem>
<listitem>
<para>&os; &release.5x; requires some new entries in
the system password and group files,
corresponding to various system services. They should be
installed by running:</para>
<screen>&prompt.root; <userinput>mergemaster -p</userinput></screen>
<para>This step must be performed to give some new files
the correct usernames and groupnames.</para>
<para>Note that in &os; &release.5x;, the location of the
&man.nologin.8; utility has moved from
<filename>/sbin/nologin</filename> to
<filename>/usr/sbin/nologin</filename>. Because a number
of pseudo-users have &man.nologin.8; as their login shell,
this change generates additional differences in
<filename>/etc/passwd</filename>.</para>
</listitem>
<listitem>
<para>Build the new userland using:</para>
<screen>&prompt.root; <userinput>cd /usr/src</userinput>
&prompt.root; <userinput>make buildworld</userinput></screen>
<para>If <varname>CPUTYPE</varname> is defined in
<filename>/etc/make.conf</filename>, it should be defined
using the <literal>?=</literal> operator, so the
<literal>buildworld</literal> process can override this
variable if necessary.</para>
<para>Note that the <varname>MAKEOBJDIRPREFIX</varname> must
<emphasis>not</emphasis> be defined in
<filename>/etc/make.conf</filename>.</para>
<para>In general, most of the build <quote>knobs</quote>
defined in <filename>/etc/make.conf</filename> should be
commented out or removed. This statement especially
applies to those that directly affect the build or basic
operation of &os;, such as
<varname>NO_TOOLCHAIN</varname>.</para>
</listitem>
<listitem>
<para>Build and install a new kernel using:</para>
<screen>&prompt.root; <userinput>make buildkernel</userinput></screen>
<para>Note that the <literal>buildkernel</literal>
&man.make.1; target must be used in order to ensure that
the resulting kernel is compiled with the toolchain built
in the <literal>buildworld</literal> step above. Manually
using &man.config.8; to set up a kernel build area and
attempting to build a kernel will not work.</para>
<para>Although building (and later installing) a custom
kernel at this point is feasible, upgrading using the
<literal>GENERIC</literal> kernel and installing a
custom kernel configuration later may be less
error-prone. When trying to build a custom kernel for
the first time, using the <literal>GENERIC</literal>
kernel from &os; &release.5x; as a template is highly
recommended, due to the number of device and options that
have been added or changed since &release.4x;. In any
case, including the <literal>COMPAT_FREEBSD4</literal>
kernel configuration option is crucial for a
successful upgrade.</para>
</listitem>
<listitem>
<para>Set up a device hints file for ISA devices with a
variant of the following command. Substitute the appropriate
architecture name (e.g. <literal>i386</literal>) for
<replaceable>MACHINE</replaceable>.</para>
<screen>&prompt.root; <userinput>cp sys/<replaceable>MACHINE</replaceable>/conf/GENERIC.hints /boot/device.hints</userinput></screen>
<para>While an empty device hint file may be sufficient for
modern hardware, ISA hints are needed for systems with
custom ISA non-PNP cards (with custom hints being needed),
for non-PNPBIOS systems, or for floppy disks to work
correctly on PNPBIOS systems.</para>
</listitem>
<listitem>
<para>Install the new kernel with:</para>
<screen>&prompt.root; <userinput>make installkernel</userinput></screen>
<para>Note that while the &os; &release.4x; kernel installs
to <filename>/kernel</filename> by default, the &os;
&release.5x; kernel installs to
<filename>/boot/kernel/kernel</filename>. Kernel modules
under &release.4x; normally install to the
<filename>/modules</filename> directory, whereas under
&release.5x; they install to
<filename>/boot/kernel</filename>.</para>
</listitem>
<listitem>
<para>Install the &os; &release.5x; boot loader with:</para>
<screen>&prompt.root; <userinput>cd /usr/src/sys/boot</userinput>
&prompt.root; <userinput>make STRIP="" install</userinput></screen>
<para>This step, though optional, is highly recommended.</para>
</listitem>
<listitem>
<para>Disable third-party
modules (such as those for VMware) to prevent crashes
caused by changes in kernel ABIs or other
incompatibilities.</para>
</listitem>
<listitem>
<para>Reboot to single-user mode. Rebooting at this point
is absolutely required because the new kernel must be running
to install the new userland. Being in
single-user mode will drastically decrease the potential
for unexpected things to happen during the upgrade because
there will be no other programs running.</para>
</listitem>
<listitem>
<para>Mount the required file systems using:</para>
<screen>&prompt.root; <userinput>fsck -p</userinput>
&prompt.root; <userinput>mount -uw /</userinput>
&prompt.root; <userinput>mount -at ufs</userinput></screen>
<para>Note that the &man.fsck.8; invocation is necessary to
update certain fields in the file system superblocks for
&os; &release.5x;.
If the system clock tracks local time rather than UTC
time, also perform:</para>
<screen>&prompt.root; <userinput>adjkerntz -i</userinput></screen>
<para>During this step, the following warning message may
appear on the console (numerous times).</para>
<screen>WARNING: userland calling deprecated sysctl, please rebuild world</screen>
<para>This message can be safely ignored.</para>
</listitem>
<listitem>
<para>Delete the C++ header files with:</para>
<screen>&prompt.root; <userinput>rm -rf /usr/include/g++</userinput></screen>
<para>This step keeps future compilations from
accidentally picking up old header files from the
<application>GCC</application> 2.95 C++ compiler.</para>
</listitem>
<listitem>
<para>Install the new userland utilities with:</para>
<screen>&prompt.root; <userinput>cd /usr/src</userinput>
&prompt.root; <userinput>make installworld</userinput></screen>
</listitem>
<listitem>
<para>On systems running &man.named.8;, its
configuration files need to be moved into a
&man.chroot.8; area in
<filename>/var/named</filename>. If any files exist in
<filename>/var/named</filename>, they should be backed up
at this point.</para>
<screen>&prompt.root; <userinput>cd /etc</userinput>
&prompt.root; <userinput>mv named named.bak</userinput>
&prompt.root; <userinput>mkdir -p /var/named/etc/namedb</userinput>
&prompt.root; <userinput>cp -Rp named.bak/* /var/named/etc/namedb</userinput></screen>
<para>If the configuration uses the generated
<filename>localhost</filename> files, the following steps
may be needed to regenerate them:</para>
<screen>&prompt.root; <userinput>cd /var/named/etc/namedb</userinput>
&prompt.root; <userinput>/bin/sh make-localhost</userinput>
&prompt.root; <userinput>rm -f localhost-v6.rev localhost.rev</userinput></screen>
<para>Finally, two obsolete binaries from the prior
<application>BIND</application> need to be removed:</para>
<screen>&prompt.root; <userinput>rm /usr/sbin/nslookup</userinput>
&prompt.root; <userinput>rm /usr/sbin/nsupdate</userinput></screen>
<listitem>
<para>Update the system configuration files by running:</para>
<screen>&prompt.root; <userinput>mergemaster -i</userinput></screen>
<para>This step is non-optional. It is required to
make the startup and configuration files in
<filename>/etc</filename> consistent with the new kernel
and world.</para>
<para>After invoking &man.mergemaster.8;, it is a good idea
to inspect (and possibly modify)
<filename>/etc/rc.conf</filename>. A number of default
values for the variables defined in this file have
changed; in particular, some services that were enabled by
default in &release.4x; are now disabled by default in
&release.5x;.</para>
</listitem>
<listitem>
<para>Remove leftover <application>BIND 8</application>
files:</para>
<screen>&prompt.root; <userinput>rm /usr/bin/dnskeygen /usr/bin/dnsquery</userinput>
&prompt.root; <userinput>rm /usr/libexec/named-xfer</userinput>
&prompt.root; <userinput>rm /usr/sbin/named.restart /usr/sbin/ndc</userinput></screen>
</listitem>
<listitem>
<para>Reboot.</para>
</listitem>
</orderedlist>
<para>After upgrading the base system,
upgrades to some non-base-system components are generally
needed to restore normal functionality. <application>Perl</application> is no longer a part
of the base system and should be installed from the Ports
Collection (specifically, the <filename
role="package">lang/perl5.8</filename> port) or from a
package. After this installation, all ports and/or packages
depending on <application>Perl</application> need to be
reinstalled.</para>
<para>Running &os; &release.4x; binaries requires a set of
compatability libraries. These are available
by installing the <filename
role="package">misc/compat4x</filename> package/port.</para>
<para>As mentioned in a prior section,
<application>&xorg;</application> is the default
implementation of the X Window System. The Ports Collection
(as well as packages) rely on this change to satisfy dependencies.
To convert the installed windowing
system from <application>&xfree86;</application> to
<application>&xorg;</application>, refer to the <ulink
url="&url.books.handbook;/x-install.html">Installing
X11</ulink> section in the &os; Handbook.</para>
</sect2>
</sect1>
<sect1 id="summary">
<title>Summary</title>
<para>This article presents some of the more notable new features
in &os; &release.5x;, and lists some areas of particular
concern to those users upgrading existing &os; &release.4x;
systems. It also presents two sets of upgrade instructions,
one using binaries from installation media and one based on
recompiling the base system from source code.</para>
</sect1>
</article>
+176 -7
View File
@@ -13,11 +13,11 @@
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
<!ENTITY % articles.ent PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Articles Entity Set//EN">
%articles.ent;
<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN">
%release;
<!ENTITY release.bugfix "5.4-RELEASE">
<!ENTITY release.bugfix.next "5.5-RELEASE">
<!ENTITY release.bugfix "5.3-RELEASE">
<!ENTITY release.bugfix.next "5.4-RELEASE">
]>
<article>
@@ -36,8 +36,7 @@
<year>2002</year>
<year>2003</year>
<year>2004</year>
<year>2005</year>
<holder role="mailto:[email protected]">The &os; Documentation Project</holder>
<holder role="mailto:[email protected]">The FreeBSD Documentation Project</holder>
</copyright>
<legalnotice id="trademarks" role="trademarks">
@@ -94,13 +93,183 @@
<sect1 id="security">
<title>Security Advisories</title>
<para>No advisories.</para>
<para>(1 Dec 2004) A bug in &man.procfs.5; and &man.linprocfs.5;
which could cause a malicious local user could perform a local
denial of service attack by causing a system panic, or the user
could read parts of kernel memory, has been fixed.
For more information, see security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:17.procfs.asc">FreeBSD-SA-04:17</ulink>.</para>
<para>(18 Nov 2004) A bug in the &man.fetch.1; utility which allows
a malicious HTTP server to cause arbitrary portions of the client's
memory to be overwritten, has been fixed.
For more information, see security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:16.fetch.asc">FreeBSD-SA-04:16</ulink>.</para>
</sect1>
<sect1 id="open-issues">
<title>Open Issues</title>
<para>No issues.</para>
<para>(31 Oct 2004) The &man.re.4; and &man.em.4;
drivers may behave poorly under heavy load. In particular, there are
reports of &man.em.4; on the IBM ThinkPad T40 locking up
under such conditions.</para>
<para>(31 Oct 2004) There are reports of the &man.sk.4; driver
locking up under heavy load, especially when ASUStek on-board NICs
are used. To clear the condition,
bringing the interface down then back up and/or rebooting
the system may be needed.</para>
<para>(31 Oct 2004) The &man.burncd.8; utility is functional but may behave erratically
on some systems. Reported symptoms include that &man.burncd.8;
can appear to hang and never complete while the operation actually
does complete, and the progress indicator does not show the correct value.
Workarounds include:</para>
<itemizedlist>
<listitem>
<para>Eject and re-insert the media after burning a CD.</para>
</listitem>
<listitem>
<para>Press Ctrl-C when &man.burncd.8; appears to hang up
while the access LED goes inactive.</para>
</listitem>
</itemizedlist>
<para>(31 Oct 2004) When the user/group rule clauses in &man.pf.4; and &man.ipfw.4;
are used, the loader tunable <varname>debug.mpsafenet</varname>
must be set to <literal>0</literal> (this is <literal>1</literal> by
default). For example, the following rules are affected:</para>
<para>for &man.ipfw.4;:</para>
<programlisting>count ip from any to 192.168.2.1 uid root</programlisting>
<para>for &man.pf.4;:</para>
<programlisting>block log quick proto { tcp, udp } all user root</programlisting>
<para>To set <varname>debug.mpsafenet</varname> to <literal>0</literal>
on every boot, add the following line into
<filename>/boot/loader.conf</filename>:</para>
<programlisting>debug.mpsafenet=0</programlisting>
<para>More specifically, the <literal>group</literal> and <literal>user</literal>
filter parameters in &man.pf.4;, and the <literal>gid</literal>,
<literal>jail</literal>, and <literal>uid</literal> rule options
in &man.ipfw.4; are affected.
If <varname>debug.mpsafenet</varname> is set to <literal>1</literal>,
the system can hang when the rule is evaluated due to a lock order
reversal with the socket layer. More details can be found in the
&man.ipfw.8; and &man.pf.conf.5; manual pages.</para>
<para>(31 Oct 2004, updated on 12 Nov 2004) The &man.vinum.4; subsystem
works on 5.3, but it can cause a system panic at boot time.
As a workaround you can add <literal>vinum_load="YES"</literal>
to <filename>/boot/loader.conf</filename>.</para>
<para>As an alternative you can also use the new &man.geom.4;-based
&man.vinum.4; subsystem. To activate the &man.geom.4;-aware
vinum at boot time, add <literal>geom_vinum_load="YES"</literal>
to <filename>/boot/loader.conf</filename> and remove
<literal>start_vinum="YES"</literal> in
<filename>/etc/rc.conf</filename> if it exists.</para>
<para>While some uncommon configurations, such as
multiple vinum drives on a disk, are not supported,
it is generally backward compatible.
Note that for the &man.geom.4;-aware vinum, its new userland
control program, <command>gvinum</command>, should be used,
and it is not yet feature-complete.</para>
<para>(31 Oct 2004) The results of <command>netstat -m</command>
can become incorrect on SMP systems when <varname>debug.mpsafenet</varname>
is set to <literal>1</literal> (default). This is an error
in the statistics gathering because of a race condition in the
counters, not an actual memory leak.</para>
<para>(31 Oct 2004, updated on 5 Nov 2004)
For &os;/i386 and &os;/amd64, when installing &os; 5.3
using an USB keyboard the keyboard will stop
working once the kernel boots, because a PS/2 keyboard is
always considered to be attached. As a workaround, select
<quote>Escape to loader prompt</quote> in the boot loader menu
and enter the following lines at the prompt:</para>
<screen>set hint.atkbd.0.flags="0x1"
boot</screen>
<para>Note that if you use the boot floppies, this is set
by default.</para>
<para>After the installation, add the following line to
<filename>/boot/loader.conf</filename>:</para>
<programlisting>hint.atkbd.0.flags="0x1"</programlisting>
<para>(1 Nov 2004) The ULE scheduler described in the release notes
has been completely disabled to discourage its use because it has
stability problems.</para>
<para>(1 Nov 2004) Programs linked with <application>libpthread</application>
may not report any CPU usage statistics according to &man.top.1;,
while those linked with <application>libthr</application> show
the correct statistics.</para>
<para>(1 Nov 2004) ATA RAID support for the CMD649 and SiI0680 ATA
controllers is non-functional in this release. When such a
controller is brough up under &man.ata.4; (ataraid) on 5.3, the
RAID configuration stored under 5.2 or prior may be corrupted.</para>
<para>(3 Nov 2004) For &os;/i386 and &os;/amd64, SMP support
in the <filename>GENERIC</filename> kernel has been disabled
by default because the SMP kernel can degrade the performance
on UP machines. A kernel configuration file <filename>SMP</filename>,
which can be used to enable SMP support, has been added.
More details on building the custom kernel can be found at
<ulink url="&url.books.handbook;/kernelconfig.html"></ulink>.</para>
<para>(4 Nov 2004) The &man.tar.1; utility (also known as &man.bsdtar.1;)
does not detect the end of media such as tape and
floppy disk properly when it is specified with the <option>-f</option>
option. As an alternative &man.gtar.1; (<application>GNU tar</application>)
can be used.</para>
<para>(9 Nov 2004) The &man.geom.4;-aware &man.vinum.4; subsystem
does not work for RAID5 volumes on machines with a single processor.
The configurations other than RAID5 (such as RAID1) should work correctly.
This problem has been fixed on the RELENG_5 branch.</para>
<para>(9 Nov 2004) The &os; 5.3-RELEASE Migration Guide should have stated
that <filename>/usr/sbin/nslookup</filename> and
<filename>/usr/sbin/nsupdate</filename> included in
<application>BIND 8</application> have to be removed during
the source-based upgrade procedure.</para>
<para>(9 Nov 2004) The &os; 5.3-RELEASE Release Notes should have stated
that <filename role="package">net/mpd</filename> which was compiled
on the old systems prior to 5.3-RELEASE must be recompiled.</para>
<para>(10 Nov 2004) The &os; 5.3-RELEASE Release Notes should have stated
explicitly that ports/packages which were built on the old systems
prior to 5.3-RELEASE and linked with the old POSIX thread libraries
(<application>libc_r</application> or <application>libkse</application>)
can cause an error <quote>Spinlock called when not threaded.</quote>
at run time. This happens when the program is linked with multiple
different threading libraries (typically the older ports will be linked with
<application>libc_r</application>, while newer ports will be linked with
<application>libpthread</application>).
Either recompile the ports/packages or add the necessary lines to
<filename>/etc/libmap.conf</filename>.
More details can be found in <filename>/usr/src/UPDATING</filename>
(20040303 and 20040130).</para>
<para>(12 Nov 2004) The &man.em.4; driver behaves incorrectly when
the VLAN support and promiscuous mode are enabled at the same time.
A fix is being tested and will be merged to the 5.3 errata branch.</para>
</sect1>
<sect1 id="late-news">
@@ -102,18 +102,86 @@
<sect2 id="security">
<title>Security Advisories</title>
<para></para>
<para>A bug in the &man.fetch.1; utility, which allows
a malicious HTTP server to cause arbitrary portions of the client's
memory to be overwritten, has been fixed.
For more information, see security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:16.fetch.asc">FreeBSD-SA-04:16.fetch</ulink>.
</para>
<para>A bug in &man.procfs.5; and &man.linprocfs.5;
which could allow a malicious local user to read parts of kernel
memory or perform a local
denial of service attack by causing a system panic,
has been fixed.
For more information, see security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:17.procfs.asc">FreeBSD-SA-04:17.procfs</ulink>.
</para>
<para>Two buffer overflows in the TELNET client program have been
corrected. They could have allowed a malicious TELNET server or
an active network attacker to cause &man.telnet.1; to execute
arbitrary code with the privileges of the user running it.
More information can be found in security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:01.telnet.asc">FreeBSD-SA-05:01.telnet</ulink>.
</para>
<para>A information disclosure vulnerability in the
&man.sendfile.2; system call, which could permit it to transmit
random parts of kernel memory, has been fixed. More details are
in security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:02.sendfile.asc">FreeBSD-SA-05:02.sendfile</ulink>.
</para>
<para arch="amd64">A possible privilege escalation vulnerability on &os;/amd64
has been fixed. This allows unprivileged users to gain direct
access to some hardware which cannot be accessed
without the elevated privilege level. More details are in security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:03.amd64.asc">FreeBSD-SA-05:03.amd64</ulink>.</para>
<para>An information leak vulnerability in the
<literal>SIOCGIFCONF</literal> &man.ioctl.2;, which leaked 12
bytes of kernel memory, has been fixed. More details are in security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:04.ifconf.asc">FreeBSD-SA-05:04.ifconf</ulink>.</para>
<para>Several programming errors in &man.cvs.1;, which could
potentially cause arbitrary code to be executed on CVS servers,
have been corrected. Further information can be found in
security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:05.cvs.asc">FreeBSD-SA-05:05.cvs</ulink>.</para>
</sect2>
<sect2 id="kernel">
<title>Kernel Changes</title>
<para></para>
<para>The &man.jail.8; feature now supports a new sysctl
<varname>security.jail.chflags_allowed</varname>, which controls the
behavior of &man.chflags.1; within a jail.
If set to <literal>0</literal> (the default), then a jailed <username>root</username> user is
treated as an unprivileged user; if set to <literal>1</literal>, then
a jailed root user is treated the same as an unjailed <username>root</username> user.</para>
<para arch="alpha,amd64,i386">The loader tunable <varname>debug.mpsafevm</varname>
has been enabled by default.</para>
<!-- Above this line, sort kernel changes by manpage/keyword-->
<para></para>
<para>A number of bugs have been fixed in the ULE
scheduler.</para>
<para arch="i386">A bug in Inter-Processor Interrupt (IPI)
handling, which could cause SMP systems to crash under heavy
load, has been fixed. More details are contained in errata note
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ERRATA/notices/FreeBSD-EN-05:03.ipi.asc">FreeBSD-EN-05:03.ipi</ulink>.
</para>
<para arch="i386">Memory allocation for legacy PCI bridges has
been limited to the top 32MB of RAM. Many older, legacy bridges
only allow allocation from this range. This change only applies
to devices which don't have their memory assigned by the BIOS.
This change fixes the <quote>bad Vcc</quote> error of CardBus
bridges (&man.pccbb.4;).</para>
<sect3 id="boot">
<title>Boot Loader Changes</title>
@@ -124,19 +192,83 @@
<sect3 id="proc">
<title>Hardware Support</title>
<para></para>
<para arch="sparc64">The &man.auxio.4; driver has been to drive
some auxiliary I/O functions found on various SBus/EBus
&ultrasparc; models.</para>
<para>A framework for flexible processor speed control has been
added. It provides methods for various drivers to control CPU
power utilization by adjusting the processor speed. More
details can be found in the &man.cpufreq.4; manual page.</para>
<para>The pcii driver has been added to support GPIB-PCIIA IEEE-488
cards.</para>
<para arch="sparc64">The rtc driver has been added to support
the MC146818-compatible clock found on some &ultrasparc; II
and III models.</para>
<para arch="sparc64">The &man.uart.4; driver is now enabled in
the <filename>GENERIC</filename> kernel, and is now the
default driver for serial ports. The ofw_console,
&man.sab.4;, and zs drivers are now disabled in the
<filename>GENERIC</filename> kernel.</para>
<sect4 id="mm">
<title>Multimedia Support</title>
<para></para>
<para arch="sparc64">The &man.snd.audiocs.4; driver has been
added to support the Crystal Semiconductor CS4231 audio
controller found on &ultrasparc; workstations.</para>
</sect4>
<sect4 id="net-if">
<title>Network Interface Support</title>
<para></para>
<para>The &man.cdce.4; USB Communication Device Class Ethernet
driver has been added.</para>
<para>The &man.cp.4; driver is now MPSAFE.</para>
<para>The &man.ctau.4; driver is now MPSAFE.</para>
<para>The &man.cx.4; driver is now MPSAFE.</para>
<para>The &man.ed.4; driver now supports the &man.altq.4;
framework.</para>
<para>In the &man.em.4; driver, hardware support for VLAN
tagging is now disabled by default due to some interactions
between this feature and promiscuous mode.</para>
<para>Ethernet flow control is now disabled by default in the
&man.fxp.4; driver, to prevent problems with a system panics
or is left in the kernel debugger.</para>
<para>The &man.hme.4; driver is now MPSAFE.</para>
<para arch="amd64">The &man.ndis.4; device driver wrapper now
supports &windows;/x86-64 binaries on amd64
systems.</para>
<para>The &man.re.4; driver now supports the &man.altq.4;
framework.</para>
<para>The &man.sf.4; driver now has support for device polling
and &man.altq.4;.</para>
<para>Several programming errors in the &man.sk.4; driver have
been corrected. These bugs were particular to SMP systems, and
could cause panics, page faults, aborted SSH connections, or
corrupted file transfers. More details can be found in
errata note
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ERRATA/notices/FreeBSD-EN-05:02.sk.asc">FreeBSD-EN-05:02.sk</ulink>.
</para>
<para>The &man.sk.4; driver now has support for &man.altq.4;.
This driver also now supports jumbo frames on Yukon-based
interfaces.</para>
</sect4>
</sect3>
@@ -144,28 +276,124 @@
<sect3 id="net-proto">
<title>Network Protocols</title>
<para></para>
<para>The MTU feedback in IPv6 has been disabled when the sender writes
data that must be fragmented.</para>
<para>The Common Address Redundancy Protocol (CARP) has
been implemented. CARP comes from OpenBSD and allows
multiple hosts to share an IP address, providing
high availability and load balancing.
For more information, see the &man.carp.4; manual page.</para>
<para>The &man.ipfw.4; system can work with
<varname>debug.mpsafenet</varname>=<literal>1</literal>
(this tunable is <literal>1</literal> by default)
when the <literal>gid</literal>, <literal>jail</literal>,
and/or <literal>uid</literal> rule options are used.</para>
<para>The &man.ipfw.8; <literal>ipfw fwd</literal> rule now supports
the full packet destination manipulation when the kernel option
<literal>options IPFIREWALL_FORWARD_EXTENDED</literal> is specified
in addition to <literal>options IPFIREWALL_FORWARD</literal>.
This kernel option disables all restrictions to ensure proper
behavior for locally generated packets and allows redirection of
packets destined to locally configured IP addresses.
Note that &man.ipfw.8; rules have to be carefully crafted to
make sure that things like PMTU discovery do not break.</para>
<para>&man.ipnat.8; now allows redirect rules to
work for non-TCP/UDP packets.</para>
<para>Ongoing work is reducing the use of the Giant lock by the
network protocol stack and improving the locking
strategies.</para>
<para>A new &man.ng.netflow.4; NetGraph node allows a router
running &os; to do NetFlow version 5 exports.</para>
<para>The &man.sppp.4; driver now includes Frame Relay
support.</para>
<para>A bug in TCP that sometimes caused RST packets to
be ignored if the receive window was zero bytes has been
fixed.</para>
<para>Several bugs in the TCP SACK implementation have been
fixed.</para>
<para>The KAME IPv4 IPsec implementation integrated
in &os; now supports TCP-MD5.</para>
<para>Random ephemeral port number allocation has led to some
problems with port reuse at high connection rates. This
feature is now disabled during periods of high connection
rates; whenever new connections are created faster than
<varname>net.inet.ip.portrange.randomcps</varname> per second,
port number randomization is disabled for the next
<varname>net.inet.ip.portrange.randomtime</varname>
seconds. The default values for these two sysctl variables
are <literal>10</literal> and <literal>45</literal>,
respectively.</para>
</sect3>
<sect3 id="disks">
<title>Disks and Storage</title>
<para></para>
<para>The &man.amr.4; driver is now safe for use on systems
using &man.pae.4;.</para>
<para arch="i386,ia64">The &man.arcmsr.4; driver has been added.
It supports the Areca ARC-11<replaceable>xx</replaceable> and
ARC-12<replaceable>xx</replaceable> series of SATA RAID
controllers.</para>
<para>The &man.hptmv.4; driver, which supports the HighPoint
RocketRAID 182x series, has been added.</para>
<para>The &man.ips.4; driver now support kernel crash dumps
on some modern ServeRAID models.</para>
<para>The &man.matcd.4; driver has been removed.</para>
<para>The SHSEC GEOM class has been added. It provides for the
sharing of a secret between multiple GEOM providers. All of
these providers must be present in order to reveal the
secret. This feature is controlled by the &man.gshsec.8;
utility.</para>
<para>Information about newly-mounted cd9660 file systems (such
as the presence of RockRidge extensions) is now only printed
if the kernel was booted in verbose mode. This change was
made to reduce the amount of (generally unnecessary) kernel
log messages.</para>
</sect3>
<sect3 id="fs">
<title>File Systems</title>
<para></para>
<para>Recomputing the summary information for
<quote>dirty</quote> UFS and UFS2 file systems is no longer
done at mount time, but is now done by background
&man.fsck.8;. This change improves the startup speed when
mounting large file systems after a crash. The prior behavior
can be restored by setting the
<varname>vfs.ffs.compute_summary_at_mount</varname> sysctl
variable to a non-zero value.</para>
<para>A kernel panic in the NFS server has been fixed. More
details can be found in errata note
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ERRATA/notices/FreeBSD-EN-05:01.nfs.asc">FreeBSD-EN-05:01.nfs</ulink>.
</para>
</sect3>
<sect3>
<title>Contributed Software</title>
<para></para>
<para><application>ACPI-CA</application> has been updated from
20040527 to 20041119.</para>
</sect3>
</sect2>
@@ -173,12 +401,191 @@
<sect2 id="userland">
<title>Userland Changes</title>
<para></para>
<para>The &man.ftpd.8; program now uses the <literal>212</literal>
and <literal>213</literal> status codes for directory
and file status correctly (<literal>211</literal> was used in
the previous versions). This behavior is described in RFC 959.
</para>
<para>The &man.getaddrinfo.3; function now queries <literal>A</literal>
DNS resource records before <literal>AAAA</literal> records
when <literal>AF_UNSPEC</literal> is specified.
Some broken DNS servers return <literal>NXDOMAIN</literal>
against non-existent <literal>AAAA</literal> queries,
even when it should return <literal>NOERROR</literal>
with empty return records. This is a problem for an IPv4/IPv6 dual
stack node because the <literal>NXDOMAIN</literal> returned
by the first query of an <literal>AAAA</literal> record makes
the querying server stop attempting to resolve the <literal>A</literal>
record if any. Also, this behavior has been recognized as a potential
denial-of-service attack (see <ulink url="http://www.kb.cert.org/vuls/id/714121"></ulink>
for more details).
Note that although the query order has been changed,
the returned result still includes
<literal>AF_INET6</literal> records before
<literal>AF_INET</literal> records.</para>
<para>The <literal>create</literal> command of the &man.gpt.8;
utility now supports a <option>-f</option> command-line flag to
force creation of a GPT even when there is an MBR record on a
disk.</para>
<para>The gvinum(8) utility now supports
<command>checkparity</command>,
<command>rebuildparity</command>, and
<command>setstate</command>
subcommands.</para>
<para>The <filename>libarchive</filename> library (as well as the
&man.tar.1; command that uses it) now has support for reading ISO
images (with optional RockRidge extensions) and ZIP archives
(with <literal>deflate</literal> and <literal>none</literal>
compression).</para>
<para>The <filename>libgpib</filename> library has been added to
give userland access to GPIB devices (using the the pcii driver)
via the
<function>ib<replaceable>foo</replaceable></function>
API.</para>
<para>A number of bugfixes for <filename>libpthread</filename>
have been merged from HEAD.</para>
<para>A number of new functions have been implemented in the
&man.math.3; library. These include &man.ceill.3;,
&man.floorl.3;, &man.ilogbl.3;, &man.fma.3; and variants,
&man.lrint.3; and variants, and &man.lround.3; and
variants.</para>
<para arch="i386">The &man.mkuzip.8; utility, which
compresses file system images for use with
<literal>GEOM_UZIP</literal> &man.geom.4; module,
has been added. &merged;</para>
<para>The &man.moused.8; daemon now supports <quote>virtual
scrolling</quote>, in which mouse motions made while holding
down the middle mouse button are interpreted as scrolling. This
feature is enabled with the <option>-V</option>
flag.</para>
<para>A separate directory has been added for &man.named.8;
dynamic zones which is owned by the <username>bind</username> user
(for creation of the zone journal file).
For more detail, see an example dynamic zone in the sample
&man.named.conf.5;.</para>
<para>The &man.newfs.8; utility now supports a <option>-n</option>
flag to suppress the creation of a <filename>.snap</filename>
directory on new file systems. This feature is intended for use
on memory or vnode file systems that will not require snapshot
support.</para>
<para>The &man.newfs.8; utility now emits a warning when creating
a UFS or UFS2 file system that cannot support snapshots. This
situation can occur in the case of very large file systems with
small block sizes.</para>
<para>The <literal>NO_NIS</literal> compile-time knob for userland
has been added. As its name implies, enabling this
<filename>Makefile</filename> variable will cause NIS support to
be excluded from various programs and will cause the NIS
utilities to not be built.</para>
<para>The &man.ncal.1; utility now supports a <option>-m</option>
flag to generate a calendar for a specified month in the current
year.</para>
<para>The &man.periodic.8; security output now supports the display of
information about blocked packet counts from &man.pf.4;.</para>
<para>The &man.ppp.8; program now implements an
<option>echo</option> parameter, which allows LCP ECHOs to be
enabled independently of LQR reports. Older versions of
&man.ppp.8; would revert to LCP ECHO mode on negotiation
failure. It is now necessary to specify <command>enable
echo</command> to get this behavior.</para>
<para>Two bugs in the &man.pppd.8; program have been fixed.
They may result in an incorrect CBCP response,
which violates the Microsoft PPP Callback Control Protocol
section 3.2.</para>
<para>The &man.restore.8; utility has regained the ability to read
&os; version 1 dump tapes.</para>
<para>The &man.rm.1; utility now supports an <option>-I</option>
option that asks for confirmation (once) if recursively
removing directories or if more than 3 files are listed in the
command line.</para>
<para>The &man.rtld.1; dynamic linker now supports specifying
library replacements via the <varname>LD_LIBMAP</varname>
environment variable. This variable will override the entries
in &man.libmap.conf.5;.</para>
<para>The &man.strftime.3; function now supports some GNU extensions
such as <literal>-</literal> (no padding),
<literal>_</literal> (use space as padding),
and <literal>0</literal> (zero padding).</para>
<para>The &man.syslog.3; function is now thread-safe.</para>
<para>The &man.syslogd.8; utility now opens an additional domain
socket (<filename>/var/run/logpriv</filename> by default),
with <literal>0600</literal> permissions to be used
by privileged programs. This prevents privileged
programs from locking when the domain sockets
run out of buffer space due to a
local denial-of-service attack.</para>
<para>The &man.syslogd.8; now supports <option>-S</option> option
which allows to change the pathname of the privileged
socket. This is useful when you do not want the daemon
to receive any messages from the local sockets
(<filename>/var/run/log</filename> and
<filename>/var/run/logpriv</filename> are used by default).</para>
<para>The &man.syslogd.8; utility now allows
<literal>:</literal> and <literal>%</literal>
characters in the hostname specifications.
These characters are used in IPv6 addresses and scope IDs.</para>
<para>The &man.systat.1; <option>-netstat</option> display is now
IPv6-aware.<para>
<para>The <option>-f</option> option of &man.tail.1; utility
now supports more than one file at a time.</para>
<para>The &man.tcpdrop.8; command, which closes a selected TCP
connection, has been added. It was obtained from
OpenBSD.</para>
<para>&man.whois.1; now supports
a <option>-k</option> flag
for querying <hostid role="fqdn">whois.krnic.net</hostid>
(the National Internet Development Agency of Korea),
which holds details of IP address allocations within
Korea.</para>
<para>A bug, which caused the last line of configuration files such as &man.hosts.5;,
&man.services.5;, and so on to be ignored if it did not end in a newline character,
has been fixed.</para>
<sect3 id="rc-scripts">
<title><filename>/etc/rc.d</filename> Scripts</title>
<para></para>
<para>&man.rc.conf.5; now supports changes of network interface names
at boot time. For example:</para>
<programlisting>ifconfig_fxp0_name="net0"
ifconfig_net0="inet 10.0.0.1/16"</programlisting>
<para>&man.rc.conf.5; now supports the <varname>tmpmfs_flags</varname>
and <varname>varmfs_flags</varname> variables.
These can be used to pass extra options to the &man.mdmfs.8; utility,
to customize the finer details of the &man.md.4; file system creation,
such as to turn on/off softupdates, to specify a default owner
for the file system, and so on.</para>
</sect3>
</sect2>
@@ -186,27 +593,138 @@
<sect2 id="contrib">
<title>Contributed Software</title>
<para><application>BIND</application> has been updated from version
9.3.0 to version 9.3.1.</para>
<para><application>Heimdal</application> has been updated from
0.6.1 to 0.6.3.</para>
<para>A snapshot of <application>netcat</application> from OpenBSD
as of 4 February 2005 has been added. More information can be
found in the &man.nc.1; manual page.</para>
<para><application>OpenSSL</application> has been updated from
0.9.7d to 0.9.7e.</para>
<para><application>sendmail</application> has been updated from
version 8.13.1 to version 8.13.3.</para>
<para>The timezone database has been updated from
<application>tzdata2004e</application> to
<application>tzdata2004g</application>.</para>
<para></para>
</sect2>
<sect2 id="ports">
<title>Ports/Packages Collection Infrastructure</title>
<para></para>
<para>The
<filename>ports/INDEX<replaceable>*</replaceable></filename>
files, which kept an index of all of the entries in the ports
collection, have been removed from the CVS repository.
These files were generated only infrequently, and therefore were
usually out-of-date and inaccurate. Users requiring an index
file (such as for use by programs such as &man.portupgrade.1;)
have two alternatives for obtaining a copy:</para>
<itemizedlist>
<listitem>
<para>Build an index file based on the current ports tree by
running <command>make index</command> from the top of the
<filename>ports/</filename> tree.</para>
</listitem>
<listitem>
<para>Fetch an index file over the network by running
<command>make fetchindex</command> from the top of the
<filename>ports/</filename> tree. This index file will
(typically) be accurate to within a day.</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="releng">
<title>Release Engineering and Integration</title>
<para></para>
<para>In prior &os; releases, the <filename>disc1</filename>
CD-ROM (or ISO image) was a bootable installation disk
containing the base system, ports tree, and common packages.
The <filename>disc2</filename> CD-ROM (or ISO image) was a
bootable <quote>fix it</quote> disk with a live filesystem, to
be used for making emergency repairs. This layout has now
changed. For all architectures except ia64, the
<filename>disc1</filename> image now contains the base system
distribution files, ports tree, and the live filesystem, making
it suitable for both an initial installation and repair
purposes. (On the ia64, the live filesystem is on a separate
disk due to its size.) Packages appear on separate
disks; in particular, the <filename>disc2</filename> image
contains commonly packages such as desktop environments.
Documents from the &os; Documentation Project also appear on
<filename>disc2</filename>.</para>
<para>The supported version of the
<application>GNOME</application> desktop environment has been
updated from 2.6.2 to 2.10. More information about
running <application>GNOME</application> on &os; can be found on
the <ulink url="&url.base;/gnome/">FreeBSD GNOME Project</ulink>
Web page.
<note>
<para>Users of older versions of the
<application>GNOME</application> desktop
(<filename role="package">x11/gnome2</filename>)
must take particular care in upgrading. Simply upgrading it
from the &os; Ports Collection with &man.portupgrade.1;
(<filename role="package">sysutils/portupgrade</filename>)
will cause serious problems.
<application>GNOME</application> desktop users should read
the instructions carefully at
<ulink url="&url.base;/gnome/docs/faq210.html"></ulink>
and use the
<ulink url="&url.base;/gnome/gnome_upgrade.sh"><filename>gnome_upgrade.sh</filename></ulink>
script to properly upgrade to
<application>GNOME</application> 2.10.</para>
</note>
</para>
<para>The supported version of the <application>KDE</application>
desktop environment has been updated from 3.3.0 to
3.4.0. More information regarding running
<application>KDE</application> on &os; can be found on the
<ulink url="http://freebsd.kde.org/">KDE on FreeBSD</ulink> Web
page.
<note>
<para>Users of older versions of
<application>KDE</application> should follow the upgrading
procedure documented on the
<ulink url="http://freebsd.kde.org/">KDE on FreeBSD</ulink> Web
page or in <filename>ports/UPDATING</filename>.</para>
</note>
</para>
<para>The supported version of <application>Xorg</application> has
been updated from 6.7.0 to 6.8.2.</para>
</sect2>
<sect2 id="doc">
<title>Documentation</title>
<para></para>
<para>The following manual pages, which were derived from RFCs
and possibly violate the IETF's copyrights, have been replaced:
&man.gai.strerror.3;,
&man.getaddrinfo.3;,
&man.getnameinfo.3;,
&man.inet6.opt.init.3;,
&man.inet6.option.space.3;,
&man.inet6.rth.space.3;,
&man.inet6.rthdr.space.3;,
&man.icmp6.4;, and
&man.ip6.4;.</para>
</sect2>
</sect1>
@@ -214,51 +732,15 @@
<sect1 id="upgrade">
<title>Upgrading from previous releases of &os;</title>
<para>If you're upgrading from a previous release of &os;, you
generally will have three options:
<itemizedlist>
<listitem>
<para>Using the binary upgrade option of &man.sysinstall.8;.
This option is perhaps the quickest, although it presumes
that your installation of &os; uses no special compilation
options.</para>
</listitem>
<listitem>
<para>Performing a complete reinstall of &os;. Technically,
this is not an upgrading method, and in any case is usually less
convenient than a binary upgrade, in that it requires you to
manually backup and restore the contents of
<filename>/etc</filename>. However, it may be useful in
cases where you want (or need) to change the partitioning of
your disks.</para>
</listitem>
<listitem>
<para>From source code in <filename>/usr/src</filename>. This
route is more flexible, but requires more disk space, time,
and technical expertise. More information can be found
in the <ulink url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html"
><quote>Using <command>make world</command></quote></ulink>
section of the <ulink url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/"
>FreeBSD Handbook</ulink>. Upgrading from very old
versions of &os; may be problematic; in cases like this, it
is usually more effective to perform a binary upgrade or a
complete reinstall.</para>
</listitem>
</itemizedlist>
</para>
<para>Please read the <filename>INSTALL.TXT</filename> file for more
information, preferably <emphasis>before</emphasis> beginning an
upgrade. If you are upgrading from source, please be sure to read
<filename>/usr/src/UPDATING</filename> as well.</para>
<para>Finally, if you want to use one of various means to track the
-STABLE or -CURRENT branches of &os;, please be sure to consult
the <ulink url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html"
><quote>-CURRENT vs. -STABLE</quote></ulink> section of the
<ulink url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/"
>FreeBSD Handbook</ulink>.</para>
<para>Users with existing &os; systems are
<emphasis>highly</emphasis> encouraged to read the <quote>&os;
&release.current; Migration Guide</quote>. This document generally has
the filename <filename>MIGRATE5.TXT</filename> on the distribution
media, or any other place that the release notes can be found. It
offers some notes on migrating from &os; 4.X, but more importantly, also
discusses some of the relative merits of upgrading to &os;
5.<replaceable>X</replaceable> versus running &os;
4.<replaceable>X</replaceable>.</para>
<important>
<para>Upgrading &os; should, of course, only be attempted after
@@ -35,17 +35,6 @@
(list (list "HREF" "mailto:[email protected]"))
(literal "[email protected]"))
(literal ">.")))
(make element gi: "p"
attributes: (list (list "align" "center"))
(make element gi: "small"
(literal "All users of FreeBSD ")
(literal (entity-text "release.branch"))
(literal " should subscribe to the ")
(literal "<")
(create-link (list (list "HREF" "mailto:[email protected]"))
(literal "[email protected]"))
(literal "> mailing list.")))
(make element gi: "p"
attributes: (list (list "align" "center"))
(make element gi: "small"
@@ -2,9 +2,9 @@
The FreeBSD Russian Documentation Project
$FreeBSD$
$FreeBSDru: frdp/release/doc/ru_RU.KOI8-R/hardware/common/dev.sgml,v 1.15 2005/03/10 13:52:33 den Exp $
$FreeBSDru$
Original revision: 1.227.2.25
Original revision: 1.227.2.26.2.2
-->
<!--
@@ -166,6 +166,8 @@
×ÓÌÅÄÓÔ×ÉÅ ÏÇÒÁÎÉÞÅÎÉÊ SRM.</para>
</note>
&hwlist.arcmsr;
&hwlist.mlx;
<note>
@@ -750,16 +752,7 @@
&hwlist.snd.cmi;
<para arch="i386,amd64">Crystal Semiconductor (ÄÒÁÊ×ÅÒ &man.csa.4;)
<itemizedlist>
<listitem>
<para>CS461x/462x Audio Accelerator</para>
</listitem>
<listitem>
<para>CS428x Audio Controller</para>
</listitem>
</itemizedlist>
</para>
&hwlist.snd.csa;
&hwlist.snd.es137x;
@@ -769,18 +762,11 @@
&hwlist.snd.maestro3;
<para arch="i386,amd64">ForteMedia fm801</para>
&hwlist.snd.als4000;
<para arch="i386,amd64">Gravis (ÄÒÁÊ×ÅÒ &man.gusc.4;)
<itemizedlist>
<listitem>
<para>UltraSound MAX</para>
</listitem>
<listitem>
<para>UltraSound PnP</para>
</listitem>
</itemizedlist>
</para>
&hwlist.snd.fm801;
&hwlist.snd.gusc;
<para arch="i386,amd64">Intel 443MX, 810, 815, É 815E ×ÓÔÒÏÅÎÎÙÅ Ú×ÕËÏ×ÙÅ
ÕÓÔÒÏÊÓÔ×Á (ÄÒÁÊ×ÅÒ &man.pcm.4;)</para>
@@ -797,6 +783,8 @@
<para arch="i386,amd64">Trident 4DWave DX/NX (ÄÒÁÊ×ÅÒ &man.pcm.4;)</para>
&hwlist.snd.via8233;
&hwlist.snd.via82c686;
&hwlist.snd.ds1;
@@ -1,9 +1,9 @@
<!--
The FreeBSD Russian Documentation Project
$FreeBSDru: frdp/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml,v 1.17 2004/10/11 06:16:43 den Exp $
$FreeBSDru$
Original revision: 1.761.2.41
Original revision: 1.761.2.41.2.9
-->
<articleinfo>
@@ -99,7 +99,7 @@
<para>Обычно в информации о релизе последовательно включены
последние сообщения безопасности, выпущенные после
&release.prev.historic;, ÉÎÆÏÒÍÁÃÉÑ Ï ÐÏÄÄÅÒÖËÅ ÎÏ×ÙÈ ÄÒÁÊ×ÅÒÏ× ÉÌÉ
&release.prev;, информация о поддержке новых драйверов или
оборудования, новых команд или параметров, информация о основных
исправлениях ошибок, или обновлениях стороннего программного
обеспечения. В нем могут также перечисляться изменения важнейших
@@ -132,6 +132,34 @@
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:01.telnet.asc">FreeBSD-SA-05:01.telnet</ulink>.
</para>
<para>В системном вызове &man.sendfile.2; была исправлена ошибка,
связанная с раскрытием информации, которая могла позволить передачу
произвольных частей памяти ядра.
За дальнейшей информацией обращайтесь к сообщению безопасности
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:02.sendfile.asc">FreeBSD-SA-05:02.sendfile</ulink>.
</para>
<para arch="amd64">Было исправлено возможное расширение привилегий в &os;/amd64.
Ошибка позволяла непривилегированным пользователям получать прямой
доступ к некоторому оборудованию, доступ к которому не мог быть
получен без соответствующего уровня привилегий.
За дальнейшей информацией обращайтесь к сообщению безопасности
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:03.amd64.asc">FreeBSD-SA-05:03.amd64</ulink>.
</para>
<para>Была исправлена ошибка в <literal>SIOCGIFCONF</literal> &man.ioctl.2;,
приводившая к утечке информации, из-за которой подвергались утечке 12
байт памяти ядра.
За дальнейшей информацией обращайтесь к сообщению безопасности
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:04.ifconf.asc">FreeBSD-SA-05:04.ifconf</ulink>.
</para>
<para>Было исправлено несколько программных ошибок в &man.cvs.1;,
которые потенциально позволяли выполнение произвольного кода
на серверах CVS. Дополнительная информация может быть получена
из сообщения безопасности
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:05.cvs.asc">FreeBSD-SA-05:05.cvs</ulink>.</para>
</sect2>
<sect2 id="kernel">
@@ -278,7 +306,7 @@
поддерживает полное управление назначением пакета при
установке параметра ядра
<literal>options IPFIREWALL_FORWARD_EXTENDED</literal> в дополнение
Ë ÐÁÒÁÍÅÔÒÕ <literal>options IPFIRWALL_FORWARD</literal>.
к параметру <literal>options IPFIREWALL_FORWARD</literal>.
Этот параметр ядра устраняет все ограничения для локально созданных
пакетов и позволяет перенаправление пакетов, предназначенных для
локально сконфигурированного IP адреса.
@@ -348,7 +376,7 @@
</para>
<para>Информация о вновь смонтированных файловых системах cd9660
(ÎÁÐÒÉÍÅÒ, ÉÎÆÏÒÍÁÃÉÑ Ï ÎÁÌÉÞÉÉ ÒÁÓÛÉÒÅÎÉÊ Rockridge) ÔÅÐÅÒØ
(например, информация о наличии расширений RockRidge) теперь
печатается только если ядро было собрано в режиме verbose.
Это изменение было сделано для уменьшения количества
(зачастую ненужных) протоколируемых сообщений ядра.</para>
@@ -491,6 +519,9 @@
нарушающему Microsoft PPP Callback Control Protocol
section 3.2.</para>
<para>Утилита &man.restore.8; теперь снова может читать
дампы &os; версии 1.</para>
<para>Утилита &man.rm.1; теперь поддерживает параметр
<option>-I</option>, с которым (однократно) запрашивается
подтверждение при рекурсивном удалении каталогов или
@@ -516,6 +547,18 @@
привилегированных программ, когда буфер сокета переполняется
вследствие локальной DoS атаки.</para>
<para>&man.syslogd.8; теперь поддерживает опцию <option>-S</option>,
которая позволяет изменять путь к привилегированному
сокету. Это полезно, если вы не хотите, чтобы даемон
получал какие-либо сообщения из локальных сокетов
(по умолчанию используются <filename>/var/run/log</filename> и
<filename>/var/run/logpriv</filename>).</para>
<para>Утилита &man.syslogd.8; теперь позволяет использовать символы
<literal>:</literal> и <literal>%</literal> в спецификации
имени хоста. Эти символы используются в адресах и scope ID
IPv6.</para>
<para>&man.systat.1; <option>-netstat</option> теперь приспособлен
для IPv6.</para>
@@ -7,9 +7,10 @@
Use release/doc/ru_RU.KOI8-R/share/examples/dev-auto-translate.pl
script to update this file (-o option).
This script maintained in HEAD branch.
$FreeBSD$
$FreeBSDru: frdp/release/doc/ru_RU.KOI8-R/share/sgml/dev-auto-ru.sgml,v 1.3 2005/03/21 15:08:45 den Exp $
$FreeBSDru$
-->
<!ENTITY hwlist.62c9ec99a9ca598d738dcf66b339aa1e 'ëÏÎÔÒÏÌÌÅÒÙ, ÐÏÄÄÅÒÖÉ×ÁÅÍÙÅ ÄÒÁÊ×ÅÒÏÍ &man.aac.4;, ×ËÌÀÞÁÑ:'>
<!ENTITY hwlist.43922be022d49dabc274b2afffd0db8b 'äÒÁÊ×ÅÒ &man.adv.4; ÐÏÄÄÅÒÖÉ×ÁÅÔ ÓÌÅÄÕÀÝÉÅ ËÏÎÔÒÏÌÌÅÒÙ SCSI:'>
@@ -149,3 +150,6 @@
<!ENTITY hwlist.e688a5843719661e200e677735d50993 'äÒÁÊ×ÅÒ &man.snd.vibes.4; ÐÏÄÄÅÒÖÉ×ÁÅÔ Ú×ÕËÏ×ÙÅ ÕÓÔÒÏÊÓÔ×Á, ÏÓÎÏ×ÁÎÎÙÅ ÎÁ ÓÌÅÄÕÀÝÅÍ ÎÁÂÏÒÅ ÍÉËÒÏÓÈÅÍ:'>
<!ENTITY hwlist.c2875a10d870ef5948a306802a3eb27c 'äÒÁÊ×ÅÒ &man.rc.4; ÐÏÄÄÅÒÖÉ×ÁÅÔ SDL Communications RISCom&#47;8 boards&#46;'>
<!ENTITY hwlist.73c7ba1735e16bfd370f670d6f7f7ec1 'äÒÁÊ×ÅÒ &man.sr.4; ÐÏÄÄÅÒÖÉ×ÁÅÔ ÓÌÅÄÕÀÝÅÅ ÏÂÏÒÕÄÏ×ÁÎÉÅ:'>
<!ENTITY hwlist.b15e9a237ad4fd8ff4d1e302d35b5d0e 'äÒÁÊ×ÅÒ &man.arcmsr.4; ÐÏÄÄÅÒÖÉ×ÁÅÔ ÓÌÅÄÕÀÝÉÅ ËÁÒÔÙ:'>
<!ENTITY hwlist.5a5c5b85e01adc2f0accbf531676d0b3 'äÒÁÊ×ÅÒ &man.snd.via8233.4; ÐÏÄÄÅÒÖÉ×ÁÅÔ ÓÌÅÄÕÀÝÉÅ ÁÕÄÉÏ ÞÉÐÓÅÔÙ:'>
<!ENTITY hwlist.33ae232115e1314115c765212edf588a 'äÒÁÊ×ÅÒ &man.gx.4; ÐÏÄÄÅÒÖÉ×ÁÅÔ Gigabit Ethernet ÁÄÁÐÔÅÒÙ, ÏÓÎÏ×ÁÎÎÙÅ ÎÁ ÍÉËÒÏÓÈÅÍÁÈ ËÏÎÔÒÏÌÌÅÒÏ× Intel 82542 É 82543:'>
@@ -8,11 +8,11 @@
ARCHS= alpha amd64 ia64 i386 pc98 sparc64
MULTITEXTS= installation relnotes hardware
UNITEXTS= readme errata
UNITEXTS= readme errata early-adopter
IMAGEDIR= .imagedir
RHOST= freefall.freebsd.org
RDIR= public_html/relnotes/5-STABLE
RDIR= public_html/relnotes/5.4-RELEASE
DOCDIR= ./release/doc
LANG= en_US.ISO8859-1
+10 -10
View File
@@ -6,12 +6,12 @@
<!-- Version of the OS we're describing. This needs to be updated
with each new release. -->
<!ENTITY release.current "5.4-STABLE">
<!ENTITY release.current "5.4-RELEASE">
<!-- The previous version used for comparison in the "What's New"
section. For -CURRENT, we might point back to the last
branchpoint. -->
<!ENTITY release.prev "5.4-RELEASE">
<!ENTITY release.prev "5.3-RELEASE">
<!-- The previous stable release, useful for pointing user's at the
release they SHOULD be running if they don't want the bleeding
@@ -20,7 +20,7 @@
<!-- The previous historical release. Used only to tell what was
the cutoff point for "historic" release notes. -->
<!ENTITY release.prev.historic "5.4-RELEASE">
<!ENTITY release.prev.historic "5.3-RELEASE">
<!-- The next version to be released, usually used for snapshots. -->
<!ENTITY release.next "5.5-RELEASE">
@@ -29,21 +29,21 @@
<!ENTITY release.branch "5-STABLE">
<!-- The URL for obtaining this version of FreeBSD. -->
<!ENTITY release.url "http://www.FreeBSD.org/snapshots/">
<!ENTITY release.url "ftp://ftp.FreeBSD.org/">
<!-- The type of release (usually this will be either "snapshot"
or "release" -->
<!ENTITY release.type "snapshot">
<!ENTITY % release.type.snapshot "INCLUDE">
<!ENTITY % release.type.release "IGNORE">
<!ENTITY release.type "release">
<!ENTITY % release.type.snapshot "IGNORE">
<!ENTITY % release.type.release "INCLUDE">
<!-- The manpaths for man page references -->
<!ENTITY release.man.url "http://www.FreeBSD.org/cgi/man.cgi">
<!ENTITY release.manpath.xfree86 "4.4.0">
<!ENTITY release.manpath.xorg "6.7.0">
<!ENTITY release.manpath.netbsd "2.0">
<!ENTITY release.manpath.xorg "6.8.2">
<!ENTITY release.manpath.netbsd "2.0.2">
<!ENTITY release.manpath.freebsd-ports "Ports">
<!ENTITY release.manpath.freebsd "5.3-stable">
<!ENTITY release.manpath.freebsd "5.4-RELEASE">
<!-- Text constants which probably don't need to be changed.-->
+2 -3
View File
@@ -10,7 +10,7 @@
The FreeBSD Simplified Chinese Project
Original Revision: 1.69.2.17
Original Revision: 1.69.2.16
-->
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
@@ -39,8 +39,7 @@
<year>2002</year>
<year>2003</year>
<year>2004</year>
<year>2005</year>
<holder role="mailto:[email protected]">The &os; Documentation Project</holder>
<holder role="mailto:[email protected]">The FreeBSD Documentation Project</holder>
</copyright>
<legalnotice id="trademarks" role="trademarks">
+495 -55
View File
@@ -1,7 +1,7 @@
<!--
The FreeBSD Simplified Chinese Project
Original revision: 1.761.2.43
Original revision: 1.761.2.41.2.9
-->
<articleinfo>
<title>&os;/&arch; &release.current; 发行说明</title>
@@ -94,18 +94,83 @@
<sect2 id="security">
<title>安全公告</title>
<para></para>
<para>在 &man.fetch.1; 工具中发现了一处问题,
它可能导致恶意的 HTTP 服务器覆盖客户程序任意部分的内存,
这一问题已经得到修复。 要了解更多信息, 请参见安全公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:16.fetch.asc">FreeBSD-SA-04:16.fetch</ulink>。
</para>
<para>在 &man.procfs.5; 和 &man.linprocfs.5;
中发现了一处问题, 它能够允许恶意的本地用户读取部分内核内存,
或通过造成系统 panic 来实施本地拒绝服务攻击,
这一问题已经得到修复。 要了解更多信息, 请参见安全公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:17.procfs.asc">FreeBSD-SA-04:17.procfs</ulink>。
</para>
<para>修正了 TELNET 客户端程序中的两处缓冲区溢出问题。
这些问题可以导致恶意的 TELNET 服务器或网络上的主动攻击者,
使 &man.telnet.1; 以运行它的用户的身份执行任意的代码。
要了解更多信息, 请参见安全公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:01.telnet.asc">FreeBSD-SA-05:01.telnet</ulink>。
</para>
<para>修正了 &man.sendfile.2; 系统调用中的一处信息泄露问题,
这一问题可能导致内核中的一段随机的部分被传递出去。
要了解更多信息, 请参见安全公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:02.sendfile.asc">FreeBSD-SA-05:02.sendfile</ulink>。
</para>
<para arch="amd64">修正了在 &os;/amd64 中的一处特权提升问题。
这一问题可能导致没有特权的用户访问某些在没有特权时无法访问的硬件。
要了解更多信息, 请参见安全公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:03.amd64.asc">FreeBSD-SA-05:03.amd64</ulink>。
</para>
<para>修正了
<literal>SIOCGIFCONF</literal> &man.ioctl.2; 的一个信息泄露问题,
这一问题可能导致 12 字节的内核内存被泄露。
要了解更多信息, 请参见安全公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:04.ifconf.asc">FreeBSD-SA-05:04.ifconf</ulink>。</para>
<para>修正了 &man.cvs.1; 中的多处程序设计问题, 这些问题可能导致在
CVS 服务器上执行任意代码。
要了解更多信息, 请参见安全公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:05.cvs.asc">FreeBSD-SA-05:05.cvs</ulink>。</para>
</sect2>
<sect2 id="kernel">
<title>对于内核的改动</title>
<para></para>
<para>内核调试器 &man.ddb.4; 现在支持用于显示持有休眠互斥体
(以及当前线程所持有的自旋互斥体) 的情况的
<command>show alllocks</command> 命令了。</para>
<para>现在 &man.jail.8; 功能支持一个新的 sysctl
<varname>security.jail.chflags_allowed</varname>,
用于控制 &man.chflags.1; 在 jail 中的行为。
如果设置为 <literal>0</literal> (默认值), jail 中的 <username>root</username>
用户将被认为是非特权用户; 如果设置为 <literal>1</literal>,
则 jail 中的 root 用户会被视为与未 jail 的 <username>root</username>
用户一样。</para>
<para arch="alpha,amd64,i386">加载器变量 <varname>debug.mpsafevm</varname>
默认置为启用了。</para>
<!-- Above this line, sort kernel changes by manpage/keyword-->
<para></para>
<para>一系列 ULE 的问题得到了修正。</para>
<para arch="i386">一个关于在对处理器间中断 (IPI) 进行处理时的问题得以修正,
这一问题可能导致 SMP 系统在重载时崩溃。 更多细节, 可以在勘误说明
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ERRATA/notices/FreeBSD-EN-05:03.ipi.asc">FreeBSD-EN-05:03.ipi</ulink>
中找到。</para>
<para arch="i386">将传统 PCI 桥的内存分配范围,
限制到了 RAM 顶部的 32MB。 许多较早的、 旧的桥硬件,
只允许分配这一范围的内存。 这一修改只被应用于那些没有通过 BIOS
指定内存范围的设备。 它修正了 CardBus 桥 (&man.pccbb.4;)
的 <quote>bad Vcc</quote> 错误。</para>
<sect3 id="boot">
<title>引导区和 loader 的变化</title>
@@ -116,19 +181,74 @@
<sect3 id="proc">
<title>硬件支持</title>
<para></para>
<para arch="sparc64">加入了用于驱动 SBus/EBus &ultrasparc;
型号上的某些辅助 I/O 功能的 &man.auxio.4; 驱动。</para>
<para>加入了用于灵活控制处理器速度的框架。
这为许多驱动程序通过调整 CPU 的速度来控制功耗提供了手段。
更多细节, 可以在 &man.cpufreq.4; 联机手册中找到。</para>
<para>加入了用于支持 GPIB-PCIIA IEEE-488 卡的 pcii 驱动。</para>
<para arch="sparc64">加入了用于支持许多 &ultrasparc; II
和 III 型号上的 MC146818 兼容时钟的 rtc 驱动。</para>
<para arch="sparc64">&man.uart.4; 驱动,
在 <filename>GENERIC</filename> 内核中默认启用,
并成为了串口的默认驱动。 ofw_console 和
&man.sab.4; 驱动在
<filename>GENERIC</filename> 内核中被禁用。</para>
<sect4 id="mm">
<title>多媒体支持</title>
<para></para>
<para arch="sparc64">加入了用于支持 &ultrasparc; 工作站上的
Crystal Semiconductor CS4231 音效控制器的 &man.snd.audiocs.4;
驱动。</para>
</sect4>
<sect4 id="net-if">
<title>网络接口设备支持</title>
<para></para>
<para>加入了用于支持 USB 以太网通讯设备一类的 &man.cdce.4; 驱动。</para>
<para>&man.cp.4; 驱动现在是 MPSAFE 的了。</para>
<para>&man.ctau.4; 驱动现在是 MPSAFE 的了。</para>
<para>&man.cx.4; 驱动现在是 MPSAFE 的了。</para>
<para>&man.ed.4; 驱动现在支持 &man.altq.4; 框架了。</para>
<para>在 &man.em.4; 驱动程序中, 默认禁用了对 VLAN 标记 (tagging)
的硬件支持, 因为这个功能与混杂模式之间存在一些冲突。</para>
<para>默认地禁用了 &man.fxp.4; 驱动的以太网流控制功能,
以避免系统崩溃或进入内核调试器。</para>
<para>The &man.hme.4; 驱动现在是 MPSAFE 的了。</para>
<para arch="amd64">现在 &man.ndis.4; 设备驱动 wrapper
在 amd64 系统上能够支持 &windows;/x86-64 的二进制驱动了。
</para>
<para>&man.re.4; 驱动支持 &man.altq.4; 框架了。</para>
<para>现在 &man.sf.4; 驱动支持设备混合轮询 (device polling)
和 &man.altq.4; 了。</para>
<para>修正了 &man.sk.4; 驱动中的多处程序设计错误。
这些问题主要影响 SMP 系统, 可能导致系统崩溃、 内核缺页、
SSH 连接中断, 或文件传输问题。
更多细节, 可以在勘误公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ERRATA/notices/FreeBSD-EN-05:02.sk.asc">FreeBSD-EN-05:02.sk</ulink>
上找到。</para>
<para>现在, &man.sk.4; 驱动支持 &man.altq.4; 了。
同时, 此驱动支持基于 Yukon 的网卡的巨型帧能力了。
</para>
</sect4>
</sect3>
@@ -136,28 +256,126 @@
<sect3 id="net-proto">
<title>网络协议</title>
<para></para>
<para>当发送方写的数据必须分片时, 关闭了 IPv6 中的 MTU
反馈。</para>
<para>实现了共用地址冗余协议 (CARP)。
CARP 来自 OpenBSD, 允许多个主机共享同一个
IP 地址, 从而提供了高可用性和负载均衡。
要了解更多细节, 请参考 &man.carp.4; 联机手册。</para>
<para>&man.ipfw.4; 可以与
<varname>debug.mpsafenet</varname>=<literal>1</literal>
(默认情况下是 <literal>1</literal>),
当使用了 <literal>gid</literal>, <literal>jail</literal>,
和/或 <literal>uid</literal> 规则选项时正常工作了。</para>
<para>&man.ipfw.8; <literal>ipfw fwd</literal> 规则现在支持完整的包目的地管理了,
其前提是启用了内核选项 <literal>options IPFIREWALL_FORWARD</literal>
的基础上打开了
<literal>options IPFIREWALL_FORWARD_EXTENDED</literal>。
这个内核选项将禁用所有的限制, 以保证本地生成的包,
和发到配置在本地的 IP 地址的包能够正常地发出和转发。
请注意, 必须细心地编写 &man.ipfw.8; 规则,
以确保类似 PMTU 发现这类应用不致发生异常。</para>
<para>&man.ipnat.8; 允许在非 TCP/UDP 包上使用重定向规则了。</para>
<para>目前正在进行的工作, 在逐步去掉网络协议栈中的全局锁,
并改进锁的策略。</para>
<para>新的 &man.ng.netflow.4; NetGraph 节点,
使得采用 &os; 的路由器能够运行 NetFlow version 5 的导出。</para>
<para>现在 &man.sppp.4; 驱动程序包含了帧转发 (Frame Relay)
支持。</para>
<para>修正了 TCP 的一处问题, 这一问题有时会导致当接收窗口大小为零时,
RST 包被忽略的问题。</para>
<para>改进了 &os; TCP 协议栈中对 <literal>RST</literal>
的处理, 使得这类攻击变得尽可能地困难,
同时最大限度地保障了和其他 TCP 协议栈的兼容性。
算法如下: 对于所有在
<literal>ESTABLISHED</literal>
状态的连接, 只有当包的顺序号与
<varname>last_ack_sent</varname> 精确匹配时才将连接复位;
所有不符合的分片都将被直接丢弃。 对于所有其他状态的连接,
则对窗口内的复位请求进行处理。 其它的复位分片则被直接丢弃。
需要说明的是, 这一行为和 RFC 793 标准抵触, 传统的 (但安全性较差)
行为, 可以通过将新增的 sysctl <varname>net.inet.tcp.insecure_rst</varname>
设置为 <literal>1</literal> 来还原。</para>
<para>在 TCP SACK 实现中的许多错误得到了修正。</para>
<para>将 KAME IPv4 IPsec 实现集成到了 &os; 中,
现在支持 TCP-MD5 了。</para>
<para>短期使用端口的随机分配导致了在高连接速率时的端口重用问题。
这一功能现在在短期内发生大量连接, 即新端口的创建速率快于每秒
<varname>net.inet.ip.portrange.randomcps</varname> 时,
被自动禁用
<varname>net.inet.ip.portrange.randomtime</varname>
秒。 这两个 sysctl 变量的默认值,
分别是 <literal>10</literal> 和 <literal>45</literal>。</para>
</sect3>
<sect3 id="disks">
<title>磁盘及存储</title>
<para></para>
<para>现在 &man.amr.4; 可以安全地在使用了
&man.pae.4; 的系统上使用了。</para>
<para>加入了 SHSEC GEOM 类。 它提供了在多个 GEOM
提供者之间实现秘密分享的能力。 所有提供者必须都存在,
才能够解开保存的秘密信息。 这一特性可以通过 &man.gshsec.8;
工具来控制。</para>
<para arch="i386,ia64">加入了 &man.arcmsr.4; 驱动。
它支持 Areca ARC-11<replaceable>xx</replaceable> 和
ARC-12<replaceable>xx</replaceable> 系列的 SATA RAID
控制器。</para>
<para>加入了用于支持 HighPoint
RocketRAID 182x 系列硬件的 &man.hptmv.4; 驱动。</para>
<para>现在 &man.ips.4; 驱动在较新的 ServeRAID 型号上,
能够支持内核崩溃的转储操作了。</para>
<para>删去了 &man.matcd.4; 驱动。</para>
<para>关于新挂接的 cd9660 文件系统的信息 (例如,
存在 RockRidge 扩展) 现在只有在内核以详细 (verbose)
模式启动时才会显示了。 这一修改主要是减少 (一般来说不必要的)
内核日志消息的数量。</para>
</sect3>
<sect3 id="fs">
<title>文件系统</title>
<para></para>
<para>原先在挂接时进行的, 重新计算
<quote>脏</quote> (即, 上次停机时没有正常卸下) 的 UFS 和 UFS2
文件系统摘要信息的工作, 现在转由后台
&man.fsck.8; 进行。
这一修改将极大地改善系统崩溃后挂接大文件系统时的速度。
如果希望还原原先的行为, 可以通过将
<varname>vfs.ffs.compute_summary_at_mount</varname> sysctl
变量设置为非零值来实现。</para>
<para>修正了由于 NFS 服务器可能导致的一个内核崩溃。
更多细节, 可以在勘误公告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ERRATA/notices/FreeBSD-EN-05:01.nfs.asc">FreeBSD-EN-05:01.nfs</ulink>.
中找到。</para>
</sect3>
<sect3>
<title>基本系统附带的第三方软件</title>
<para></para>
<para><application>ACPI-CA</application> 由
20040527 更新到了 20041119。</para>
</sect3>
</sect2>
@@ -165,12 +383,160 @@
<sect2 id="userland">
<title>应用程序变动</title>
<para></para>
<para>现在 &man.ftpd.8; 程序会正确地为目录和文件的状态使用 <literal>212</literal>
和 <literal>213</literal> 状态代码了 (过去的版本,
曾经长期使用 <literal>211</literal>)。
这一行为在 RFC 959 中进行了描述。
</para>
<para>如果指定了 <literal>AF_UNSPEC</literal>,
现在 &man.getaddrinfo.3; 函数会在查询 <literal>AAAA</literal>
记录之前, 首先查询 <literal>A</literal>
DNS 资源记录。 一些有问题的 DNS 服务器会在 <literal>AAAA</literal>
记录不存在时返回 <literal>NXDOMAIN</literal>,
而根据标准, 它应该返回 <literal>NOERROR</literal>
和一条空记录。 这类服务器会在 IPv4/IPv6 双栈节点上导致查询停止,
因为对于 <literal>AAAA</literal> 的查询时返回的 <literal>NXDOMAIN</literal>
会导致服务器停止解析 <literal>A</literal> 记录的尝试。
另外, 这一行为也被视为一种潜在的拒绝服务攻击
(参见 <ulink url="http://www.kb.cert.org/vuls/id/714121"></ulink>
以了解更多细节)。 请注意, 虽然改变了查询顺序,
返回的结果仍然是
<literal>AF_INET6</literal> 记录先于
<literal>AF_INET</literal> 记录。</para>
<para>&man.gpt.8; 的 <literal>create</literal> 命令,
现在支持一个 <option>-f</option> 命令行标志,
以强制创建 GPT, 即使磁盘上原先已经存在了 MBR 记录。
</para>
<para>gvinum(8) 工具现在支持
<command>checkparity</command>、
<command>rebuildparity</command>, 以及
<command>setstate</command>
这三个子命令了。</para>
<para><filename>libarchive</filename> 库 (以及使用它的
&man.tar.1; 命令) 现在能够读取 ISO
镜像文件 (包括可选的 RockRidge 扩展) 和 ZIP 压缩文件
(采用 <literal>deflate</literal> 和 <literal>none</literal>
的压缩) 了。</para>
<para>加入了用于访问 GPIB 设备 (通过使用 pcii 驱动程序) 的
<function>ib<replaceable>foo</replaceable></function> API 的
<filename>libgpib</filename> 库。</para>
<para>从 HEAD 合并了一系列 <filename>libpthread</filename>
的错误修正。</para>
<para>为 &man.math.3; 函数库实现了一系列新的函数。
其中包括 &man.ceill.3;、
&man.floorl.3;、 &man.ilogbl.3;、 &man.fma.3; 及其变体,
&man.lrint.3; 及其变体, 以及 &man.lround.3; 及其变体。</para>
<para arch="i386">加入了用于为
<literal>GEOM_UZIP</literal> &man.geom.4; 模块提供压缩的文件系统的
&man.mkuzip.8; 工具。</para>
<para>现在 &man.moused.8; 服务能够支持 <quote>虚拟滚轮</quote> 了,
这一模式下, 按住鼠标中键时移动鼠标将被解释为滚轮操作。
这一功能可以通过 <option>-V</option> 标志来启用。</para>
<para>为 &man.named.8; 加入了属主为 <username>bind</username> 用户
(用于创建区域的日志文件) 的用于动态域的隔离目录。 要了解进一步的情况,
请参见示范的 &man.named.conf.5; 中动态域的例子。</para>
<para>现在 &man.ncal.1; 工具提供了一个 <option>-m</option> 选项,
用以生成当前年份指定月份的日历。</para>
<para>现在 &man.newfs.8; 提供了一个 <option>-n</option>
标志, 来禁止在新文件系统上创建 <filename>.snap</filename>
目录。 这一特性主要是为那些不需要快照支持的文件系统,
如内存或 vnode 文件系统准备的。</para>
<para>现在 &man.newfs.8; 会在创建 UFS 或 UFS2 文件系统,
而无法在其上产生快照时给出警告。
这一情况会在很大的文件系统使用很小尺寸的块时发生。</para>
<para>加入了编译用户应用时的 <literal>NO_NIS</literal> 开关。
如其名称所暗示的, 启用这个
<filename>Makefile</filename> 变量将使许多程序中不再包含 NIS
支持, 并不再勾践 NIS 工具。</para>
<para>现在 &man.periodic.8; 安全检查输出, 能够支持显示由
&man.pf.4; 所阻止的包的统计数据了。</para>
<para>&man.ppp.8; 程序实现了
<option>echo</option> 参数, 这使得分别地启用 LCP ECHO 和 LQR
报告成为可能。 较早版本的
&man.ppp.8; 会在协商失败时返回到 LCP ECHO 模式。
现在需要指定 <command>enable
echo</command> 来获得这一行为。</para>
<para>在 &man.pppd.8; 程序中的两个问题得以修正。
这些错误可能会导致不正确的 CBCP 响应,
而违反了 微软 PPP 回呼控制协议的 3.2 节。</para>
<para>&man.restore.8; 工具又能够处理
&os; 版本 1 的转储磁带了。</para>
<para>现在 &man.rm.1; 工具提供了一个 <option>-I</option>
选项。 如果选择递归地删除目录,
或者在命令行上指定一次删除超过 3 个文件,
这个选项会提供一次确认的机会。</para>
<para>&man.rtld.1; 动态连接器现在支持通过
<varname>LD_LIBMAP</varname> 环境变量来指定库映射关系了。
这一选项能够覆盖 &man.libmap.conf.5; 的设置。</para>
<para>&man.syslog.3; 函数现在是线程安全的了。</para>
<para>&man.syslogd.8; 工具现在会打开一个额外的域 socket
(默认为 <filename>/var/run/logpriv</filename>),
其权限是 <literal>0600</literal>, 作为和特权程序的接口。
者避免了发生本地的拒绝服务攻击时,
特权程序由于域 socket 的缓冲区耗尽而死锁。</para>
<para>&man.syslogd.8; 新增了 <option>-S</option> 选项,
用以改变特权 socket 的路径名。 如果您不希望服务接受来自本地 socket
的消息 (默认使用的是 <filename>/var/run/log</filename> 和
<filename>/var/run/logpriv</filename>) 时, 这个选项就很有用了。</para>
<para>&man.syslogd.8; 工具现在允许在主机名标识符中使用
<literal>:</literal> 和 <literal>%</literal>
这两个字符了。 这些字符被 IPv6 地址和 scope ID 使用。</para>
<para>现在 &man.systat.1; <option>-netstat</option> 的显示也包括了
IPv6 的数据。</para>
<para>&man.tail.1; 的 <option>-f</option>
选项能够支持同时查看多个文件了。</para>
<para>增加了用于关闭选定的 TCp 连接的 &man.tcpdrop.8; 命令。
它来自 OpenBSD。</para>
<para>&man.whois.1; 现在支持 <option>-k</option> 标志,
用以查询 <hostid role="fqdn">whois.krnic.net</hostid>
(韩国国家 Internet 开发局), 它提供了在韩国境内的 IP
地址分配的详细资料。</para>
<para>修正了一个可能导致 &man.hosts.5;、
&man.services.5;, 以及其他一些配置文件, 在其最后一行不是空行时被忽略的问题。</para>
<sect3 id="rc-scripts">
<title><filename>/etc/rc.d</filename> 脚本</title>
<para></para>
<para>&man.rc.conf.5; 现在支持在引导时修改网络接口的名字了。
例如:</para>
<programlisting>ifconfig_fxp0_name="net0"
ifconfig_net0="inet 10.0.0.1/16"</programlisting>
<para>&man.rc.conf.5; 现在支持 <varname>tmpmfs_flags</varname>
和 <varname>varmfs_flags</varname> 两个变量了。 这些变量,
可以用来向 &man.mdmfs.8; 工具提供额外的选项, 从而更好地定制
&man.md.4; 文件系统的创建过程, 包括是否打开 softupdates,
指定文件系统的默认属主, 等等。</para>
</sect3>
</sect2>
@@ -178,27 +544,132 @@
<sect2 id="contrib">
<title>基本系统包含的第三方软件</title>
<para><application>BIND</application> 从
9.3.0 升级到了 9.3.1。</para>
<para><application>Heimdal</application> 从
0.6.1 升级到了 0.6.3。</para>
<para>引入了来自 OpenBSD 的 2005 年 2 月 4 日快照的
<application>netcat</application>。 更多信息,
可以在 &man.nc.1; 联机手册中找到。</para>
<para><application>OpenSSL</application> 从
0.9.7d 升级到了 0.9.7e。</para>
<para><application>sendmail</application> 从
8.13.1 升级到了 version 8.13.3。</para>
<para>时区数据库从
<application>tzdata2004e</application> 版升级到了
<application>tzdata2004g</application> 版。</para>
<para></para>
</sect2>
<sect2 id="ports">
<title>Ports/Packages Collection 基础结构</title>
<para></para>
<para>从 CVS 库中删去了用于保存 Ports Collection 中所有项的
<filename>ports/INDEX<replaceable>*</replaceable></filename>。
这些文件过去并不经常性地重新生成, 因此可能会过时和不再准确。
需要使用 INDEX 文件的用户 (例如用于 &man.portupgrade.1;)
可以使用两种方法来获取一份副本:</para>
<itemizedlist>
<listitem>
<para>使用 <command>make index</command> 在
<filename>ports/</filename> tree 的顶部构建一份当前 ports
tree 的索引。</para>
</listitem>
<listitem>
<para>在 <filename>ports/</filename> tree 顶部执行
<command>make fetchindex</command> 来从网上下载。
这个索引文件 (通常) 在一天之内是准确的。</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="releng">
<title>发行版建造工程和功能集成</title>
<para></para>
<para>在先前的 &os; 版本中, <filename>disc1</filename>
CD-ROM (或 ISO 镜像文件) 是一张包含基本系统、 ports tree
和常用 package 的可以引导的光盘。
而 <filename>disc2</filename> CD-ROM (或 ISO 镜像文件)
则是可以引导的 <quote>fix it</quote> 盘, 它提供了现场 (live)
文件系统, 用于进行紧急修复操作。 这一格局发生了变化。
对于除了 ia64 以外的所有平台, 现在
<filename>disc1</filename> 包含了基本系统的安装包文件、
ports tree, 以及现场文件系统, 使得它适合于初始安装,
以及修复工作。 (在 ia64 上, 由于现场文件系统的尺寸太大,
以至于不得不将其放到另一张盘上。)
第三方 package 都在另一张盘上。 特别地, <filename>disc2</filename>
上包含了常用的预编译软件包, 例如桌面环境软件等。
来自 &os; 文档计划的各类文档, 也被置于
<filename>disc2</filename>。</para>
<para>支持的
<application>GNOME</application> 桌面环境的版本, 由 2.6.2
升级到了 2.10。 更多关于在 &os; 上运行 <application>GNOME</application>
的详细资料, 可以在
<ulink url="&url.base;/gnome/">FreeBSD GNOME Project</ulink>
Web 页面上找到。
<note>
<para>使用较早版本的
<application>GNOME</application> 桌面
(<filename role="package">x11/gnome2</filename>)
的用户在升级时需要特别小心。 简单地使用 &man.portupgrade.1;
(<filename role="package">sysutils/portupgrade</filename>)
配合 &os; Ports Collection 进行升级可能会造成严重的问题。
<application>GNOME</application> 桌面的用户, 应仔细阅读
<ulink url="&url.base;/gnome/docs/faq210.html"></ulink>
给出的说明, 并使用
<ulink url="&url.base;/gnome/gnome_upgrade.sh"><filename>gnome_upgrade.sh</filename></ulink>
脚本来正确地升级到
<application>GNOME</application> 2.10。</para>
</note>
</para>
<para>支持的 <application>KDE</application>
桌面环境的版本, 从 3.3.0 升级到了
3.4.0。 更多关于在 &os; 上运行
<application>KDE</application> 的信息, 可以在
<ulink url="http://freebsd.kde.org/">FreeBSD 上的 KDE</ulink> Web
页面上找到。
<note>
<para>使用较早版本的
<application>KDE</application> 的用户,
应使用
<ulink url="http://freebsd.kde.org/">FreeBSD 上的 KDE</ulink> Web
页面或 <filename>ports/UPDATING</filename>
中给出的方法升级。</para>
</note>
</para>
<para>支持的 <application>Xorg</application>
从 6.7.0 升级到了 6.8.2。</para>
</sect2>
<sect2 id="doc">
<title>文档</title>
<para></para>
<para>以下联机手册先前的版本中曾包含来自 RFC 的内容,
为了避免对 IETF 的侵权, 已经重新编写:
&man.gai.strerror.3;,
&man.getaddrinfo.3;,
&man.getnameinfo.3;,
&man.inet6.opt.init.3;,
&man.inet6.option.space.3;,
&man.inet6.rth.space.3;,
&man.inet6.rthdr.space.3;,
&man.icmp6.4;, 和
&man.ip6.4;。</para>
</sect2>
</sect1>
@@ -206,45 +677,14 @@
<sect1 id="upgrade">
<title>从先前版本的 &os; 升级</title>
<para>如果您正从先前版本的 &os; 升级, 一般可以选择下述方法之一:
<itemizedlist>
<listitem>
<para>使用 &man.sysinstall.8; 的二进制更新选项。
这种方法可能是最快的, 但它假定您的 &os;
没有使用特殊的编译选项。</para>
</listitem>
<listitem>
<para>完整地重新安装 &os;。 从技术角度而言, 这并不是升级方法,
而且要比二进制升级麻烦一些, 因为您需要手工备份和恢复
<filename>/etc</filename> 的内容。 然而, 如果您想要 (或者需要)
改变磁盘分区, 这就很有用。</para>
</listitem>
<listitem>
<para>从 <filename>/usr/src</filename> 中的源代码升级。
这种方法更为灵活, 但也需要更多的磁盘空间、 时间,
以及技术专业知识。 更多信息,
可以在 <ulink url="http://www.FreeBSD.org/doc/zh_CN.GB2312/books/handbook/"
>FreeBSD 使用手册</ulink>
的 <ulink url="http://www.FreeBSD.org/doc/zh_CN.GB2312/books/handbook/makeworld.html"
><quote>使用 <command>make world</command></quote></ulink>
小节找到。 从非常旧的 &os; 版本升级可能会有问题;
这种情况下, 使用二进制升级或者全新安装可能是更为有效的方法。</para>
</listitem>
</itemizedlist>
</para>
<para>请参阅 <filename>INSTALL.TXT</filename> 文件以获得更进一步的信息,
特别是在开始安装 <emphasis>之前</emphasis>。 如果您正从源代码升级,
也请务必阅读
<filename>/usr/src/UPDATING</filename>。</para>
<para>最后, 如果您想随 &os; 的
-STABLE 或 -CURRENT 开发分支升级, 则一定要先阅读
<ulink url="http://www.FreeBSD.org/doc/zh_CN.GB2312/books/handbook/"
>FreeBSD 使用手册</ulink>
中的 <ulink url="http://www.FreeBSD.org/doc/zh_CN.GB2312/books/handbook/current-stable.html"
><quote>-CURRENT 和 -STABLE 的对比</quote></ulink> 一节。</para>
<para>使用现有的 &os; 系统的用户
<emphasis>强烈</emphasis> 推荐首先阅读 <quote>到 &os;
&release.current; 的迁移指南</quote>。
这份文档应该可以在光盘或这份发行版本说明所在的地方找到,
其文件名为 <filename>MIGRATE5.TXT</filename>。 它提供了一些关于升级的说明,
更重要的是, 升级到 &os;
5.<replaceable>X</replaceable> 和继续运行 &os;
4.<replaceable>X</replaceable> 的优缺点对比。</para>
<important>
<para>很显然,升级 &os; 时,应该首先备份
+8 -7
View File
@@ -42,9 +42,13 @@ def disc1_packages():
# For architectures that use a separate livefs, this is actually disc3.
def disc2_packages():
# X Desktops
pkgs = ['x11/kde3',
'x11/gnome2',
'x11-wm/afterstep',
if arch == 'ia64':
pkgs = ['x11/gnome2-lite',
'x11/kde-lite']
else:
pkgs = ['x11/gnome2',
'x11/kde3']
pkgs.extend(['x11-wm/afterstep',
'x11-wm/windowmaker',
'x11-wm/fvwm2',
# "Nice to have"
@@ -89,15 +93,12 @@ def disc2_packages():
'www/lynx',
'x11/rxvt',
# Formerly on disc3
'lang/gnat',
'lang/php4',
'lang/php5',
'print/teTeX',
'security/portaudit',
'textproc/docproj-jadetex',
'www/apache13',
'www/apache13-modssl',
'www/apache2']
'www/apache2'])
if arch == 'i386':
pkgs.extend(['comms/ltmdm',
'www/opera'])
+7 -4
View File
@@ -213,7 +213,7 @@ void
var_list::set_variable(const string &var, const string &val)
{
if (Dflag)
fprintf(stderr, "%s=%s\n", var.c_str(), val.c_str());
fprintf(stderr, "setting %s=%s\n", var.c_str(), val.c_str());
_vars[var] = val;
}
@@ -563,8 +563,11 @@ process_event(char *buffer)
sp = cfg.set_vars(sp);
break;
case nomatch:
//?vars at location on bus
sp = cfg.set_vars(sp);
//? at location pnp-info on bus
sp = strchr(sp, ' ');
if (sp == NULL)
return; /* Can't happen? */
*sp++ = '\0';
if (strncmp(sp, "at ", 3) == 0)
sp += 3;
sp = cfg.set_vars(sp);
@@ -795,7 +798,7 @@ gensighand(int)
static void
usage()
{
fprintf(stderr, "usage: %s [-d]\n", getprogname());
fprintf(stderr, "usage: %s [-Ddn]\n", getprogname());
exit(1);
}
+3 -2
View File
@@ -197,6 +197,7 @@ static struct part_type
,{0xB7, "BSDI BSD/386 file system"}
,{0xB8, "BSDI BSD/386 swap"}
,{0xBE, "Solaris x86 boot"}
,{0xBF, "Solaris x86 (new)"}
,{0xC1, "DRDOS/sec with 12-bit FAT"}
,{0xC4, "DRDOS/sec with 16-bit FAT (< 32MB)"}
,{0xC6, "DRDOS/sec with 16-bit FAT (>= 32MB)"}
@@ -302,7 +303,7 @@ main(int argc, char *argv[])
if (stat(argv[0], &sb) == 0) {
/* OK, full pathname given */
disk = argv[0];
} else if (errno == ENOENT) {
} else if (errno == ENOENT && argv[0][0] != '/') {
/* Try prepending "/dev" */
asprintf(&disk, "%s%s", _PATH_DEV, argv[0]);
if (disk == NULL)
@@ -716,7 +717,7 @@ open_disk(int flag)
return -3;
for (p = 1; p < 5; p++) {
asprintf(&s, "%ss%d", disk, p);
fdw = open(s, O_RDONLY);
fdw = open(s, rwmode);
free(s);
if (fdw == -1)
continue;
+4 -5
View File
@@ -106,19 +106,18 @@ inode information
indirect block dump
.El
.It Fl o Ar outfile
This allows to set the output filename where the dump is written to, and
must be specified.
This allows to change the output filename where the dump is written to.
The current default is
.Pa /var/tmp/ffsinfo .
If
.Fl
is provided, output will be sent to stdout.
.El
.Sh EXAMPLES
.Dl ffsinfo -o /var/tmp/ffsinfo -l 1023 /dev/vinum/testvol
.Dl ffsinfo -l 1023 /dev/vinum/testvol
.Pp
will dump
.Pa /dev/vinum/testvol
to
.Pa /var/tmp/ffsinfo
with all available information.
.Sh BUGS
Snapshots are handled like plain files.
+4 -3
View File
@@ -140,7 +140,10 @@ main(int argc, char **argv)
cfg_lv=0xff;
cfg_in=-2;
cfg_cg=-2;
out_file=NULL;
out_file=strdup("/var/tmp/ffsinfo");
if(out_file == NULL) {
errx(1, "strdup failed");
}
while ((ch=getopt(argc, argv, "g:i:l:o:")) != -1) {
switch(ch) {
@@ -182,8 +185,6 @@ main(int argc, char **argv)
usage();
}
device=*argv;
if (out_file == NULL)
errx(1, "out_file not specified");
/*
* Now we try to guess the (raw)device name.
+1
View File
@@ -14,6 +14,7 @@ WARNS?= 6
.if defined(GFSDBG)
SRCS+= debug.c
CFLAGS+=-DFS_DEBUG
.endif
.include <bsd.prog.mk>
+1 -1
View File
@@ -1,4 +1,4 @@
/*
/*-
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
+1 -1
View File
@@ -51,7 +51,7 @@
*default host=CHANGE_THIS.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_5
*default release=cvs tag=RELENG_5_4
*default delete use-rel-suffix
# If you seem to be limited by CPU rather than network or disk bandwidth, try
+5
View File
@@ -99,6 +99,11 @@ Enables loading of a custom ACPI DSDT.
Name of the DSDT table to load, if loading is enabled.
.It Va debug.acpi.disabled
Selectively disables portions of ACPI for debugging purposes.
.It Va debug.acpi.max_threads
Specify the number of task threads that are started on boot.
Limiting this to 1 may help work around various BIOSes that cannot
handle parallel requests.
The default value is 3.
.It Va debug.acpi.quirks
Override any automatic quirks completely.
.It Va hint.acpi.0.disabled
+1 -10
View File
@@ -32,7 +32,7 @@
.\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
.Dd April 9, 2005
.Dd October 23, 2004
.Dt INET 4
.Os
.Sh NAME
@@ -248,15 +248,6 @@ In the same time, on high-speed links, it can decrease the ID reuse
cycle greatly.
Default is 0 (sequential IP IDs).
IPv6 flow IDs and fragment IDs are always random.
.It Va ip.maxfragpackets
Integer: maximum number of fragmented packets the host will accept and hold
in the reassembling queue simultaneously.
0 means that the host will not accept any fragmented packets.
\-1 means that the host will accept as many fragmented packets as it receives.
.It Va ip.maxfragsperpacket
Integer: maximum number of fragments the host will accept and hold
in the reassembling queue for a packet.
0 means that the host will not accept any fragmented packets.
.El
.Sh SEE ALSO
.Xr ioctl 2 ,
+2 -3
View File
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd March 26, 2005
.Dd December 14, 2004
.Dt POLLING 4
.Os
.Sh NAME
@@ -191,9 +191,8 @@ As of this writing, the
.Xr sis 4 ,
.Xr ste 4 ,
.Xr vge 4 ,
.Xr vr 4 ,
and
.Xr xl 4
.Xr vr 4
devices are supported, with others in the works.
The modifications are rather straightforward, consisting in
the extraction of the inner part of the interrupt service routine
-1
View File
@@ -240,7 +240,6 @@ the author considers it a manufacturing defect.
.Xr netintro 4 ,
.Xr ng_ether 4 ,
.Xr pccard 4 ,
.Xr polling 4 ,
.Xr ifconfig 8
.Sh HISTORY
The
+1 -6
View File
@@ -2487,12 +2487,7 @@ man page.
.Pq Vt str
Indicates the device (usually a swap partition) to which a crash dump
should be written in the event of a system crash.
If the value of this variable is
.Dq Li AUTO ,
the first suitable swap device listed in
.Pa /etc/fstab
will be used as dump device.
Otherwise, the value of this variable is passed as the argument to
The value of this variable is passed as the argument to
.Xr dumpon 8 .
To disable crash dumps, set this variable to
.Dq Li NO .
-1
View File
@@ -51,7 +51,6 @@ MAN= accept_filter.9 \
devclass_find.9 \
devclass_get_device.9 \
devclass_get_devices.9 \
devclass_get_drivers.9 \
devclass_get_maxunit.9 \
devclass_get_name.9 \
devclass_get_softc.9 \
-98
View File
@@ -1,98 +0,0 @@
.\" Copyright (c) 2005 Gleb Smirnoff <[email protected]>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd March 23, 2005
.Dt ALLOC_UNR 9
.Os
.Sh NAME
.Nm new_unrhdr ,
.Nm delete_unrhdr ,
.Nm alloc_unr ,
.Nm free_unr
.Nd "kernel unit number allocator"
.Sh SYNOPSIS
.In sys/systm.h
.Ft "struct unrhdr *"
.Fn new_unrhdr "int low" "int high" "struct mtx *mutex"
.Ft void
.Fn delete_unrhdr "struct unrhdr *uh"
.Ft int
.Fn alloc_unr "struct unrhdr *uh"
.Ft int
.Fn alloc_unrl "struct unrhdr *uh"
.Ft void
.Fn free_unr "struct unrhdr *uh" "u_int item"
.Sh DESCRIPTION
The kernel unit number allocator is a generic facility, which allows to allocate
unit numbers within a specified range.
.Bl -ohang
.It Fn new_unrhdr low high mutex
Initialize a new unit number allocator entity.
.Fa low
and
.Fa high
specify minimum and maximum number of unit numbers.
There is no cost associated with the range of unit numbers, so unless the resource
really is finite,
.Va INT_MAX
can be used.
If
.Fa mutex
is not
.Va NULL ,
it is used for locking when allocating and freeing units.
Otherwise internal mutex is used.
.It Fn delete_unrhdr uh
Destroy specified unit number allocator entity.
.It Fn alloc_unr uh
Return a new unit number.
The lowest free number is always allocated.
This function does not allocate memory and never sleeps, however it may
block on mutex.
If no free unit numbers are left
.Va -1
is returned.
.It Fn alloc_unrl uh
Same as
.Fn alloc_unr
except that mutex is assumed to be locked already and thus is not used.
.It Fn free_unr uh
Free a previously allocated unit number.
This function may require allocating memory, and thus it can sleep.
There is no pre-locked variant.
.El
.Sh CODE REFERENCES
The above functions are implemented in
.Pa sys/kern/subr_unit.c .
.Sh HISTORY
Kernel unit number allocator first appeared in
.Fx 5.5 .
.Sh AUTHORS
.An -nosplit
Kernel unit number allocator was written by
.An Poul-Henning Kamp .
This manpage was written by
.An Gleb Smirnoff .
-57
View File
@@ -1,57 +0,0 @@
.\" -*- nroff -*-
.\"
.\" Copyright (c) 2005 Nate Lawson
.\"
.\" All rights reserved.
.\"
.\" This program is free software.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd April 3, 2005
.Dt DEVCLASS_GET_DRIVERS 9
.Os
.Sh NAME
.Nm devclass_get_drivers
.Nd get a list of drivers in a devclass
.Sh SYNOPSIS
.In sys/param.h
.In sys/bus.h
.Ft int
.Fn devclass_get_drivers "devclass_t dc" "driver_t ***listp" "int *countp"
.Sh DESCRIPTION
Retrieve a list of pointers to all driver instances currently in the
devclass and return the list in
.Fa *listp
and the number of drivers in the list in
.Fa *countp .
The memory allocated for the list should be freed using
.Fn free "*listp" "M_TEMP" .
.Sh RETURN VALUES
Zero is returned on success, otherwise an appropriate error is returned.
.Sh SEE ALSO
.Xr devclass 9 ,
.Xr device 9
.Sh AUTHORS
This man page was written by
.An Nate Lawson .
+3 -5
View File
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd April 3, 2005
.Dd June 16, 1998
.Dt DEVCLASS_GET_MAXUNIT 9
.Os
.Sh NAME
@@ -40,14 +40,12 @@
.Ft int
.Fn devclass_get_maxunit "devclass_t dc"
.Sh DESCRIPTION
Returns the next unit number to be allocated to device instances in the
Returns the maximum unit number allocated to device instances in the
specified
.Dv devclass .
This is one greater than the highest currently allocated unit.
.Sh SEE ALSO
.Xr devclass 9 ,
.Xr device 9
.Sh AUTHORS
This man page was written by
.An Doug Rabson .
.Sh BUGS
The name is confusing since it is one greater than the maximum unit.
+3 -4
View File
@@ -185,7 +185,7 @@ FreeBSD 5.2 | | | |
*---FreeBSD 5.3 | | | |
| | | | OpenBSD 3.6 |
| v | NetBSD 2.0 | |
| | | | DragonFly 1.2.0
| | | | |
FreeBSD 6 -current | NetBSD -current OpenBSD -current |
| | | | |
v v v v v
@@ -201,7 +201,7 @@ was the announcement in Usenet or if it was available as tape.
the 4.4BSD Operating System.
[APL] Apple website [http://www.apple.com/macosx/]
[BSDI] Berkeley Software Design, Inc.
[DFB] DragonFlyBSD Project, The.
[DFD] DragonFlyBSD Project, The.
[DOC] README, COPYRIGHT on tape.
[FBD] FreeBSD Project, The.
[KB] Keith Bostic. BSD2.10 available from Usenix. comp.unix.sources,
@@ -410,12 +410,11 @@ FreeBSD 5.2.1 2004-02-22 [FBD] (patch release)
NetBSD 1.6.2 2004-03-01 [NBD] (patch release)
OpenBSD 3.5 2004-04-01 [OBD]
FreeBSD 4.10 2004-05-27 [FBD]
DragonFly 1.0 2004-07-12 [DFB]
DragonFly 1.0 2004-07-12 [DFD]
OpenBSD 3.6 2004-10-29 [OBD]
FreeBSD 5.3 2004-11-06 [FBD]
NetBSD 2.0 2004-12-09 [NBD]
FreeBSD 4.11 2005-01-25 [FBD]
DragonFly 1.2.0 2005-04-08 [DFB]
Bibliography
------------------------
+256 -868
View File
File diff suppressed because it is too large. Load diff
+90
View File
@@ -192,6 +192,10 @@ mp_topology(void)
}
#ifdef KDB_STOP_NMI
volatile cpumask_t ipi_nmi_pending;
#endif
/*
* Calculate usable address in base memory for AP trampoline code.
*/
@@ -731,8 +735,16 @@ smp_tlb_shootdown(u_int vector, vm_offset_t addr1, vm_offset_t addr2)
smp_tlb_addr2 = addr2;
atomic_store_rel_int(&smp_tlb_wait, 0);
ipi_all_but_self(vector);
/*
* Enable interrupts here to workaround Opteron Errata 106.
* The while loop runs entirely out of instruction cache,
* which blocks updates to the cache from other CPUs.
* Interrupts break the lock, allowing the write to post.
*/
enable_intr();
while (smp_tlb_wait < ncpu)
ia32_pause();
disable_intr();
}
/*
@@ -820,8 +832,16 @@ smp_targeted_tlb_shootdown(u_int mask, u_int vector, vm_offset_t addr1, vm_offse
ipi_all_but_self(vector);
else
ipi_selected(mask, vector);
/*
* Enable interrupts here to workaround Opteron Errata 106.
* The while loop runs entirely out of instruction cache,
* which blocks updates to the cache from other CPUs.
* Interrupts break the lock, allowing the write to post.
*/
enable_intr();
while (smp_tlb_wait < ncpu)
ia32_pause();
disable_intr();
}
void
@@ -1023,6 +1043,76 @@ ipi_self(u_int ipi)
lapic_ipi_vectored(ipi, APIC_IPI_DEST_SELF);
}
#ifdef KDB_STOP_NMI
/*
* send NMI IPI to selected CPUs
*/
#define BEFORE_SPIN 1000000
void
ipi_nmi_selected(u_int32_t cpus)
{
int cpu;
register_t icrlo;
icrlo = APIC_DELMODE_NMI | APIC_DESTMODE_PHY | APIC_LEVEL_ASSERT
| APIC_TRIGMOD_EDGE;
CTR2(KTR_SMP, "%s: cpus: %x nmi", __func__, cpus);
atomic_set_int(&ipi_nmi_pending, cpus);
while ((cpu = ffs(cpus)) != 0) {
cpu--;
cpus &= ~(1 << cpu);
KASSERT(cpu_apic_ids[cpu] != -1,
("IPI NMI to non-existent CPU %d", cpu));
/* Wait for an earlier IPI to finish. */
if (!lapic_ipi_wait(BEFORE_SPIN))
panic("ipi_nmi_selected: previous IPI has not cleared");
lapic_ipi_raw(icrlo,cpu_apic_ids[cpu]);
}
}
int
ipi_nmi_handler()
{
int cpu = PCPU_GET(cpuid);
if(!(atomic_load_acq_int(&ipi_nmi_pending) & (1 << cpu)))
return 1;
atomic_clear_int(&ipi_nmi_pending,1 << cpu);
savectx(&stoppcbs[cpu]);
/* Indicate that we are stopped */
atomic_set_int(&stopped_cpus,1 << cpu);
/* Wait for restart */
while(!(atomic_load_acq_int(&started_cpus) & (1 << cpu)))
ia32_pause();
atomic_clear_int(&started_cpus,1 << cpu);
atomic_clear_int(&stopped_cpus,1 << cpu);
if(cpu == 0 && cpustop_restartfunc != NULL)
cpustop_restartfunc();
return 0;
}
#endif /* KDB_STOP_NMI */
/*
* This is called once the rest of the system is up and running and we're
* ready to let the AP's out of the pen.
+8
View File
@@ -165,6 +165,14 @@ trap(frame)
atomic_add_int(&cnt.v_trap, 1);
type = frame.tf_trapno;
#ifdef KDB_STOP_NMI
/* Handler for NMI IPIs used for debugging */
if (type == T_NMI) {
if (ipi_nmi_handler() == 0)
goto out;
}
#endif /* KDB_STOP_NMI */
#ifdef KDB
if (kdb_active) {
kdb_reenter();
+11 -3
View File
@@ -21,6 +21,11 @@ machine amd64
#####################################################################
# SMP OPTIONS:
#
# The apic device enables the use of the I/O APIC for interrupt delivery.
# The apic device can be used in both UP and SMP kernels, but is required
# for SMP kernels. Thus, the apic device is not strictly an SMP option,
# but it is a prerequisite for SMP.
#
# Notes:
#
# By default, mixed mode is used to route IRQ0 from the AT timer via
@@ -42,6 +47,12 @@ options NO_MIXED_MODE # Disable use of mixed mode
#
options MP_WATCHDOG
#
# Debugging options.
#
options KDB_STOP_NMI # Stop CPUS using NMI instead of IPI
#####################################################################
# CPU OPTIONS
@@ -188,8 +199,6 @@ device tdfx # Enable 3Dfx Voodoo support
# Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER
# defined when it is built).
#
# ACPI_MAX_THREADS sets the number of task threads started.
#
# ACPI_NO_SEMAPHORES makes the AcpiOs*Semaphore routines a no-op.
#
# ACPICA_PEDANTIC enables strict checking of AML. Our default is to
@@ -201,7 +210,6 @@ device tdfx # Enable 3Dfx Voodoo support
device acpi
options ACPI_DEBUG
options ACPI_MAX_THREADS=1
#!options ACPI_NO_SEMAPHORES
#!options ACPICA_PEDANTIC
+5
View File
@@ -65,6 +65,11 @@ void smp_masked_invlpg_range(u_int mask, vm_offset_t startva,
void smp_invltlb(void);
void smp_masked_invltlb(u_int mask);
#ifdef KDB_STOP_NMI
int ipi_nmi_handler(void);
void ipi_nmi_selected(u_int32_t cpus);
#endif
#endif /* !LOCORE */
#endif /* SMP */
-356
View File
@@ -1,356 +0,0 @@
/*-
* Copyright (c) 2005
* Bill Paul <wpaul@windriver.com>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Bill Paul.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <machine/asmacros.h>
/*
* This file contains assembly language wrappers for the different
* calling conventions supported by Windows on the i386 architecture.
* In FreeBSD, the whole OS typically use same C calling convention
* everywhere, namely _cdecl. Windows, on the other hand, uses several
* different C calling conventions depending on the circumstances:
*
* _stdcall: Used for most ordinary Windows APIs. With _stdcall,
* arguments are passed on the stack, and the callee unwinds the stack
* before returning control to the caller. Not suitable for variadic
* functions.
*
* _fastcall: Used for some APIs that may be invoked frequently and
* where speed is a critical factor (e.g. KeAcquireSpinLock() and
* KeReleaseSpinLock()) Similar to _stdcall, except the first 2 32-bit
* or smaller arguments are passed in the %ecx and %edx registers
* instead of on the stack. Not suitable for variadic functions.
*
* _cdecl: Used for standard C library routines and for variadic
* functions.
*
* _regparm(3): Used for certain assembly routines. All arguments
* passed in %eax, %ecx and %edx.
*
* Furthermore, there is an additional wrinkle that's not obvious
* with all code: Microsoft supports the use of exceptions in C
* (__try/__except) both in user _and_ kernel mode. Sadly, Windows
* structured exception handling uses machine-specific features
* that conflict rather badly with FreeBSD. (See utility routines
* at the end of this module for more details.)
*
* We want to support these calling conventions in as portable a manner
* as possible. The trick is doing it not only with different versions
* of GNU C, but with compilers other than GNU C (e.g. the Solaris
* SunOne C compiler). The only sure fire method is with assembly
* language trampoline code which both fixes up the argument passing,
* stack unwinding and exception/thread context all at once.
*
* You'll notice that we call the thunk/unthunk routines in the
* *_wrap() functions in an awkward way. Rather than branching
* directly to the address, we load the address into a register
* first as a literal value, then we branch to it. This is done
* to insure that the assembler doesn't translate the branch into
* a relative branch. We use the *_wrap() routines here as templates
* and create the actual trampolines at run time, at which point
* we only know the absolute addresses of the thunk and unthunk
* routines. So we need to make sure the templates have enough
* room in them for the full address.
*/
/*
* Handle _stdcall going from Windows to UNIX.
* This is frustrating, because to do it right you have to
* know how many arguments the called function takes, and there's
* no way to figure this out on the fly: you just have to be told
* ahead of time. We assume there will be 16 arguments. I don't
* think there are any Windows APIs that require this many.
*/
.globl x86_stdcall_wrap_call
.globl x86_stdcall_wrap_arg
.globl x86_stdcall_wrap_end
ENTRY(x86_stdcall_wrap)
push %esi
push %edi
sub $64,%esp
mov %esp,%esi
add $64+8+4,%esi
mov %esp,%edi
mov $16,%ecx # handle up to 16 args
rep
movsl
movl $ctxsw_wtou, %eax
call *%eax # unthunk
x86_stdcall_wrap_call:
movl $0,%eax
call *%eax # jump to routine
mov %eax,%esi # preserve return val
movl $ctxsw_utow, %eax
call *%eax # thunk
add $64,%esp # clean the stack
mov %esi,%eax # restore return val
pop %edi
pop %esi
x86_stdcall_wrap_arg:
ret $0xFF
x86_stdcall_wrap_end:
/*
* Handle _stdcall going from UNIX to Windows. This routine
* expects to be passed the function to be called, number of
* args and the arguments for the Windows function on the stack.
*/
ENTRY(x86_stdcall_call)
push %esi # must preserve %esi
push %edi # and %edi
mov 16(%esp),%eax # get arg cnt
mov %eax,%ecx # save as copy count
mov %esp,%esi # Set source address register to point to
add $20,%esi # first agument to be forwarded.
shl $2,%eax # turn arg cnt into offset
sub %eax,%esp # shift stack to new location
mov %esp,%edi # store dest copy addr
rep # do the copy
movsl
call ctxsw_utow # thunk
call *12(%edi) # branch to stdcall routine
mov %eax,%esi # preserve return val
call ctxsw_wtou # unthunk
mov %edi,%esp # restore stack
mov %esi,%eax # restore return val
pop %edi # restore %edi
pop %esi # and %esi
ret
/*
* Fastcall support. Similar to _stdcall, except the first
* two arguments are passed in %ecx and %edx. It happens we
* only support a small number of _fastcall APIs, none of them
* take more than three arguments. So to keep the code size
* and complexity down, we only handle 3 arguments here.
*/
/* Call _fastcall function going from Windows to UNIX. */
.globl x86_fastcall_wrap_call
.globl x86_fastcall_wrap_arg
.globl x86_fastcall_wrap_end
ENTRY(x86_fastcall_wrap)
mov 4(%esp),%eax
push %eax
push %edx
push %ecx
movl $ctxsw_wtou, %eax
call *%eax # unthunk
x86_fastcall_wrap_call:
mov $0,%eax
call *%eax # branch to fastcall routine
push %eax # preserve return val
movl $ctxsw_utow, %eax
call *%eax # thunk
pop %eax # restore return val
add $12,%esp # clean the stack
x86_fastcall_wrap_arg:
ret $0xFF
x86_fastcall_wrap_end:
/*
* Call _fastcall function going from UNIX to Windows.
* This routine isn't normally used since NDIS miniport drivers
* only have _stdcall entry points, but it's provided anyway
* to round out the API, and for testing purposes.
*/
ENTRY(x86_fastcall_call)
mov 4(%esp),%eax
push 16(%esp)
call ctxsw_utow # thunk
mov 12(%esp),%ecx
mov 16(%esp),%edx
call *8(%esp) # branch to fastcall routine
push %eax # preserve return val
call ctxsw_wtou # unthunk
pop %eax # restore return val
add $4,%esp # clean the stack
ret
/*
* Call regparm(3) function going from Windows to UNIX. Arguments
* are passed in %eax, %edx and %ecx. Note that while additional
* arguments are passed on the stack, we never bother when them,
* since the only regparm(3) routines we need to wrap never take
* more than 3 arguments.
*/
.globl x86_regparm_wrap_call
.globl x86_regparm_wrap_end
ENTRY(x86_regparm_wrap)
push %ecx
push %edx
push %eax
movl $ctxsw_wtou, %eax
call *%eax # unthunk
x86_regparm_wrap_call:
movl $0,%eax
call *%eax # jump to routine
push %eax # preserve return val
push %edx # preserve return val
movl $ctxsw_utow, %eax
call *%eax # thunk
pop %edx # restore return val
pop %eax # restore return val
add $12,%esp # restore stack
ret
x86_regparm_wrap_end:
/*
* Call regparm(3) function going from UNIX to Windows.
* This routine isn't normally used since NDIS miniport drivers
* only have _stdcall entry points, but it's provided anyway
* to round out the API, and for testing purposes.
*/
ENTRY(x86_regparm_call)
call ctxsw_utow # thunk
mov 8(%esp),%eax
mov 12(%esp),%edx
mov 16(%esp),%ecx
call *4(%esp) # branch to fastcall routine
push %eax # preserve return val
push %edx # preserve return val
call ctxsw_wtou # unthunk
pop %edx # restore return val
pop %eax # restore return val
ret
/*
* Ugly hack alert:
*
* On Win32/i386, using __try/__except results in code that tries to
* manipulate what's supposed to be the Windows Threada Environment
* Block (TEB), which one accesses via the %fs register. In particular,
* %fs:0 (the first DWORD in the TEB) points to the exception
* registration list. Unfortunately, FreeBSD uses %fs for the
* per-cpu data structure (pcpu), and we can't allow Windows code
* to muck with that. I don't even know what Solaris uses %fs for
* (or if it even uses it at all).
*
* Even worse, in 32-bit protected mode, %fs is a selector that
* refers to an entry in either the GDT or the LDT. Ideally, we would
* like to be able to temporarily point it at another descriptor
* while Windows code executes, but to do that we need a separate
* descriptor entry of our own to play with.
*
* Therefore, we go to some trouble to learn the existing layout of
* the GDT and update it to include an extra entry that we can use.
* We need the following utility routines to help us do that. On
* FreeBSD, index #7 in the GDT happens to be unused, so we turn
* this into our own data segment descriptor. It would be better
* if we could use a private LDT entry, but there's no easy way to
* do that in SMP mode because of the way FreeBSD handles user LDTs.
*
* Once we have a custom descriptor, we have to thunk/unthunk whenever
* we cross between FreeBSD code and Windows code. The thunking is
* based on the premise that when executing instructions in the
* Windows binary itself, we won't go to sleep. This is because in
* order to yield the CPU, the code has to call back out to a FreeBSD
* routine first, and when that happens we can unthunk in order to
* restore FreeBSD context. What we're desperately trying to avoid is
* being involuntarily pre-empted with the %fs register still pointing
* to our fake TIB: if FreeBSD code runs with %fs pointing at our
* Windows TIB instead of pcpu, we'll panic the kernel. Fortunately,
* the only way involuntary preemption can occur is if an interrupt
* fires, and the trap handler saves/restores %fs for us.
*
* The thunking routines themselves, ctxsw_utow() (Context SWitch UNIX
* to Windows) and ctxsw_wtou() (Context SWitch Windows to UNIX), are
* external to this module. This is done simply because it's easier
* to manipulate data structures in C rather than assembly.
*/
ENTRY(x86_getldt)
movl 4(%esp),%eax
sgdtl (%eax)
movl 8(%esp),%eax
sldt (%eax)
xor %eax,%eax
ret
ENTRY(x86_setldt)
movl 4(%esp),%eax
lgdt (%eax)
jmp 1f
nop
1:
movl 8(%esp),%eax
lldt %ax
xor %eax,%eax
ret
ENTRY(x86_getfs)
mov %fs,%ax
ret
ENTRY(x86_setfs)
movl 4(%esp),%fs
ret
ENTRY(x86_gettid)
mov %fs:12,%eax
ret
+1 -1
View File
@@ -321,7 +321,7 @@ libkern/qdivrem.c standard
libkern/ucmpdi2.c standard
libkern/udivdi3.c standard
libkern/umoddi3.c standard
pc98/apm/apm_bioscall.s optional apm
pc98/apm/apm_bioscall.S optional apm
pc98/i386/busio.s standard
pc98/i386/busiosubr.c standard
pc98/i386/machdep.c standard
+1 -1
View File
@@ -32,7 +32,7 @@
TYPE="FreeBSD"
REVISION="5.4"
BRANCH="STABLE"
BRANCH="RELEASE"
RELEASE="${REVISION}-${BRANCH}"
VERSION="${TYPE} ${RELEASE}"
+3
View File
@@ -55,4 +55,7 @@ PSM_HOOKRESUME opt_psm.h
PSM_RESETAFTERSUSPEND opt_psm.h
PSM_DEBUG opt_psm.h
NO_MIXED_MODE
# Debugging
KDB_STOP_NMI opt_global.h
DEV_ATPIC opt_atpic.h
+3
View File
@@ -164,5 +164,8 @@ DEV_APIC opt_apic.h
DEV_NPX opt_npx.h
ASR_COMPAT opt_asr.h
# Debugging
KDB_STOP_NMI opt_global.h
# agp options
AGP_AMD64_GART opt_agp.h
+3
View File
@@ -108,3 +108,6 @@ PC98 opt_global.h
DEV_APIC opt_apic.h
DEV_MECIA opt_mecia.h
DEV_NPX opt_npx.h
# Debugging
KDB_STOP_NMI opt_global.h
+2 -2
View File
@@ -4065,9 +4065,9 @@ pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kif *kif,
(*state)->dst.seqdiff = (*state)->src.seqhi -
(*state)->dst.seqlo;
(*state)->src.seqhi = (*state)->src.seqlo +
(*state)->src.max_win;
(*state)->dst.seqhi = (*state)->dst.seqlo +
(*state)->dst.max_win;
(*state)->dst.seqhi = (*state)->dst.seqlo +
(*state)->src.max_win;
(*state)->src.wscale = (*state)->dst.wscale = 0;
(*state)->src.state = (*state)->dst.state =
TCPS_ESTABLISHED;
+8 -1
View File
@@ -49,6 +49,13 @@
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME("SCHEDULE")
/*
* Allow the user to tune the number of task threads we start. It seems
* some systems have problems with increased parallelism.
*/
static int acpi_max_threads = ACPI_MAX_THREADS;
TUNABLE_INT("debug.acpi.max_threads", &acpi_max_threads);
/*
* This is a little complicated due to the fact that we need to build and then
* free a 'struct task' for each task we enqueue.
@@ -130,7 +137,7 @@ acpi_task_thread_init(void)
err = 0;
STAILQ_INIT(&acpi_task_queue);
for (i = 0; i < ACPI_MAX_THREADS; i++) {
for (i = 0; i < acpi_max_threads; i++) {
err = kthread_create(acpi_task_thread, NULL, &acpi_kthread_proc,
0, 0, "acpi_task%d", i);
if (err != 0) {
+2 -3
View File
@@ -405,9 +405,8 @@ int acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *type,
int *rid, struct resource **dst);
ACPI_HANDLE acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj);
#ifndef ACPI_MAX_THREADS
#define ACPI_MAX_THREADS 1
#endif
/* Default number of task queue threads to start. */
#define ACPI_MAX_THREADS 3
/* ACPI task kernel thread initialization. */
int acpi_task_thread_init(void);
+8
View File
@@ -558,7 +558,11 @@ amr_cam_complete(struct amr_command *ac)
free(ap, M_DEVBUF);
if ((csio->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)
debug(2, "%*D\n", imin(csio->dxfer_len, 16), csio->data_ptr, " ");
mtx_unlock(&ac->ac_sc->amr_io_lock);
mtx_lock(&Giant);
xpt_done((union ccb *)csio);
mtx_unlock(&Giant);
mtx_lock(&ac->ac_sc->amr_io_lock);
amr_releasecmd(ac);
}
@@ -621,6 +625,10 @@ amr_cam_complete_extcdb(struct amr_command *ac)
free(aep, M_DEVBUF);
if ((csio->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)
debug(2, "%*D\n", imin(csio->dxfer_len, 16), csio->data_ptr, " ");
mtx_unlock(&ac->ac_sc->amr_io_lock);
mtx_lock(&Giant);
xpt_done((union ccb *)csio);
mtx_unlock(&Giant);
mtx_lock(&ac->ac_sc->amr_io_lock);
amr_releasecmd(ac);
}
+1 -5
View File
@@ -1836,11 +1836,7 @@ static VOID arcmsr_action(struct cam_sim * psim,union ccb * pccb)
}
else
{
struct bus_dma_segment seg;
seg.ds_addr=(bus_addr_t)pccb->csio.data_ptr;
seg.ds_len=pccb->csio.dxfer_len;
arcmsr_executesrb(pSRB,&seg,1,0);
panic("arcmsr: CAM_DATA_PHYS not supported");
}
}
else
+2
View File
@@ -2582,6 +2582,8 @@ asr_attach(device_t tag)
*/
sc->ha_devt = make_dev(&asr_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640,
"asr%d", unit);
if (sc->ha_devt != NULL)
(void)make_dev_alias(sc->ha_devt, "rdpti%d", unit);
sc->ha_devt->si_drv1 = sc;
return(0);
} /* asr_attach */
-17
View File
@@ -3433,23 +3433,6 @@ bge_ifmedia_upd(ifp)
return(EINVAL);
switch(IFM_SUBTYPE(ifm->ifm_media)) {
case IFM_AUTO:
/*
* The BCM5704 ASIC appears to have a special
* mechanism for programming the autoneg
* advertisement registers in TBI mode.
*/
if (sc->bge_asicrev == BGE_ASICREV_BCM5704) {
uint32_t sgdig;
CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
sgdig |= BGE_SGDIGCFG_AUTO|
BGE_SGDIGCFG_PAUSE_CAP|
BGE_SGDIGCFG_ASYM_PAUSE;
CSR_WRITE_4(sc, BGE_SGDIG_CFG,
sgdig|BGE_SGDIGCFG_SEND);
DELAY(5);
CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
}
break;
case IFM_1000_SX:
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
+57 -1
View File
@@ -83,6 +83,7 @@
#include <sys/stat.h>
#include <sys/kthread.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
@@ -130,6 +131,8 @@ static int ciss_identify_logical(struct ciss_softc *sc, struct ciss_ldrive *ld);
static int ciss_get_ldrive_status(struct ciss_softc *sc, struct ciss_ldrive *ld);
static int ciss_update_config(struct ciss_softc *sc);
static int ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld);
static void ciss_init_sysctl(struct ciss_softc *sc);
static void ciss_soft_reset(struct ciss_softc *sc);
static void ciss_free(struct ciss_softc *sc);
static void ciss_spawn_notify_thread(struct ciss_softc *sc);
static void ciss_kill_notify_thread(struct ciss_softc *sc);
@@ -270,9 +273,10 @@ static struct
{ 0x0e11, 0x409D, CISS_BOARD_SA5, "HP Smart Array 6400 EM" },
{ 0x103C, 0x3220, CISS_BOARD_SA5, "HP Smart Array" },
{ 0x103C, 0x3222, CISS_BOARD_SA5, "HP Smart Array" },
{ 0x103C, 0x3223, CISS_BOARD_SA5, "HP Smart Array P800" },
{ 0x103C, 0x3225, CISS_BOARD_SA5, "HP Smart Array P600" },
{ 0x103C, 0x3230, CISS_BOARD_SA5, "HP Smart Array" },
{ 0x103C, 0x3231, CISS_BOARD_SA5, "HP Smart Array" },
{ 0x103C, 0x3231, CISS_BOARD_SA5, "HP Smart Array E400" },
{ 0x103C, 0x3232, CISS_BOARD_SA5, "HP Smart Array" },
{ 0x103C, 0x3233, CISS_BOARD_SA5, "HP Smart Array" },
{ 0x103C, 0x3234, CISS_BOARD_SA5, "HP Smart Array" },
@@ -402,6 +406,11 @@ ciss_attach(device_t dev)
ciss_initq_complete(sc);
ciss_initq_notify(sc);
/*
* Initalize device sysctls.
*/
ciss_init_sysctl(sc);
/*
* Initialise command/request pool.
*/
@@ -500,9 +509,21 @@ ciss_shutdown(device_t dev)
/* flush adapter cache */
ciss_flush_adapter(sc);
if (sc->ciss_soft_reset)
ciss_soft_reset(sc);
return(0);
}
static void
ciss_init_sysctl(struct ciss_softc *sc)
{
SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->ciss_dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ciss_dev)),
OID_AUTO, "soft_reset", CTLFLAG_RW, &sc->ciss_soft_reset, 0, "");
}
/************************************************************************
* Perform PCI-specific attachment actions.
*/
@@ -762,6 +783,41 @@ out:
return(error);
}
static void
ciss_soft_reset(struct ciss_softc *sc)
{
struct ciss_request *cr = NULL;
struct ciss_command *cc;
int i, error = 0;
for (i = 0; i < sc->ciss_max_logical_bus; i++) {
/* only reset proxy controllers */
if (sc->ciss_controllers[i].physical.bus == 0)
continue;
if ((error = ciss_get_request(sc, &cr)) != 0)
break;
if ((error = ciss_get_bmic_request(sc, &cr, CISS_BMIC_SOFT_RESET,
NULL, 0)) != 0)
break;
cc = CISS_FIND_COMMAND(cr);
cc->header.address = sc->ciss_controllers[i];
if ((error = ciss_synch_request(cr, 60 * 1000)) != 0)
break;
ciss_release_request(cr);
}
if (error)
ciss_printf(sc, "error resetting controller (%d)\n", error);
if (cr != NULL)
ciss_release_request(cr);
}
/************************************************************************
* Allocate memory for the adapter command structures, initialise
* the request structures.
+1
View File
@@ -449,6 +449,7 @@ struct ciss_config_table
#define CISS_BMIC_ID_PDRIVE 0x15
#define CISS_BMIC_BLINK_PDRIVE 0x16
#define CISS_BMIC_SENSE_BLINK_PDRIVE 0x17
#define CISS_BMIC_SOFT_RESET 0x40
#define CISS_BMIC_FLUSH_CACHE 0xc2
#define CISS_BMIC_ACCEPT_MEDIA 0xe0
+2
View File
@@ -237,6 +237,8 @@ struct ciss_softc
struct cam_devq *ciss_cam_devq;
struct cam_sim **ciss_cam_sim;
int ciss_soft_reset;
int ciss_flags;
#define CISS_FLAG_NOTIFY_OK (1<<0) /* notify command running OK */
#define CISS_FLAG_CONTROL_OPEN (1<<1) /* control device is open */
-404
View File
@@ -1,404 +0,0 @@
/*-
* Copyright (c) 2004-2005 Nate Lawson (SDG)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/cpu.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/pcpu.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <dev/pci/pcivar.h>
#include <machine/bus.h>
#include <machine/clock.h>
#include <machine/resource.h>
#include <sys/rman.h>
#include "cpufreq_if.h"
/*
* The SpeedStep ICH feature is a chipset-initiated voltage and frequency
* transition available on the ICH2M, 3M, and 4M. It is different from
* the newer Pentium-M SpeedStep feature. It offers only two levels of
* frequency/voltage. Often, the BIOS will select one of the levels via
* SMM code during the power-on process (i.e., choose a lower level if the
* system is off AC power.)
*/
struct ichss_softc {
device_t dev;
int bm_rid; /* Bus-mastering control (PM2REG). */
struct resource *bm_reg;
int ctrl_rid; /* Control/status register. */
struct resource *ctrl_reg;
struct cf_setting sets[2]; /* Only two settings. */
};
/* Supported PCI IDs. */
#define PCI_VENDOR_INTEL 0x8086
#define PCI_DEV_82801BA 0x244c /* ICH2M */
#define PCI_DEV_82801CA 0x248c /* ICH3M */
#define PCI_DEV_82801DB 0x24cc /* ICH4M */
#define PCI_DEV_82815BA 0x1130 /* Unsupported/buggy part */
/* PCI config registers for finding PMBASE and enabling SpeedStep. */
#define ICHSS_PMBASE_OFFSET 0x40
#define ICHSS_PMCFG_OFFSET 0xa0
/* Values and masks. */
#define ICHSS_ENABLE (1<<3) /* Enable SpeedStep control. */
#define ICHSS_IO_REG 0x1 /* Access register via I/O space. */
#define ICHSS_PMBASE_MASK 0xff80 /* PMBASE address bits. */
#define ICHSS_CTRL_BIT 0x1 /* 0 is high speed, 1 is low. */
#define ICHSS_BM_DISABLE 0x1
/* Offsets from PMBASE for various registers. */
#define ICHSS_BM_OFFSET 0x20
#define ICHSS_CTRL_OFFSET 0x50
#define ICH_GET_REG(reg) \
(bus_space_read_1(rman_get_bustag((reg)), \
rman_get_bushandle((reg)), 0))
#define ICH_SET_REG(reg, val) \
(bus_space_write_1(rman_get_bustag((reg)), \
rman_get_bushandle((reg)), 0, (val)))
static int ichss_pci_probe(device_t dev);
static int ichss_probe(device_t dev);
static int ichss_attach(device_t dev);
static int ichss_detach(device_t dev);
static int ichss_settings(device_t dev, struct cf_setting *sets,
int *count);
static int ichss_set(device_t dev, const struct cf_setting *set);
static int ichss_get(device_t dev, struct cf_setting *set);
static int ichss_type(device_t dev, int *type);
static device_method_t ichss_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ichss_probe),
DEVMETHOD(device_attach, ichss_attach),
DEVMETHOD(device_detach, ichss_detach),
/* cpufreq interface */
DEVMETHOD(cpufreq_drv_set, ichss_set),
DEVMETHOD(cpufreq_drv_get, ichss_get),
DEVMETHOD(cpufreq_drv_type, ichss_type),
DEVMETHOD(cpufreq_drv_settings, ichss_settings),
{0, 0}
};
static driver_t ichss_driver = {
"ichss", ichss_methods, sizeof(struct ichss_softc)
};
static devclass_t ichss_devclass;
DRIVER_MODULE(ichss, cpu, ichss_driver, ichss_devclass, 0, 0);
static device_method_t ichss_pci_methods[] = {
DEVMETHOD(device_probe, ichss_pci_probe),
{0, 0}
};
static driver_t ichss_pci_driver = {
"ichss_pci", ichss_pci_methods, 0
};
static devclass_t ichss_pci_devclass;
DRIVER_MODULE(ichss_pci, pci, ichss_pci_driver, ichss_pci_devclass, 0, 0);
#if 0
#define DPRINT(x...) printf(x)
#else
#define DPRINT(x...)
#endif
/*
* We detect the chipset by looking for its LPC bus ID during the PCI
* scan and reading its config registers during the probe. However,
* we add the ichss child under the cpu device since even though the
* chipset provides the control, it really affects the cpu only.
*
* XXX This approach does not work if the module is loaded after boot.
*/
static int
ichss_pci_probe(device_t dev)
{
device_t child, parent;
uint32_t pmbase;
/*
* TODO: add a quirk to disable if we see the 82815_MC along
* with the 82801BA and revision < 5.
*/
if (pci_get_vendor(dev) != PCI_VENDOR_INTEL ||
(pci_get_device(dev) != PCI_DEV_82801BA &&
pci_get_device(dev) != PCI_DEV_82801CA &&
pci_get_device(dev) != PCI_DEV_82801DB))
return (ENXIO);
/* Only one CPU is supported for this hardware. */
if (devclass_get_device(ichss_devclass, 0))
return (ENXIO);
/*
* Add a child under the CPU parent. It appears that ICH SpeedStep
* only requires a single CPU to set the value (since the chipset
* is shared by all CPUs.) Thus, we only add a child to cpu 0.
*/
parent = devclass_get_device(devclass_find("cpu"), 0);
KASSERT(parent != NULL, ("cpu parent is NULL"));
child = BUS_ADD_CHILD(parent, 0, "ichss", 0);
if (child == NULL) {
device_printf(parent, "add SpeedStep child failed\n");
return (ENXIO);
}
/* Find the PMBASE register from our PCI config header. */
pmbase = pci_read_config(dev, ICHSS_PMBASE_OFFSET, sizeof(pmbase));
if ((pmbase & ICHSS_IO_REG) == 0) {
printf("ichss: invalid PMBASE memory type\n");
return (ENXIO);
}
pmbase &= ICHSS_PMBASE_MASK;
if (pmbase == 0) {
printf("ichss: invalid zero PMBASE address\n");
return (ENXIO);
}
DPRINT("ichss: PMBASE is %#x\n", pmbase);
/* Add the bus master arbitration and control registers. */
bus_set_resource(child, SYS_RES_IOPORT, 0, pmbase + ICHSS_BM_OFFSET,
1);
bus_set_resource(child, SYS_RES_IOPORT, 1, pmbase + ICHSS_CTRL_OFFSET,
1);
/* Attach the new CPU child now. */
device_probe_and_attach(child);
return (ENXIO);
}
static int
ichss_probe(device_t dev)
{
device_t est_dev, perf_dev;
int error, type;
uint16_t ss_en;
if (resource_disabled("ichss", 0))
return (ENXIO);
/*
* If the ACPI perf driver has attached and is not just offering
* info, let it manage things. Also, if Enhanced SpeedStep is
* available, don't attach.
*/
perf_dev = device_find_child(device_get_parent(dev), "acpi_perf", -1);
if (perf_dev && device_is_attached(perf_dev)) {
error = CPUFREQ_DRV_TYPE(perf_dev, &type);
if (error == 0 && (type & CPUFREQ_FLAG_INFO_ONLY) == 0)
return (ENXIO);
}
est_dev = device_find_child(device_get_parent(dev), "est", -1);
if (est_dev && device_is_attached(est_dev))
return (ENXIO);
/* Activate SpeedStep control if not already enabled. */
ss_en = pci_read_config(dev, ICHSS_PMCFG_OFFSET, sizeof(ss_en));
if ((ss_en & ICHSS_ENABLE) == 0) {
printf("ichss: enabling SpeedStep support\n");
pci_write_config(dev, ICHSS_PMCFG_OFFSET,
ss_en | ICHSS_ENABLE, sizeof(ss_en));
}
device_set_desc(dev, "SpeedStep ICH");
return (-1000);
}
static int
ichss_attach(device_t dev)
{
struct ichss_softc *sc;
sc = device_get_softc(dev);
sc->dev = dev;
sc->bm_rid = 0;
sc->bm_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->bm_rid,
RF_ACTIVE);
if (sc->bm_reg == NULL) {
device_printf(dev, "failed to alloc BM arb register\n");
return (ENXIO);
}
sc->ctrl_rid = 1;
sc->ctrl_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
&sc->ctrl_rid, RF_ACTIVE);
if (sc->ctrl_reg == NULL) {
device_printf(dev, "failed to alloc control register\n");
bus_release_resource(dev, SYS_RES_IOPORT, sc->bm_rid,
sc->bm_reg);
return (ENXIO);
}
/* Setup some defaults for our exported settings. */
sc->sets[0].freq = CPUFREQ_VAL_UNKNOWN;
sc->sets[0].volts = CPUFREQ_VAL_UNKNOWN;
sc->sets[0].power = CPUFREQ_VAL_UNKNOWN;
sc->sets[0].lat = 1000;
sc->sets[0].dev = dev;
sc->sets[1] = sc->sets[0];
cpufreq_register(dev);
return (0);
}
static int
ichss_detach(device_t dev)
{
/* TODO: teardown BM and CTRL registers. */
return (ENXIO);
}
static int
ichss_settings(device_t dev, struct cf_setting *sets, int *count)
{
struct ichss_softc *sc;
struct cf_setting set;
int first, i;
if (sets == NULL || count == NULL)
return (EINVAL);
if (*count < 2) {
*count = 2;
return (E2BIG);
}
sc = device_get_softc(dev);
/*
* Estimate frequencies for both levels, temporarily switching to
* the other one if we haven't calibrated it yet.
*/
ichss_get(dev, &set);
for (i = 0; i < 2; i++) {
if (sc->sets[i].freq == CPUFREQ_VAL_UNKNOWN) {
first = (i == 0) ? 1 : 0;
ichss_set(dev, &sc->sets[i]);
ichss_set(dev, &sc->sets[first]);
}
}
bcopy(sc->sets, sets, sizeof(sc->sets));
*count = 2;
return (0);
}
static int
ichss_set(device_t dev, const struct cf_setting *set)
{
struct ichss_softc *sc;
uint8_t bmval, new_val, old_val, req_val;
uint64_t rate;
register_t regs;
/* Look up appropriate bit value based on frequency. */
sc = device_get_softc(dev);
if (CPUFREQ_CMP(set->freq, sc->sets[0].freq))
req_val = 0;
else if (CPUFREQ_CMP(set->freq, sc->sets[1].freq))
req_val = ICHSS_CTRL_BIT;
else
return (EINVAL);
DPRINT("ichss: requested setting %d\n", req_val);
/* Disable interrupts and get the other register contents. */
regs = intr_disable();
old_val = ICH_GET_REG(sc->ctrl_reg) & ~ICHSS_CTRL_BIT;
/*
* Disable bus master arbitration, write the new value to the control
* register, and then re-enable bus master arbitration.
*/
bmval = ICH_GET_REG(sc->bm_reg) | ICHSS_BM_DISABLE;
ICH_SET_REG(sc->bm_reg, bmval);
ICH_SET_REG(sc->ctrl_reg, old_val | req_val);
ICH_SET_REG(sc->bm_reg, bmval & ~ICHSS_BM_DISABLE);
/* Get the new value and re-enable interrupts. */
new_val = ICH_GET_REG(sc->ctrl_reg);
intr_restore(regs);
/* Check if the desired state was indeed selected. */
if (req_val != (new_val & ICHSS_CTRL_BIT)) {
device_printf(sc->dev, "transition to %d failed\n", req_val);
return (ENXIO);
}
/* Re-initialize our cycle counter if we don't know this new state. */
if (sc->sets[req_val].freq == CPUFREQ_VAL_UNKNOWN) {
cpu_est_clockrate(0, &rate);
sc->sets[req_val].freq = rate / 1000000;
DPRINT("ichss: set calibrated new rate of %d\n",
sc->sets[req_val].freq);
}
return (0);
}
static int
ichss_get(device_t dev, struct cf_setting *set)
{
struct ichss_softc *sc;
uint64_t rate;
uint8_t state;
sc = device_get_softc(dev);
state = ICH_GET_REG(sc->ctrl_reg) & ICHSS_CTRL_BIT;
/* If we haven't changed settings yet, estimate the current value. */
if (sc->sets[state].freq == CPUFREQ_VAL_UNKNOWN) {
cpu_est_clockrate(0, &rate);
sc->sets[state].freq = rate / 1000000;
DPRINT("ichss: get calibrated new rate of %d\n",
sc->sets[state].freq);
}
*set = sc->sets[state];
return (0);
}
static int
ichss_type(device_t dev, int *type)
{
if (type == NULL)
return (EINVAL);
*type = CPUFREQ_TYPE_ABSOLUTE;
return (0);
}
+4 -3
View File
@@ -854,6 +854,9 @@ fxp_release(struct fxp_softc *sc)
bus_dmamap_destroy(sc->fxp_mtag, rxp->rx_map);
}
bus_dmamap_destroy(sc->fxp_mtag, sc->spare_map);
bus_dma_tag_destroy(sc->fxp_mtag);
}
if (sc->fxp_stag) {
for (i = 0; i < FXP_NTXCB; i++) {
txp = &sc->fxp_desc.tx_list[i];
if (txp->tx_mbuf != NULL) {
@@ -864,10 +867,8 @@ fxp_release(struct fxp_softc *sc)
}
bus_dmamap_destroy(sc->fxp_mtag, txp->tx_map);
}
bus_dma_tag_destroy(sc->fxp_mtag);
}
if (sc->fxp_stag)
bus_dma_tag_destroy(sc->fxp_stag);
}
if (sc->cbl_tag)
bus_dma_tag_destroy(sc->cbl_tag);
if (sc->mcs_tag)
+2 -2
View File
@@ -102,12 +102,12 @@ gdt_make_dev(int unit)
#ifdef SDEV_PER_HBA
dev = make_dev(&iir_cdevsw, hba2minor(unit), UID_ROOT, GID_OPERATOR,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, "iir%d", unit);
S_IRUSR | S_IWUSR, "iir%d", unit);
#else
if (sdev_made)
return (0);
dev = make_dev(&iir_cdevsw, 0, UID_ROOT, GID_OPERATOR,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, "iir");
S_IRUSR | S_IWUSR, "iir");
sdev_made = 1;
#endif
return (dev);
+4 -1
View File
@@ -512,7 +512,6 @@ static __inline int ips_morpheus_check_intr(ips_softc_t *sc)
PRINTF(9, "interrupt registers out:%x\n", oisr);
if(!(oisr & MORPHEUS_BIT_CMD_IRQ)){
DEVICE_PRINTF(2,sc->dev, "got a non-command irq\n");
mtx_unlock(&sc->queue_mtx);
return (0);
}
while((status.value = ips_read_4(sc, MORPHEUS_REG_OQPR)) != 0xffffffff){
@@ -540,6 +539,10 @@ void ips_morpheus_poll(ips_command_t *command)
{
uint32_t ts;
/*
* Locks are not used here because this is only called during
* crashdumps.
*/
ts = time_second + command->timeout;
while ((command->timeout != 0)
&& (ips_morpheus_check_intr(command->sc) == 0)
+1
View File
@@ -130,6 +130,7 @@ static struct ac97_codecid ac97codecid[] = {
{ 0x41445361, 0x00, 0, "AD1886", ad1886_patch },
{ 0x41445362, 0x00, 0, "AD1887", 0 },
{ 0x41445363, 0x00, 0, "AD1886A", 0 },
{ 0x41445368, 0x00, 0, "AD1888", ad198x_patch },
{ 0x41445370, 0x00, 0, "AD1980", ad198x_patch },
{ 0x41445372, 0x00, 0, "AD1981A", 0 },
{ 0x41445374, 0x00, 0, "AD1981B", 0 },
+723 -1991
View File
File diff suppressed because it is too large. Load diff
+6 -9
View File
@@ -25,14 +25,12 @@
* SUCH DAMAGE.
*/
#if 0
#define NO_RECORDING /* XXX: some routines missing from uaudio.c */
#endif
/* Defined in uaudio.c, used in uaudio_pcm,c */
void uaudio_chan_set_param_pcm_dma_buff(device_t dev, u_char *start,
u_char *end, struct pcm_channel *pc, int dir);
u_char *end, struct pcm_channel *pc);
int uaudio_trigger_output(device_t dev);
int uaudio_halt_out_dma(device_t dev);
#ifndef NO_RECORDING
@@ -40,13 +38,12 @@ int uaudio_trigger_input(device_t dev);
int uaudio_halt_in_dma(device_t dev);
#endif
void uaudio_chan_set_param(device_t, u_char *, u_char *);
void uaudio_chan_set_param_blocksize(device_t dev, u_int32_t blocksize, int dir);
void uaudio_chan_set_param_speed(device_t dev, u_int32_t speed, int dir);
void uaudio_chan_set_param_format(device_t dev, u_int32_t format,int dir);
int uaudio_chan_getptr(device_t dev, int);
void uaudio_chan_set_param_blocksize(device_t dev, u_int32_t blocksize);
void uaudio_chan_set_param_speed(device_t dev, u_int32_t speed);
void uaudio_chan_set_param_format(device_t dev, u_int32_t format);
int uaudio_chan_getptr(device_t dev);
void uaudio_mixer_set(device_t dev, unsigned type, unsigned left,
unsigned right);
u_int32_t uaudio_mixer_setrecsrc(device_t dev, u_int32_t src);
u_int32_t uaudio_query_mix_info(device_t dev);
u_int32_t uaudio_query_recsrc_info(device_t dev);
void uaudio_query_formats(device_t dev, u_int32_t *pfmt, u_int32_t *rfmt);
+10 -30
View File
@@ -73,22 +73,13 @@ ua_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *
ch->parent = sc;
ch->channel = c;
ch->buffer = b;
ch->dir = dir;
pa_dev = device_get_parent(sc->sc_dev);
/* Create ua_playfmt[] & ua_recfmt[] */
uaudio_query_formats(pa_dev, (u_int32_t *)&ua_playfmt, (u_int32_t *)&ua_recfmt);
if (dir == PCMDIR_PLAY) {
if (ua_playfmt[0] == 0) {
printf("play channel supported format list invalid\n");
return NULL;
}
} else {
if (ua_recfmt[0] == 0) {
printf("record channel supported format list invalid\n");
return NULL;
}
if (ua_playfmt[0] == 0) {
printf("%s channel supported format list invalid\n", dir == PCMDIR_PLAY? "play" : "record");
return NULL;
}
/* allocate PCM side DMA buffer */
@@ -98,7 +89,7 @@ ua_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *
buf = end = sndbuf_getbuf(b);
end += sndbuf_getsize(b);
uaudio_chan_set_param_pcm_dma_buff(pa_dev, buf, end, ch->channel, dir);
uaudio_chan_set_param_pcm_dma_buff(pa_dev, buf, end, ch->channel);
ch->dir = dir;
#ifndef NO_RECORDING
@@ -122,7 +113,7 @@ ua_chan_setformat(kobj_t obj, void *data, u_int32_t format)
ua = ch->parent;
pa_dev = device_get_parent(ua->sc_dev);
uaudio_chan_set_param_format(pa_dev, format, ch->dir);
uaudio_chan_set_param_format(pa_dev, format);
ch->fmt = format;
return 0;
@@ -139,7 +130,7 @@ ua_chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
ua = ch->parent;
pa_dev = device_get_parent(ua->sc_dev);
uaudio_chan_set_param_speed(pa_dev, speed, ch->dir);
uaudio_chan_set_param_speed(pa_dev, speed);
return ch->spd;
}
@@ -160,7 +151,7 @@ ua_chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
/* XXXXX */
ua = ch->parent;
pa_dev = device_get_parent(ua->sc_dev);
uaudio_chan_set_param_blocksize(pa_dev, blocksize, ch->dir);
uaudio_chan_set_param_blocksize(pa_dev, blocksize);
return ch->blksz;
}
@@ -207,7 +198,7 @@ ua_chan_getptr(kobj_t obj, void *data)
ua = ch->parent;
pa_dev = device_get_parent(ua->sc_dev);
return uaudio_chan_getptr(pa_dev, ch->dir);
return uaudio_chan_getptr(pa_dev);
}
static struct pcmchan_caps *
@@ -244,9 +235,6 @@ ua_mixer_init(struct snd_mixer *m)
mask = uaudio_query_mix_info(pa_dev);
mix_setdevs(m, mask);
mask = uaudio_query_recsrc_info(pa_dev);
mix_setrecdevs(m, mask);
return 0;
}
@@ -265,11 +253,7 @@ ua_mixer_set(struct snd_mixer *m, unsigned type, unsigned left, unsigned right)
static int
ua_mixer_setrecsrc(struct snd_mixer *m, u_int32_t src)
{
device_t pa_dev;
struct ua_info *ua = mix_getdevinfo(m);
pa_dev = device_get_parent(ua->sc_dev);
return uaudio_mixer_setrecsrc(pa_dev, src);
return src;
}
static kobj_method_t ua_mixer_methods[] = {
@@ -322,7 +306,7 @@ ua_attach(device_t dev)
/*highaddr*/BUS_SPACE_MAXADDR,
/*filter*/NULL, /*filterarg*/NULL,
/*maxsize*/bufsz, /*nsegments*/1,
/*maxsegz*/0x4000, /*flags*/0,
/*maxsegz*/0x3fff, /*flags*/0,
/*lockfunc*/busdma_lock_mutex,
/*lockarg*/&Giant,
&ua->parent_dmat) != 0) {
@@ -336,11 +320,7 @@ ua_attach(device_t dev)
snprintf(status, SND_STATUSLEN, "at addr ?");
#ifndef NO_RECORDING
if (pcm_register(dev, ua, 1, 1)) {
#else
if (pcm_register(dev, ua, 1, 0)) {
#endif
return(ENXIO);
}
+4 -28
View File
@@ -40,6 +40,7 @@
#define UAUDIO_VERSION 0x100
#define UDESC_CS_DEVICE 0x21
#define UDESC_CS_CONFIG 0x22
#define UDESC_CS_STRING 0x23
#define UDESC_CS_INTERFACE 0x24
@@ -62,7 +63,7 @@ typedef struct {
uByte bmAttributes;
uWord wMaxPacketSize;
uByte bInterval;
/*
/*
* The following two entries are only used by the Audio Class.
* And according to the specs the Audio Class is the only one
* allowed to extend the endpoint descriptor.
@@ -97,9 +98,6 @@ struct usb_audio_streaming_endpoint_descriptor {
uByte bDescriptorType;
uByte bDescriptorSubtype;
uByte bmAttributes;
#define UA_SED_FREQ_CONTROL 0x01
#define UA_SED_PITCH_CONTROL 0x02
#define UA_SED_MAXPACKETSONLY 0x80
uByte bLockDelayUnits;
uWord wLockDelay;
} UPACKED;
@@ -123,29 +121,9 @@ struct usb_audio_streaming_type1_descriptor {
struct usb_audio_cluster {
uByte bNrChannels;
uWord wChannelConfig;
#define UA_CHANNEL_LEFT 0x0001
#define UA_CHANNEL_RIGHT 0x0002
#define UA_CHANNEL_CENTER 0x0004
#define UA_CHANNEL_LFE 0x0008
#define UA_CHANNEL_L_SURROUND 0x0010
#define UA_CHANNEL_R_SURROUND 0x0020
#define UA_CHANNEL_L_CENTER 0x0040
#define UA_CHANNEL_R_CENTER 0x0080
#define UA_CHANNEL_SURROUND 0x0100
#define UA_CHANNEL_L_SIDE 0x0200
#define UA_CHANNEL_R_SIDE 0x0400
#define UA_CHANNEL_TOP 0x0800
uByte iChannelNames;
} UPACKED;
/* Shared by all units and terminals */
struct usb_audio_unit {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
uByte bUnitId;
};
/* UDESCSUB_AC_INPUT */
struct usb_audio_input_terminal {
uByte bLength;
@@ -362,11 +340,8 @@ struct usb_audio_extension_unit_1 {
#define UA_FMT_IEEE_FLOAT 3
#define UA_FMT_ALAW 4
#define UA_FMT_MULAW 5
#define UA_FMT_MPEG 0x1001
#define UA_FMT_AC3 0x1002
#define SAMPLING_FREQ_CONTROL 0x01
#define PITCH_CONTROL 0x02
#define SAMPLING_FREQ_CONTROL 0x01
#define FORMAT_TYPE_UNDEFINED 0
#define FORMAT_TYPE_I 1
@@ -402,3 +377,4 @@ struct usb_audio_extension_unit_1 {
#define DR_THRESHOLD_CONTROL 4
#define DR_ATTACK_TIME_CONTROL 5
#define DR_RELEASE_TIME_CONTROL 6
-406
View File
@@ -1,406 +0,0 @@
/*
* Copyright (c) 2004-05 Applied Micro Circuits Corporation.
* Copyright (c) 2004-05 Vinod Kashyap
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* AMCC'S 3ware driver for 9000 series storage controllers.
*
* Author: Vinod Kashyap
*/
#ifndef TW_CL_H
#define TW_CL_H
/*
* Common Layer internal macros, structures and functions.
*/
#define TW_CLI_SECTOR_SIZE 0x200
#define TW_CLI_REQUEST_TIMEOUT_PERIOD 60 /* seconds */
#define TW_CLI_RESET_TIMEOUT_PERIOD 60 /* seconds */
#define TW_CLI_MAX_RESET_ATTEMPTS 2
#ifdef TW_OSL_FLASH_FIRMWARE
/* Number of chunks the fw image is broken into, while flashing. */
#define TW_CLI_NUM_FW_IMAGE_CHUNKS 500
#endif /* TW_OSL_FLASH_FIRMWARE */
/* Possible values of ctlr->state. */
/* Initialization done, and controller is active. */
#define TW_CLI_CTLR_STATE_ACTIVE (1<<0)
/* Interrupts on controller enabled. */
#define TW_CLI_CTLR_STATE_INTR_ENABLED (1<<1)
/* Data buffer for internal requests in use. */
#define TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY (1<<2)
/* More AEN's need to be retrieved. */
#define TW_CLI_CTLR_STATE_GET_MORE_AENS (1<<3)
/* Controller is being reset. */
#define TW_CLI_CTLR_STATE_RESET_IN_PROGRESS (1<<4)
/* Possible values of ctlr->ioctl_lock.lock. */
#define TW_CLI_LOCK_FREE 0x0 /* lock is free */
#define TW_CLI_LOCK_HELD 0x1 /* lock is held */
/* Possible values of req->state. */
#define TW_CLI_REQ_STATE_INIT 0x0 /* being initialized */
#define TW_CLI_REQ_STATE_BUSY 0x1 /* submitted to controller */
#define TW_CLI_REQ_STATE_PENDING 0x2 /* in pending queue */
#define TW_CLI_REQ_STATE_COMPLETE 0x3 /* completed by controller */
/* Possible values of req->flags. */
#define TW_CLI_REQ_FLAGS_7K (1<<0) /* 7000 cmd pkt */
#define TW_CLI_REQ_FLAGS_9K (1<<1) /* 9000 cmd pkt */
#define TW_CLI_REQ_FLAGS_INTERNAL (1<<2) /* internal request */
#define TW_CLI_REQ_FLAGS_PASSTHRU (1<<3) /* passthru request */
#define TW_CLI_REQ_FLAGS_EXTERNAL (1<<4) /* external request */
#ifdef TW_OSL_PCI_CONFIG_ACCESSIBLE
/* Register offsets in PCI config space. */
#define TW_CLI_PCI_CONFIG_COMMAND_OFFSET 0x4 /* cmd register offset */
#define TW_CLI_PCI_CONFIG_STATUS_OFFSET 0x6 /* status register offset */
#endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */
#pragma pack(1)
#ifdef TW_OSL_DEBUG
struct tw_cli_q_stats {
TW_UINT32 cur_len;/* current # of entries in q */
TW_UINT32 max_len; /* max # of entries in q, ever reached */
};
#endif /* TW_OSL_DEBUG */
/* Queues of CL internal request context packets. */
#define TW_CLI_FREE_Q 0 /* free q */
#define TW_CLI_BUSY_Q 1 /* q of reqs submitted to fw */
#define TW_CLI_PENDING_Q 2 /* q of reqs deferred due to 'q full' */
#define TW_CLI_COMPLETE_Q 3 /* q of reqs completed by fw */
#define TW_CLI_Q_COUNT 4 /* total number of queues */
/* CL's internal request context. */
struct tw_cli_req_context {
struct tw_cl_req_handle *req_handle;/* handle to track requests between
OSL & CL */
struct tw_cli_ctlr_context *ctlr; /* ptr to CL's controller context */
struct tw_cl_command_packet *cmd_pkt;/* ptr to ctlr cmd pkt */
TW_UINT64 cmd_pkt_phys; /* cmd pkt physical address */
TW_VOID *data; /* ptr to data being passed to fw */
TW_UINT32 length; /* length of data being passed to fw */
TW_UINT64 data_phys; /* physical address of data */
TW_UINT32 state; /* request state */
TW_UINT32 flags; /* request flags */
TW_UINT32 error_code; /* error encountered before submission
of request to fw, if any */
TW_VOID *orig_req; /* ptr to original request for use
during callback */
TW_VOID (*tw_cli_callback)(struct tw_cli_req_context *req);
/* CL internal callback */
TW_UINT32 request_id; /* request id for tracking with fw */
struct tw_cl_link link; /* to link this request in a list */
};
/* CL's internal controller context. */
struct tw_cli_ctlr_context {
struct tw_cl_ctlr_handle *ctlr_handle; /* handle to track ctlr between
OSL & CL. */
struct tw_cli_req_context *req_ctxt_buf;/* pointer to the array of CL's
internal request context pkts */
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
TW_UINT32 free_req_ids[TW_CL_MAX_SIMULTANEOUS_REQUESTS];
/* Array of free req_id's */
struct tw_cli_req_context *busy_reqs[TW_CL_MAX_SIMULTANEOUS_REQUESTS + 1];
/* Array of busy reqs -- index is req_id */
TW_UINT32 free_req_head;
TW_UINT32 free_req_tail;
TW_UINT32 num_free_req_ids;
#endif /* TW_OSL_DMA_MEM_ALLOC_PER_REQUEST */
struct tw_cl_command_packet *cmd_pkt_buf;/* ptr to array of cmd pkts */
TW_UINT64 cmd_pkt_phys; /* phys addr of cmd_pkt_buf */
TW_UINT32 state; /* controller state */
TW_UINT32 flags; /* controller settings */
/* Request queues and arrays. */
struct tw_cl_link req_q_head[TW_CLI_Q_COUNT];
#ifdef TW_OSL_FLASH_FIRMWARE
TW_VOID *flash_dma_mem; /* mem for flashing fw image */
TW_UINT64 flash_dma_mem_phys;/* flash_dma_mem phys addr */
#endif /* TW_OSL_FLASH_FIRMWARE */
TW_UINT8 *internal_req_data;/* internal req data buf */
TW_UINT64 internal_req_data_phys;/* phys addr of internal
req data buf */
TW_UINT32 max_simult_reqs; /* max simultaneous requests
supported */
TW_UINT32 max_aens_supported;/* max AEN's supported */
/* AEN handler fields. */
struct tw_cl_event_packet *aen_queue; /* circular queue of AENs from
firmware/CL/OSL */
TW_UINT32 aen_head; /* AEN queue head */
TW_UINT32 aen_tail; /* AEN queue tail */
TW_UINT32 aen_cur_seq_id; /* index of the last event+1 */
TW_UINT32 aen_q_overflow; /* indicates if unretrieved
events were overwritten */
TW_UINT32 aen_q_wrapped; /* indicates if AEN queue ever
wrapped */
TW_UINT16 working_srl; /* driver & firmware negotiated
srl */
TW_UINT16 working_branch; /* branch # of the firmware
that the driver is compatible with */
TW_UINT16 working_build; /* build # of the firmware
that the driver is compatible with */
TW_UINT32 operating_mode; /* base mode/current mode */
TW_INT32 host_intr_pending;/* host intr processing
needed */
TW_INT32 attn_intr_pending;/* attn intr processing
needed */
TW_INT32 cmd_intr_pending;/* cmd intr processing
needed */
TW_INT32 resp_intr_pending;/* resp intr processing
needed */
TW_LOCK_HANDLE gen_lock_handle;/* general purpose lock */
TW_LOCK_HANDLE *gen_lock;/* ptr to general purpose lock */
TW_LOCK_HANDLE io_lock_handle; /* lock held during cmd
submission */
TW_LOCK_HANDLE *io_lock;/* ptr to lock held during cmd
submission */
TW_LOCK_HANDLE intr_lock_handle;/* lock held during
ISR/response intr processing */
TW_LOCK_HANDLE *intr_lock;/* ptr to lock held during ISR/
response intr processing */
#ifdef TW_OSL_CAN_SLEEP
TW_SLEEP_HANDLE sleep_handle; /* handle to co-ordinate sleeps
& wakeups */
#endif /* TW_OSL_CAN_SLEEP */
struct {
TW_UINT32 lock; /* lock state */
TW_TIME timeout; /* time at which the lock will
become available, even if not
explicitly released */
} ioctl_lock; /* lock for use by user applications, for
synchronization between ioctl calls */
#ifdef TW_OSL_DEBUG
struct tw_cli_q_stats q_stats[TW_CLI_Q_COUNT];/* queue statistics */
#endif /* TW_OSL_DEBUG */
};
#pragma pack()
/*
* Queue primitives
*/
#ifdef TW_OSL_DEBUG
#define TW_CLI_Q_INIT(ctlr, q_type) do { \
(ctlr)->q_stats[q_type].cur_len = 0; \
(ctlr)->q_stats[q_type].max_len = 0; \
} while (0)
#define TW_CLI_Q_INSERT(ctlr, q_type) do { \
struct tw_cli_q_stats *q_stats = &((ctlr)->q_stats[q_type]); \
\
if (++(q_stats->cur_len) > q_stats->max_len) \
q_stats->max_len = q_stats->cur_len; \
} while (0)
#define TW_CLI_Q_REMOVE(ctlr, q_type) \
(ctlr)->q_stats[q_type].cur_len--
#else /* TW_OSL_DEBUG */
#define TW_CLI_Q_INIT(ctlr, q_index)
#define TW_CLI_Q_INSERT(ctlr, q_index)
#define TW_CLI_Q_REMOVE(ctlr, q_index)
#endif /* TW_OSL_DEBUG */
/* Initialize a queue of requests. */
static __inline TW_VOID
tw_cli_req_q_init(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
{
TW_CL_Q_INIT(&(ctlr->req_q_head[q_type]));
TW_CLI_Q_INIT(ctlr, q_type);
}
/* Insert the given request at the head of the given queue (q_type). */
static __inline TW_VOID
tw_cli_req_q_insert_head(struct tw_cli_req_context *req, TW_UINT8 q_type)
{
struct tw_cli_ctlr_context *ctlr = req->ctlr;
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
if ((q_type == TW_CLI_BUSY_Q) || (q_type == TW_CLI_COMPLETE_Q) ||
((q_type == TW_CLI_PENDING_Q) &&
(!(req->flags & TW_CLI_REQ_FLAGS_INTERNAL))))
return;
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock);
TW_CL_Q_INSERT_HEAD(&(ctlr->req_q_head[q_type]), &(req->link));
TW_CLI_Q_INSERT(ctlr, q_type);
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock);
}
/* Insert the given request at the tail of the given queue (q_type). */
static __inline TW_VOID
tw_cli_req_q_insert_tail(struct tw_cli_req_context *req, TW_UINT8 q_type)
{
struct tw_cli_ctlr_context *ctlr = req->ctlr;
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
if ((q_type == TW_CLI_BUSY_Q) || (q_type == TW_CLI_COMPLETE_Q) ||
((q_type == TW_CLI_PENDING_Q) &&
(!(req->flags & TW_CLI_REQ_FLAGS_INTERNAL))))
return;
if ((q_type == TW_CLI_FREE_Q) &&
(!(req->flags & TW_CLI_REQ_FLAGS_INTERNAL))) {
ctlr->free_req_ids[ctlr->free_req_tail] = req->request_id;
ctlr->busy_reqs[req->request_id] = TW_CL_NULL;
ctlr->free_req_tail = (ctlr->free_req_tail + 1) %
(ctlr->max_simult_reqs - 1);
ctlr->num_free_req_ids++;
return;
}
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock);
TW_CL_Q_INSERT_TAIL(&(ctlr->req_q_head[q_type]), &(req->link));
TW_CLI_Q_INSERT(ctlr, q_type);
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock);
}
/* Remove and return the request at the head of the given queue (q_type). */
static __inline struct tw_cli_req_context *
tw_cli_req_q_remove_head(struct tw_cli_ctlr_context *ctlr, TW_UINT8 q_type)
{
struct tw_cli_req_context *req = TW_CL_NULL;
struct tw_cl_link *link;
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
if ((q_type == TW_CLI_BUSY_Q) || (q_type == TW_CLI_COMPLETE_Q))
return(req);
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock);
if ((link = TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[q_type]))) !=
TW_CL_NULL) {
req = TW_CL_STRUCT_HEAD(link,
struct tw_cli_req_context, link);
TW_CL_Q_REMOVE_ITEM(&(ctlr->req_q_head[q_type]), &(req->link));
TW_CLI_Q_REMOVE(ctlr, q_type);
}
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock);
return(req);
}
/* Remove the given request from the given queue (q_type). */
static __inline TW_VOID
tw_cli_req_q_remove_item(struct tw_cli_req_context *req, TW_UINT8 q_type)
{
struct tw_cli_ctlr_context *ctlr = req->ctlr;
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
if ((q_type == TW_CLI_BUSY_Q) || (q_type == TW_CLI_COMPLETE_Q) ||
((q_type == TW_CLI_PENDING_Q) &&
(!(req->flags & TW_CLI_REQ_FLAGS_INTERNAL))))
return;
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
tw_osl_get_lock(ctlr->ctlr_handle, ctlr->gen_lock);
TW_CL_Q_REMOVE_ITEM(&(ctlr->req_q_head[q_type]), &(req->link));
TW_CLI_Q_REMOVE(ctlr, q_type);
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->gen_lock);
}
/* Create an event packet for an event/error posted by the controller. */
#define tw_cli_create_ctlr_event(ctlr, event_src, cmd_hdr) do { \
TW_UINT8 severity = \
GET_SEVERITY((cmd_hdr)->status_block.res__severity); \
\
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_TRUE, event_src, \
(cmd_hdr)->status_block.error, \
severity, \
tw_cli_severity_string_table[severity], \
(cmd_hdr)->err_specific_desc + \
tw_osl_strlen((cmd_hdr)->err_specific_desc) + 1, \
(cmd_hdr)->err_specific_desc); \
/* Print 18 bytes of sense information. */ \
tw_cli_dbg_printf(2, ctlr->ctlr_handle, \
tw_osl_cur_func(), \
"sense info: %x %x %x %x %x %x %x %x %x " \
"%x %x %x %x %x %x %x %x %x", \
(cmd_hdr)->sense_data[0], (cmd_hdr)->sense_data[1], \
(cmd_hdr)->sense_data[2], (cmd_hdr)->sense_data[3], \
(cmd_hdr)->sense_data[4], (cmd_hdr)->sense_data[5], \
(cmd_hdr)->sense_data[6], (cmd_hdr)->sense_data[7], \
(cmd_hdr)->sense_data[8], (cmd_hdr)->sense_data[9], \
(cmd_hdr)->sense_data[10], (cmd_hdr)->sense_data[11], \
(cmd_hdr)->sense_data[12], (cmd_hdr)->sense_data[13], \
(cmd_hdr)->sense_data[14], (cmd_hdr)->sense_data[15], \
(cmd_hdr)->sense_data[16], (cmd_hdr)->sense_data[17]); \
} while (0)
#endif /* TW_CL_H */
-210
View File
@@ -1,210 +0,0 @@
/*
* Copyright (c) 2004-05 Applied Micro Circuits Corporation.
* Copyright (c) 2004-05 Vinod Kashyap
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* AMCC'S 3ware driver for 9000 series storage controllers.
*
* Author: Vinod Kashyap
*/
#ifndef TW_CL_EXTERNS_H
#define TW_CL_EXTERNS_H
/*
* Data structures and functions global to the Common Layer.
*/
extern TW_INT8 tw_cli_fw_img[];
extern TW_INT32 tw_cli_fw_img_size;
extern TW_INT8 *tw_cli_severity_string_table[];
#ifdef TW_OSL_FLASH_FIRMWARE
/* Functions in tw_cl_init.c */
/* Flash bundled firmware image onto controller. */
extern TW_INT32 tw_cli_flash_firmware(struct tw_cli_ctlr_context *ctlr);
/* Hard reset the controller. */
extern TW_INT32 tw_cli_hard_reset(struct tw_cli_ctlr_context *ctlr);
#endif /* TW_OSL_FLASH_FIRMWARE */
/* Do controller initialization. */
extern TW_INT32 tw_cli_start_ctlr(struct tw_cli_ctlr_context *ctlr);
/* Establish a logical connection with the firmware on the controller. */
extern TW_INT32 tw_cli_init_connection(struct tw_cli_ctlr_context *ctlr,
TW_UINT16 message_credits, TW_UINT32 set_features,
TW_UINT16 current_fw_srl, TW_UINT16 current_fw_arch_id,
TW_UINT16 current_fw_branch, TW_UINT16 current_fw_build,
TW_UINT16 *fw_on_ctlr_srl, TW_UINT16 *fw_on_ctlr_arch_id,
TW_UINT16 *fw_on_ctlr_branch, TW_UINT16 *fw_on_ctlr_build,
TW_UINT32 *init_connect_result);
/* Functions in tw_cl_io.c */
/* Submit a command packet to the firmware on the controller. */
extern TW_INT32 tw_cli_submit_cmd(struct tw_cli_req_context *req);
/* Get a firmware parameter. */
extern TW_INT32 tw_cli_get_param(struct tw_cli_ctlr_context *ctlr,
TW_INT32 table_id, TW_INT32 parameter_id, TW_VOID *param_data,
TW_INT32 size, TW_VOID (* callback)(struct tw_cli_req_context *req));
/* Set a firmware parameter. */
extern TW_INT32 tw_cli_set_param(struct tw_cli_ctlr_context *ctlr,
TW_INT32 table_id, TW_INT32 param_id, TW_INT32 param_size,
TW_VOID *data, TW_VOID (* callback)(struct tw_cli_req_context *req));
/* Submit a command to the firmware and poll for completion. */
extern TW_INT32 tw_cli_submit_and_poll_request(struct tw_cli_req_context *req,
TW_UINT32 timeout);
/* Soft reset the controller. */
extern TW_INT32 tw_cli_soft_reset(struct tw_cli_ctlr_context *ctlr);
/* Send down a SCSI command to the firmware (usually, an internal Req Sense. */
extern TW_INT32 tw_cli_send_scsi_cmd(struct tw_cli_req_context *req,
TW_INT32 cmd);
/* Get an AEN from the firmware (by sending down a Req Sense). */
extern TW_INT32 tw_cli_get_aen(struct tw_cli_ctlr_context *ctlr);
/* Fill in the scatter/gather list. */
extern TW_VOID tw_cli_fill_sg_list(struct tw_cli_ctlr_context *ctlr,
TW_VOID *sgl_src, TW_VOID *sgl_dest, TW_INT32 num_sgl_entries);
/* Functions in tw_cl_intr.c */
/* Process a host interrupt. */
extern TW_VOID tw_cli_process_host_intr(struct tw_cli_ctlr_context *ctlr);
/* Process an attention interrupt. */
extern TW_VOID tw_cli_process_attn_intr(struct tw_cli_ctlr_context *ctlr);
/* Process a command interrupt. */
extern TW_VOID tw_cli_process_cmd_intr(struct tw_cli_ctlr_context *ctlr);
/* Process a response interrupt from the controller. */
extern TW_INT32 tw_cli_process_resp_intr(struct tw_cli_ctlr_context *ctlr);
/* Submit any requests in the pending queue to the firmware. */
extern TW_INT32 tw_cli_submit_pending_queue(struct tw_cli_ctlr_context *ctlr);
/* Process all requests in the complete queue. */
extern TW_VOID tw_cli_process_complete_queue(struct tw_cli_ctlr_context *ctlr);
/* CL internal callback for SCSI/fw passthru requests. */
extern TW_VOID tw_cli_complete_io(struct tw_cli_req_context *req);
/* Completion routine for SCSI requests. */
extern TW_VOID tw_cli_scsi_complete(struct tw_cli_req_context *req);
/* Callback for get/set param requests. */
extern TW_VOID tw_cli_param_callback(struct tw_cli_req_context *req);
/* Callback for Req Sense commands to get AEN's. */
extern TW_VOID tw_cli_aen_callback(struct tw_cli_req_context *req);
/* Decide what to do with a retrieved AEN. */
extern TW_UINT16 tw_cli_manage_aen(struct tw_cli_ctlr_context *ctlr,
struct tw_cli_req_context *req);
/* Enable controller interrupts. */
extern TW_VOID
tw_cli_enable_interrupts(struct tw_cli_ctlr_context *ctlr_handle);
/* Disable controller interrupts. */
extern TW_VOID
tw_cli_disable_interrupts(struct tw_cli_ctlr_context *ctlr_handle);
/* Functions in tw_cl_misc.c */
/* Print if dbg_level is appropriate (by calling OS Layer). */
extern TW_VOID tw_cli_dbg_printf(TW_UINT8 dbg_level,
struct tw_cl_ctlr_handle *ctlr_handle, const TW_INT8 *cur_func,
TW_INT8 *fmt, ...);
/* Describe meaning of each set bit in the given register. */
extern TW_INT8 *tw_cli_describe_bits(TW_UINT32 reg, TW_INT8 *str);
/* Complete all requests in the complete queue with a RESET status. */
extern TW_VOID tw_cli_drain_complete_queue(struct tw_cli_ctlr_context *ctlr);
/* Complete all requests in the busy queue with a RESET status. */
extern TW_VOID tw_cli_drain_busy_queue(struct tw_cli_ctlr_context *ctlr);
/* Complete all requests in the pending queue with a RESET status. */
extern TW_VOID tw_cli_drain_pending_queue(struct tw_cli_ctlr_context *ctlr);
/* Drain the controller response queue. */
extern TW_INT32 tw_cli_drain_response_queue(struct tw_cli_ctlr_context *ctlr);
/* Drain the controller AEN queue. */
extern TW_INT32 tw_cli_drain_aen_queue(struct tw_cli_ctlr_context *ctlr);
/* Determine if a given AEN has been posted by the firmware. */
extern TW_INT32 tw_cli_find_aen(struct tw_cli_ctlr_context *ctlr,
TW_UINT16 aen_code);
/* Poll for a given status to show up in the firmware status register. */
extern TW_INT32 tw_cli_poll_status(struct tw_cli_ctlr_context *ctlr,
TW_UINT32 status, TW_UINT32 timeout);
/* Get a free CL internal request context packet. */
extern struct tw_cli_req_context *
tw_cli_get_request(struct tw_cli_ctlr_context *ctlr
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
, struct tw_cl_req_packet *req_pkt
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
);
/* Notify OSL of controller info (fw/BIOS versions, etc.). */
extern TW_VOID tw_cli_notify_ctlr_info(struct tw_cli_ctlr_context *ctlr);
/* Make sure that the firmware status register reports a proper status. */
extern TW_INT32 tw_cli_check_ctlr_state(struct tw_cli_ctlr_context *ctlr,
TW_UINT32 status_reg);
#endif /* TW_CL_EXTERNS_H */
-425
View File
@@ -1,425 +0,0 @@
/*
* Copyright (c) 2004-05 Applied Micro Circuits Corporation.
* Copyright (c) 2004-05 Vinod Kashyap
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* AMCC'S 3ware driver for 9000 series storage controllers.
*
* Author: Vinod Kashyap
*/
#ifndef TW_CL_FWIF_H
#define TW_CL_FWIF_H
/*
* Macros and data structures for interfacing with the firmware.
*/
/* Register offsets from base address. */
#define TWA_CONTROL_REGISTER_OFFSET 0x0
#define TWA_STATUS_REGISTER_OFFSET 0x4
#define TWA_COMMAND_QUEUE_OFFSET 0x8
#define TWA_RESPONSE_QUEUE_OFFSET 0xC
#define TWA_COMMAND_QUEUE_OFFSET_LOW 0x20
#define TWA_COMMAND_QUEUE_OFFSET_HIGH 0x24
/* Control register bit definitions. */
#define TWA_CONTROL_CLEAR_SBUF_WRITE_ERROR 0x00000008
#define TWA_CONTROL_ISSUE_HOST_INTERRUPT 0x00000020
#define TWA_CONTROL_DISABLE_INTERRUPTS 0x00000040
#define TWA_CONTROL_ENABLE_INTERRUPTS 0x00000080
#define TWA_CONTROL_ISSUE_SOFT_RESET 0x00000100
#define TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT 0x00004000
#define TWA_CONTROL_UNMASK_COMMAND_INTERRUPT 0x00008000
#define TWA_CONTROL_MASK_RESPONSE_INTERRUPT 0x00010000
#define TWA_CONTROL_MASK_COMMAND_INTERRUPT 0x00020000
#define TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT 0x00040000
#define TWA_CONTROL_CLEAR_HOST_INTERRUPT 0x00080000
#define TWA_CONTROL_CLEAR_PCI_ABORT 0x00100000
#define TWA_CONTROL_CLEAR_QUEUE_ERROR 0x00400000
#define TWA_CONTROL_CLEAR_PARITY_ERROR 0x00800000
/* Status register bit definitions. */
#define TWA_STATUS_ROM_BIOS_IN_SBUF 0x00000002
#define TWA_STATUS_SBUF_WRITE_ERROR 0x00000008
#define TWA_STATUS_COMMAND_QUEUE_EMPTY 0x00001000
#define TWA_STATUS_MICROCONTROLLER_READY 0x00002000
#define TWA_STATUS_RESPONSE_QUEUE_EMPTY 0x00004000
#define TWA_STATUS_COMMAND_QUEUE_FULL 0x00008000
#define TWA_STATUS_RESPONSE_INTERRUPT 0x00010000
#define TWA_STATUS_COMMAND_INTERRUPT 0x00020000
#define TWA_STATUS_ATTENTION_INTERRUPT 0x00040000
#define TWA_STATUS_HOST_INTERRUPT 0x00080000
#define TWA_STATUS_PCI_ABORT_INTERRUPT 0x00100000
#define TWA_STATUS_MICROCONTROLLER_ERROR 0x00200000
#define TWA_STATUS_QUEUE_ERROR_INTERRUPT 0x00400000
#define TWA_STATUS_PCI_PARITY_ERROR_INTERRUPT 0x00800000
#define TWA_STATUS_MINOR_VERSION_MASK 0x0F000000
#define TWA_STATUS_MAJOR_VERSION_MASK 0xF0000000
#define TWA_STATUS_EXPECTED_BITS 0x00002000
#define TWA_STATUS_UNEXPECTED_BITS 0x00F00000
/* PCI related defines. */
#define TWA_IO_CONFIG_REG 0x10
#define TWA_PCI_CONFIG_CLEAR_PARITY_ERROR 0xc100
#define TWA_PCI_CONFIG_CLEAR_PCI_ABORT 0x2000
/* Command packet opcodes. */
#define TWA_FW_CMD_NOP 0x00
#define TWA_FW_CMD_INIT_CONNECTION 0x01
#define TWA_FW_CMD_READ 0x02
#define TWA_FW_CMD_WRITE 0x03
#define TWA_FW_CMD_READVERIFY 0x04
#define TWA_FW_CMD_VERIFY 0x05
#define TWA_FW_CMD_ZEROUNIT 0x08
#define TWA_FW_CMD_REPLACEUNIT 0x09
#define TWA_FW_CMD_HOTSWAP 0x0A
#define TWA_FW_CMD_SELFTESTS 0x0B
#define TWA_FW_CMD_SYNC_PARAM 0x0C
#define TWA_FW_CMD_REORDER_UNITS 0x0D
#define TWA_FW_CMD_EXECUTE_SCSI 0x10
#define TWA_FW_CMD_ATA_PASSTHROUGH 0x11
#define TWA_FW_CMD_GET_PARAM 0x12
#define TWA_FW_CMD_SET_PARAM 0x13
#define TWA_FW_CMD_CREATEUNIT 0x14
#define TWA_FW_CMD_DELETEUNIT 0x15
#define TWA_FW_CMD_DOWNLOAD_FIRMWARE 0x16
#define TWA_FW_CMD_REBUILDUNIT 0x17
#define TWA_FW_CMD_POWER_MANAGEMENT 0x18
#define TWA_FW_CMD_REMOTE_PRINT 0x1B
#define TWA_FW_CMD_HARD_RESET_FIRMWARE 0x1C
#define TWA_FW_CMD_DEBUG 0x1D
#define TWA_FW_CMD_DIAGNOSTICS 0x1F
/* Misc defines. */
#define TWA_BUNDLED_FW_VERSION_STRING "2.06.00.009"
#define TWA_SHUTDOWN_MESSAGE_CREDITS 0x001
#define TWA_64BIT_SG_ADDRESSES 0x00000001
#define TWA_EXTENDED_INIT_CONNECT 0x00000002
#define TWA_BASE_MODE 1
#define TWA_BASE_FW_SRL 24
#define TWA_BASE_FW_BRANCH 0
#define TWA_BASE_FW_BUILD 1
#define TWA_CURRENT_FW_SRL 28
#define TWA_CURRENT_FW_BRANCH 4
#define TWA_CURRENT_FW_BUILD 9
#define TWA_MULTI_LUN_FW_SRL 28
#define TWA_9000_ARCH_ID 0x5 /* 9000 series controllers */
#define TWA_CTLR_FW_SAME_OR_NEWER 0x00000001
#define TWA_CTLR_FW_COMPATIBLE 0x00000002
#define TWA_BUNDLED_FW_SAFE_TO_FLASH 0x00000004
#define TWA_CTLR_FW_RECOMMENDS_FLASH 0x00000008
#define TWA_SENSE_DATA_LENGTH 18
/*
* All SG addresses and DMA'able memory allocated by the OSL should be
* TWA_ALIGNMENT bytes aligned, and have a size that is a multiple of
* TWA_SG_ELEMENT_SIZE_FACTOR.
*/
#define TWA_ALIGNMENT 0x4
#define TWA_SG_ELEMENT_SIZE_FACTOR 512
/*
* Some errors of interest (in cmd_hdr->status_block.error) when a command
* is completed by the firmware with a bad status.
*/
#define TWA_ERROR_LOGICAL_UNIT_NOT_SUPPORTED 0x010a
#define TWA_ERROR_UNIT_OFFLINE 0x0128
#define TWA_ERROR_MORE_DATA 0x0231
/* AEN codes of interest. */
#define TWA_AEN_QUEUE_EMPTY 0x00
#define TWA_AEN_SOFT_RESET 0x01
#define TWA_AEN_SYNC_TIME_WITH_HOST 0x31
/* Table #'s and id's of parameters of interest in firmware's param table. */
#define TWA_PARAM_VERSION_TABLE 0x0402
#define TWA_PARAM_VERSION_FW 3 /* firmware version [16] */
#define TWA_PARAM_VERSION_BIOS 4 /* BIOSs version [16] */
#define TWA_PARAM_CONTROLLER_TABLE 0x0403
#define TWA_PARAM_CONTROLLER_PORT_COUNT 3 /* number of ports [1] */
#define TWA_PARAM_TIME_TABLE 0x40A
#define TWA_PARAM_TIME_SCHED_TIME 0x3
#define TWA_9K_PARAM_DESCRIPTOR 0x8000
#pragma pack(1)
/* 7000 structures. */
struct tw_cl_command_init_connect {
TW_UINT8 res1__opcode; /* 3:5 */
TW_UINT8 size;
TW_UINT8 request_id;
TW_UINT8 res2;
TW_UINT8 status;
TW_UINT8 flags;
TW_UINT16 message_credits;
TW_UINT32 features;
TW_UINT16 fw_srl;
TW_UINT16 fw_arch_id;
TW_UINT16 fw_branch;
TW_UINT16 fw_build;
TW_UINT32 result;
};
/* Structure for downloading firmware onto the controller. */
struct tw_cl_command_download_firmware {
TW_UINT8 sgl_off__opcode;/* 3:5 */
TW_UINT8 size;
TW_UINT8 request_id;
TW_UINT8 unit;
TW_UINT8 status;
TW_UINT8 flags;
TW_UINT16 param;
TW_UINT8 sgl[1];
};
/* Structure for hard resetting the controller. */
struct tw_cl_command_reset_firmware {
TW_UINT8 res1__opcode; /* 3:5 */
TW_UINT8 size;
TW_UINT8 request_id;
TW_UINT8 unit;
TW_UINT8 status;
TW_UINT8 flags;
TW_UINT8 res2;
TW_UINT8 param;
};
/* Structure for sending get/set param commands. */
struct tw_cl_command_param {
TW_UINT8 sgl_off__opcode;/* 3:5 */
TW_UINT8 size;
TW_UINT8 request_id;
TW_UINT8 host_id__unit; /* 4:4 */
TW_UINT8 status;
TW_UINT8 flags;
TW_UINT16 param_count;
TW_UINT8 sgl[1];
};
/* Generic command packet. */
struct tw_cl_command_generic {
TW_UINT8 sgl_off__opcode;/* 3:5 */
TW_UINT8 size;
TW_UINT8 request_id;
TW_UINT8 host_id__unit; /* 4:4 */
TW_UINT8 status;
TW_UINT8 flags;
TW_UINT16 count; /* block cnt, parameter cnt, message credits */
};
/* Command packet header. */
struct tw_cl_command_header {
TW_UINT8 sense_data[TWA_SENSE_DATA_LENGTH];
struct {
TW_INT8 reserved[4];
TW_UINT16 error;
TW_UINT8 padding;
TW_UINT8 res__severity; /* 5:3 */
} status_block;
TW_UINT8 err_specific_desc[98];
struct {
TW_UINT8 size_header;
TW_UINT16 reserved;
TW_UINT8 size_sense;
} header_desc;
};
/* 7000 Command packet. */
union tw_cl_command_7k {
struct tw_cl_command_init_connect init_connect;
struct tw_cl_command_download_firmware download_fw;
struct tw_cl_command_reset_firmware reset_fw;
struct tw_cl_command_param param;
struct tw_cl_command_generic generic;
TW_UINT8 padding[1024 - sizeof(struct tw_cl_command_header)];
};
/* 9000 Command Packet. */
struct tw_cl_command_9k {
TW_UINT8 res__opcode; /* 3:5 */
TW_UINT8 unit;
TW_UINT16 lun_l4__req_id; /* 4:12 */
TW_UINT8 status;
TW_UINT8 sgl_offset; /* offset (in bytes) to sg_list, from the
end of sgl_entries */
TW_UINT16 lun_h4__sgl_entries;
TW_UINT8 cdb[16];
TW_UINT8 sg_list[872];/* total struct size =
1024-sizeof(cmd_hdr) */
};
/* Full command packet. */
struct tw_cl_command_packet {
struct tw_cl_command_header cmd_hdr;
union {
union tw_cl_command_7k cmd_pkt_7k;
struct tw_cl_command_9k cmd_pkt_9k;
} command;
};
/* Structure describing payload for get/set param commands. */
struct tw_cl_param_9k {
TW_UINT16 table_id;
TW_UINT8 parameter_id;
TW_UINT8 reserved;
TW_UINT16 parameter_size_bytes;
TW_UINT16 parameter_actual_size_bytes;
TW_UINT8 data[1];
};
#pragma pack()
/* Functions to read from, and write to registers */
#define TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, value) \
tw_osl_write_reg(ctlr_handle, TWA_CONTROL_REGISTER_OFFSET, value, 4)
#define TW_CLI_READ_STATUS_REGISTER(ctlr_handle) \
tw_osl_read_reg(ctlr_handle, TWA_STATUS_REGISTER_OFFSET, 4)
#define TW_CLI_WRITE_COMMAND_QUEUE(ctlr_handle, value) do { \
if (ctlr->flags & TW_CL_64BIT_ADDRESSES) { \
/* First write the low 4 bytes, then the high 4. */ \
tw_osl_write_reg(ctlr_handle, TWA_COMMAND_QUEUE_OFFSET_LOW, \
(TW_UINT32)(value), 4); \
tw_osl_write_reg(ctlr_handle, TWA_COMMAND_QUEUE_OFFSET_HIGH,\
(TW_UINT32)(((TW_UINT64)value)>>32), 4); \
} else \
tw_osl_write_reg(ctlr_handle, TWA_COMMAND_QUEUE_OFFSET, \
(TW_UINT32)(value), 4); \
} while (0)
#define TW_CLI_READ_RESPONSE_QUEUE(ctlr_handle) \
tw_osl_read_reg(ctlr_handle, TWA_RESPONSE_QUEUE_OFFSET, 4)
#define TW_CLI_SOFT_RESET(ctlr) \
TW_CLI_WRITE_CONTROL_REGISTER(ctlr, \
TWA_CONTROL_ISSUE_SOFT_RESET | \
TWA_CONTROL_CLEAR_HOST_INTERRUPT | \
TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT | \
TWA_CONTROL_MASK_COMMAND_INTERRUPT | \
TWA_CONTROL_MASK_RESPONSE_INTERRUPT | \
TWA_CONTROL_DISABLE_INTERRUPTS)
/* Detect inconsistencies in the status register. */
#define TW_CLI_STATUS_ERRORS(x) \
((x & TWA_STATUS_UNEXPECTED_BITS) && \
(x & TWA_STATUS_MICROCONTROLLER_READY))
/*
* Functions for making transparent, the bit fields in firmware
* interface structures.
*/
#define BUILD_SGL_OFF__OPCODE(sgl_off, opcode) \
((sgl_off << 5) & 0xE0) | (opcode & 0x1F) /* 3:5 */
#define BUILD_RES__OPCODE(res, opcode) \
((res << 5) & 0xE0) | (opcode & 0x1F) /* 3:5 */
#define BUILD_HOST_ID__UNIT(host_id, unit) \
((host_id << 4) & 0xF0) | (unit & 0xF) /* 4:4 */
#define BUILD_RES__SEVERITY(res, severity) \
((res << 3) & 0xF8) | (severity & 0x7) /* 5:3 */
#define BUILD_LUN_L4__REQ_ID(lun, req_id) \
(((lun << 12) & 0xF000) | (req_id & 0xFFF)) /* 4:12 */
#define BUILD_LUN_H4__SGL_ENTRIES(lun, sgl_entries) \
(((lun << 8) & 0xF000) | (sgl_entries & 0xFFF)) /* 4:12 */
#define GET_OPCODE(sgl_off__opcode) \
(sgl_off__opcode & 0x1F) /* 3:5 */
#define GET_SGL_OFF(sgl_off__opcode) \
((sgl_off__opcode >> 5) & 0x7) /* 3:5 */
#define GET_UNIT(host_id__unit) \
(host_id__unit & 0xF) /* 4:4 */
#define GET_HOST_ID(host_id__unit) \
((host_id__unit >> 4) & 0xF) /* 4:4 */
#define GET_SEVERITY(res__severity) \
(res__severity & 0x7) /* 5:3 */
#define GET_RESP_ID(undef2__resp_id__undef1) \
((undef2__resp_id__undef1 >> 4) & 0xFF) /* 20:8:4 */
#define GET_REQ_ID(lun_l4__req_id) \
(lun_l4__req_id & 0xFFF) /* 4:12 */
#define GET_LUN_L4(lun_l4__req_id) \
((lun_l4__req_id >> 12) & 0xF) /* 4:12 */
#define GET_SGL_ENTRIES(lun_h4__sgl_entries) \
(lun_h4__sgl_entries & 0xFFF) /* 4:12 */
#define GET_LUN_H4(lun_h4__sgl_entries) \
((lun_h4__sgl_entries >> 12) & 0xF) /* 4:12 */
#endif /* TW_CL_FWIF_H */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-826
View File
@@ -1,826 +0,0 @@
/*
* Copyright (c) 2004-05 Applied Micro Circuits Corporation.
* Copyright (c) 2004-05 Vinod Kashyap
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* AMCC'S 3ware driver for 9000 series storage controllers.
*
* Author: Vinod Kashyap
*/
/*
* Common Layer interrupt handling functions.
*/
#include "tw_osl_share.h"
#include "tw_cl_share.h"
#include "tw_cl_fwif.h"
#include "tw_cl_ioctl.h"
#include "tw_cl.h"
#include "tw_cl_externs.h"
#include "tw_osl_ioctl.h"
/*
* Function name: twa_interrupt
* Description: Interrupt handler. Determines the kind of interrupt,
* and returns TW_CL_TRUE if it recognizes the interrupt.
*
* Input: ctlr_handle -- controller handle
* Output: None
* Return value: TW_CL_TRUE -- interrupt recognized
* TW_CL_FALSE-- interrupt not recognized
*/
TW_INT32
tw_cl_interrupt(struct tw_cl_ctlr_handle *ctlr_handle)
{
struct tw_cli_ctlr_context *ctlr =
(struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt);
TW_UINT32 status_reg;
TW_INT32 rc = TW_CL_FALSE;
tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered");
/*
* Serialize access to this function so multiple threads don't try to
* do the same thing (such as clearing interrupt bits).
*/
tw_osl_get_lock(ctlr_handle, ctlr->intr_lock);
/* Read the status register to determine the type of interrupt. */
status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr_handle);
if (tw_cli_check_ctlr_state(ctlr, status_reg))
goto out;
/* Clear the interrupt. */
if (status_reg & TWA_STATUS_HOST_INTERRUPT) {
tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(),
"Host interrupt");
TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle,
TWA_CONTROL_CLEAR_HOST_INTERRUPT);
ctlr->host_intr_pending = 0; /* we don't use this */
rc |= TW_CL_FALSE; /* don't request for a deferred isr call */
}
if (status_reg & TWA_STATUS_ATTENTION_INTERRUPT) {
tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(),
"Attention interrupt");
TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle,
TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT);
ctlr->attn_intr_pending = 1;
rc |= TW_CL_TRUE; /* request for a deferred isr call */
}
if (status_reg & TWA_STATUS_COMMAND_INTERRUPT) {
tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(),
"Command interrupt");
TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle,
TWA_CONTROL_MASK_COMMAND_INTERRUPT);
ctlr->cmd_intr_pending = 1;
rc |= TW_CL_TRUE; /* request for a deferred isr call */
}
if (status_reg & TWA_STATUS_RESPONSE_INTERRUPT) {
tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(),
"Response interrupt");
TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle,
TWA_CONTROL_MASK_RESPONSE_INTERRUPT);
ctlr->resp_intr_pending = 1;
rc |= TW_CL_TRUE; /* request for a deferred isr call */
}
out:
tw_osl_free_lock(ctlr_handle, ctlr->intr_lock);
return(rc);
}
/*
* Function name: tw_cl_deferred_interrupt
* Description: Deferred interrupt handler. Does most of the processing
* related to an interrupt.
*
* Input: ctlr_handle -- controller handle
* Output: None
* Return value: None
*/
TW_VOID
tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle)
{
struct tw_cli_ctlr_context *ctlr =
(struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt);
tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered");
/* Dispatch based on the kind of interrupt. */
if (ctlr->host_intr_pending) {
tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(),
"Processing Host interrupt");
ctlr->host_intr_pending = 0;
tw_cli_process_host_intr(ctlr);
}
if (ctlr->attn_intr_pending) {
tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(),
"Processing Attention interrupt");
ctlr->attn_intr_pending = 0;
tw_cli_process_attn_intr(ctlr);
}
if (ctlr->cmd_intr_pending) {
tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(),
"Processing Command interrupt");
ctlr->cmd_intr_pending = 0;
tw_cli_process_cmd_intr(ctlr);
}
if (ctlr->resp_intr_pending) {
tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(),
"Processing Response interrupt");
ctlr->resp_intr_pending = 0;
tw_cli_process_resp_intr(ctlr);
}
}
/*
* Function name: tw_cli_process_host_intr
* Description: This function gets called if we triggered an interrupt.
* We don't use it as of now.
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_process_host_intr(struct tw_cli_ctlr_context *ctlr)
{
tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
}
/*
* Function name: tw_cli_process_attn_intr
* Description: This function gets called if the fw posted an AEN
* (Asynchronous Event Notification). It fetches
* all the AEN's that the fw might have posted.
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_process_attn_intr(struct tw_cli_ctlr_context *ctlr)
{
TW_INT32 error;
tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
if ((error = tw_cli_get_aen(ctlr))) {
/*
* If the driver is already in the process of retrieveing AEN's,
* we will be returned TW_OSL_EBUSY. In this case,
* tw_cli_param_callback or tw_cli_aen_callback will eventually
* retrieve the AEN this attention interrupt is for. So, we
* don't need to print the failure.
*/
if (error != TW_OSL_EBUSY)
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1200, 0x1, TW_CL_SEVERITY_ERROR_STRING,
"Failed to fetch AEN",
"error = %d", error);
}
}
/*
* Function name: tw_cli_process_cmd_intr
* Description: This function gets called if we hit a queue full
* condition earlier, and the fw is now ready for
* new cmds. Submits any pending requests.
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_process_cmd_intr(struct tw_cli_ctlr_context *ctlr)
{
tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
/*
* Let the OS Layer submit any requests in its pending queue,
* if it has one.
*/
tw_osl_ctlr_ready(ctlr->ctlr_handle);
/* Start any requests that might be in the pending queue. */
tw_cli_submit_pending_queue(ctlr);
/*
* If tw_cli_submit_pending_queue was unsuccessful due to a "cmd queue
* full" condition, cmd_intr will already have been unmasked by
* tw_cli_submit_cmd. We don't need to do it again... simply return.
*/
}
/*
* Function name: tw_cli_process_resp_intr
* Description: Looks for cmd completions from fw; queues cmds completed
* by fw into complete queue.
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: 0 -- no ctlr error
* non-zero-- ctlr error
*/
TW_INT32
tw_cli_process_resp_intr(struct tw_cli_ctlr_context *ctlr)
{
TW_UINT32 resp;
struct tw_cli_req_context *req;
TW_INT32 error;
TW_UINT32 status_reg;
tw_cli_dbg_printf(10, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
/* Serialize access to the controller response queue. */
tw_osl_get_lock(ctlr->ctlr_handle, ctlr->intr_lock);
for (;;) {
status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr->ctlr_handle);
if ((error = tw_cli_check_ctlr_state(ctlr, status_reg)))
break;
if (status_reg & TWA_STATUS_RESPONSE_QUEUE_EMPTY) {
tw_cli_dbg_printf(7, ctlr->ctlr_handle,
tw_osl_cur_func(), "Response queue empty");
break;
}
/* Response queue is not empty. */
resp = TW_CLI_READ_RESPONSE_QUEUE(ctlr->ctlr_handle);
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
if (GET_RESP_ID(resp) >= 1)
req = ctlr->busy_reqs[GET_RESP_ID(resp)];
else
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
{
req = &(ctlr->req_ctxt_buf[GET_RESP_ID(resp)]);
}
if (req->state != TW_CLI_REQ_STATE_BUSY) {
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1201, 0x1, TW_CL_SEVERITY_ERROR_STRING,
"Unposted command completed!!",
"request = %p, status = %d",
req, req->state);
#ifdef TW_OSL_DEBUG
tw_cl_print_ctlr_stats(ctlr->ctlr_handle);
#endif /* TW_OSL_DEBUG */
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock);
tw_cl_reset_ctlr(ctlr->ctlr_handle);
return(TW_OSL_EIO);
}
/*
* Remove the request from the busy queue, mark it as complete,
* and enqueue it in the complete queue.
*/
tw_cli_req_q_remove_item(req, TW_CLI_BUSY_Q);
req->state = TW_CLI_REQ_STATE_COMPLETE;
tw_cli_req_q_insert_tail(req, TW_CLI_COMPLETE_Q);
#ifdef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
/* Call the CL internal callback, if there's one. */
if (req->tw_cli_callback)
req->tw_cli_callback(req);
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
}
/* Unmask the response interrupt. */
TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle,
TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT);
tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock);
#ifndef TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST
/* Complete this, and other requests in the complete queue. */
tw_cli_process_complete_queue(ctlr);
#endif /* TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST */
return(error);
}
/*
* Function name: tw_cli_submit_pending_queue
* Description: Kick starts any requests in the pending queue.
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: 0 -- all pending requests submitted successfully
* non-zero-- otherwise
*/
TW_INT32
tw_cli_submit_pending_queue(struct tw_cli_ctlr_context *ctlr)
{
struct tw_cli_req_context *req;
TW_INT32 error = TW_OSL_ESUCCESS;
tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
/*
* Pull requests off the pending queue, and submit them.
*/
while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_PENDING_Q)) !=
TW_CL_NULL) {
if ((error = tw_cli_submit_cmd(req))) {
if (error == TW_OSL_EBUSY) {
tw_cli_dbg_printf(2, ctlr->ctlr_handle,
tw_osl_cur_func(),
"Requeueing pending request");
req->state = TW_CLI_REQ_STATE_PENDING;
/*
* Queue the request at the head of the pending
* queue, and break away, so we don't try to
* submit any more requests.
*/
tw_cli_req_q_insert_head(req, TW_CLI_PENDING_Q);
break;
} else {
tw_cl_create_event(ctlr->ctlr_handle,
TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1202, 0x1,
TW_CL_SEVERITY_ERROR_STRING,
"Could not start request "
"in pending queue",
"request = %p, opcode = 0x%x, "
"error = %d", req,
GET_OPCODE(req->cmd_pkt->
command.cmd_pkt_9k.res__opcode),
error);
/*
* Set the appropriate error and call the CL
* internal callback if there's one. If the
* request originator is polling for completion,
* he should be checking req->error to
* determine that the request did not go
* through. The request originators are
* responsible for the clean-up.
*/
req->error_code = error;
req->state = TW_CLI_REQ_STATE_COMPLETE;
if (req->tw_cli_callback)
req->tw_cli_callback(req);
error = TW_OSL_ESUCCESS;
}
}
}
return(error);
}
/*
* Function name: tw_cli_process_complete_queue
* Description: Calls the CL internal callback routine, if any, for
* each request in the complete queue.
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_process_complete_queue(struct tw_cli_ctlr_context *ctlr)
{
struct tw_cli_req_context *req;
tw_cli_dbg_printf(10, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
/*
* Pull commands off the completed list, dispatch them appropriately.
*/
while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_COMPLETE_Q)) !=
TW_CL_NULL) {
/* Call the CL internal callback, if there's one. */
if (req->tw_cli_callback)
req->tw_cli_callback(req);
}
}
/*
* Function name: tw_cli_complete_io
* Description: CL internal callback for SCSI/fw passthru requests.
*
* Input: req -- ptr to CL internal request context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_complete_io(struct tw_cli_req_context *req)
{
struct tw_cli_ctlr_context *ctlr = req->ctlr;
struct tw_cl_req_packet *req_pkt =
(struct tw_cl_req_packet *)(req->orig_req);
tw_cli_dbg_printf(8, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
req_pkt->status = TW_CL_ERR_REQ_SUCCESS;
if (req->error_code) {
req_pkt->status = TW_CL_ERR_REQ_UNABLE_TO_SUBMIT_COMMAND;
goto out;
}
if (req->state != TW_CLI_REQ_STATE_COMPLETE) {
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1203, 0x1, TW_CL_SEVERITY_ERROR_STRING,
"I/O completion on incomplete command!!",
"request = %p, status = %d",
req, req->state);
#ifdef TW_OSL_DEBUG
tw_cl_print_ctlr_stats(ctlr->ctlr_handle);
#endif /* TW_OSL_DEBUG */
tw_cl_reset_ctlr(ctlr->ctlr_handle);
req_pkt->status = TW_CL_ERR_REQ_BUS_RESET;
goto out;
}
if (req->flags & TW_CLI_REQ_FLAGS_PASSTHRU) {
/* Copy the command packet back into OSL's space. */
tw_osl_memcpy(req_pkt->gen_req_pkt.pt_req.cmd_pkt, req->cmd_pkt,
sizeof(struct tw_cl_command_packet));
} else
tw_cli_scsi_complete(req);
out:
req_pkt->tw_osl_callback(req->req_handle);
tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q);
}
/*
* Function name: tw_cli_scsi_complete
* Description: Completion routine for SCSI requests.
*
* Input: req -- ptr to CL internal request context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_scsi_complete(struct tw_cli_req_context *req)
{
struct tw_cl_req_packet *req_pkt =
(struct tw_cl_req_packet *)(req->orig_req);
struct tw_cl_scsi_req_packet *scsi_req =
&(req_pkt->gen_req_pkt.scsi_req);
struct tw_cl_command_9k *cmd =
&(req->cmd_pkt->command.cmd_pkt_9k);
struct tw_cl_command_header *cmd_hdr;
TW_UINT16 error;
TW_UINT8 *cdb;
tw_cli_dbg_printf(8, req->ctlr->ctlr_handle, tw_osl_cur_func(),
"entered");
scsi_req->scsi_status = cmd->status;
if (! cmd->status)
return;
tw_cli_dbg_printf(1, req->ctlr->ctlr_handle, tw_osl_cur_func(),
"req_id = 0x%x, status = 0x%x",
GET_REQ_ID(cmd->lun_l4__req_id), cmd->status);
cmd_hdr = &(req->cmd_pkt->cmd_hdr);
error = cmd_hdr->status_block.error;
if ((error == TWA_ERROR_LOGICAL_UNIT_NOT_SUPPORTED) ||
(error == TWA_ERROR_UNIT_OFFLINE)) {
if (GET_LUN_L4(cmd->lun_l4__req_id))
req_pkt->status |= TW_CL_ERR_REQ_INVALID_LUN;
else
req_pkt->status |= TW_CL_ERR_REQ_INVALID_TARGET;
} else {
tw_cli_dbg_printf(2, req->ctlr->ctlr_handle,
tw_osl_cur_func(),
"cmd = %x %x %x %x %x %x %x",
GET_OPCODE(cmd->res__opcode),
GET_SGL_OFF(cmd->res__opcode),
cmd->unit,
cmd->lun_l4__req_id,
cmd->status,
cmd->sgl_offset,
cmd->lun_h4__sgl_entries);
cdb = (TW_UINT8 *)(cmd->cdb);
tw_cli_dbg_printf(2, req->ctlr->ctlr_handle,
tw_osl_cur_func(),
"cdb = %x %x %x %x %x %x %x %x "
"%x %x %x %x %x %x %x %x",
cdb[0], cdb[1], cdb[2], cdb[3],
cdb[4], cdb[5], cdb[6], cdb[7],
cdb[8], cdb[9], cdb[10], cdb[11],
cdb[12], cdb[13], cdb[14], cdb[15]);
/*
* Print the error. Firmware doesn't yet support
* the 'Mode Sense' cmd. Don't print if the cmd
* is 'Mode Sense', and the error is 'Invalid field
* in CDB'.
*/
if (! ((cdb[0] == 0x1A) && (error == 0x10D)))
tw_cli_create_ctlr_event(req->ctlr,
TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR,
cmd_hdr);
}
if (scsi_req->sense_data) {
tw_osl_memcpy(scsi_req->sense_data, cmd_hdr->sense_data,
TWA_SENSE_DATA_LENGTH);
scsi_req->sense_len = TWA_SENSE_DATA_LENGTH;
req_pkt->status |= TW_CL_ERR_REQ_AUTO_SENSE_VALID;
}
req_pkt->status |= TW_CL_ERR_REQ_SCSI_ERROR;
}
/*
* Function name: tw_cli_param_callback
* Description: Callback for get/set_param requests.
*
* Input: req -- ptr to completed request pkt
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_param_callback(struct tw_cli_req_context *req)
{
struct tw_cli_ctlr_context *ctlr = req->ctlr;
union tw_cl_command_7k *cmd =
&(req->cmd_pkt->command.cmd_pkt_7k);
TW_INT32 error;
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
/*
* If the request was never submitted to the controller, the function
* that sets req->error is responsible for calling tw_cl_create_event.
*/
if (! req->error_code)
if (cmd->param.status) {
tw_cli_create_ctlr_event(ctlr,
TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR,
&(req->cmd_pkt->cmd_hdr));
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1204, 0x1, TW_CL_SEVERITY_ERROR_STRING,
"get/set_param failed",
"status = %d", cmd->param.status);
}
ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY;
tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q);
if ((ctlr->state & TW_CLI_CTLR_STATE_GET_MORE_AENS) &&
(!(ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS))) {
ctlr->state &= ~TW_CLI_CTLR_STATE_GET_MORE_AENS;
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(),
"Fetching more AEN's");
if ((error = tw_cli_get_aen(ctlr)))
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1205, 0x1, TW_CL_SEVERITY_ERROR_STRING,
"Failed to fetch all AEN's from param_callback",
"error = %d", error);
}
}
/*
* Function name: tw_cli_aen_callback
* Description: Callback for requests to fetch AEN's.
*
* Input: req -- ptr to completed request pkt
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_aen_callback(struct tw_cli_req_context *req)
{
struct tw_cli_ctlr_context *ctlr = req->ctlr;
struct tw_cl_command_header *cmd_hdr;
struct tw_cl_command_9k *cmd =
&(req->cmd_pkt->command.cmd_pkt_9k);
TW_UINT16 aen_code = TWA_AEN_QUEUE_EMPTY;
TW_INT32 error;
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(),
"req_id = 0x%x, req error = %d, status = 0x%x",
GET_REQ_ID(cmd->lun_l4__req_id), req->error_code, cmd->status);
/*
* If the request was never submitted to the controller, the function
* that sets error is responsible for calling tw_cl_create_event.
*/
if (!(error = req->error_code))
if ((error = cmd->status)) {
cmd_hdr = (struct tw_cl_command_header *)
(&(req->cmd_pkt->cmd_hdr));
tw_cli_create_ctlr_event(ctlr,
TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR,
cmd_hdr);
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1206, 0x1, TW_CL_SEVERITY_ERROR_STRING,
"Request Sense failed",
"opcode = 0x%x, status = %d",
GET_OPCODE(cmd->res__opcode), cmd->status);
}
if (error) {
ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY;
tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q);
return;
}
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(),
"Request Sense command succeeded");
aen_code = tw_cli_manage_aen(ctlr, req);
if (aen_code != TWA_AEN_SYNC_TIME_WITH_HOST) {
ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY;
tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q);
if (aen_code != TWA_AEN_QUEUE_EMPTY)
if ((error = tw_cli_get_aen(ctlr)))
tw_cl_create_event(ctlr->ctlr_handle,
TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1207, 0x1,
TW_CL_SEVERITY_ERROR_STRING,
"Failed to fetch all AEN's",
"error = %d", error);
}
}
/*
* Function name: tw_cli_manage_aen
* Description: Handles AEN's.
*
* Input: ctlr -- ptr to CL internal ctlr context
* req -- ptr to CL internal request context
* Output: None
* Return value: None
*/
TW_UINT16
tw_cli_manage_aen(struct tw_cli_ctlr_context *ctlr,
struct tw_cli_req_context *req)
{
struct tw_cl_command_header *cmd_hdr;
TW_UINT16 aen_code;
TW_TIME local_time;
TW_TIME sync_time;
TW_UINT32 error;
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
cmd_hdr = (struct tw_cl_command_header *)(req->data);
aen_code = cmd_hdr->status_block.error;
switch (aen_code) {
case TWA_AEN_SYNC_TIME_WITH_HOST:
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(),
"Received AEN_SYNC_TIME");
/*
* Free the internal req pkt right here, since
* tw_cli_set_param will need it.
*/
ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY;
tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q);
/*
* We will use a callback in tw_cli_set_param only when
* interrupts are enabled and we can expect our callback
* to get called. Setting the TW_CLI_CTLR_STATE_GET_MORE_AENS
* flag will make the callback continue to try to retrieve
* more AEN's.
*/
if (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED)
ctlr->state |= TW_CLI_CTLR_STATE_GET_MORE_AENS;
/* Calculate time (in seconds) since last Sunday 12.00 AM. */
local_time = tw_osl_get_local_time();
sync_time = (local_time - (3 * 86400)) % 604800;
if ((error = tw_cli_set_param(ctlr, TWA_PARAM_TIME_TABLE,
TWA_PARAM_TIME_SCHED_TIME, 4,
&sync_time,
(ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED)
? tw_cli_param_callback : TW_CL_NULL)))
tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE,
TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR,
0x1208, 0x1, TW_CL_SEVERITY_ERROR_STRING,
"Unable to sync time with ctlr",
"error = %d", error);
break;
case TWA_AEN_QUEUE_EMPTY:
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(),
"AEN queue empty");
break;
default:
/* Queue the event. */
tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(),
"Queueing AEN");
tw_cli_create_ctlr_event(ctlr,
TW_CL_MESSAGE_SOURCE_CONTROLLER_EVENT,
cmd_hdr);
break;
} /* switch */
return(aen_code);
}
/*
* Function name: tw_cli_enable_interrupts
* Description: Enables interrupts on the controller
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_enable_interrupts(struct tw_cli_ctlr_context *ctlr)
{
tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
ctlr->state |= TW_CLI_CTLR_STATE_INTR_ENABLED;
TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle,
TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT |
TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT |
TWA_CONTROL_ENABLE_INTERRUPTS);
}
/*
* Function name: twa_setup
* Description: Disables interrupts on the controller
*
* Input: ctlr -- ptr to CL internal ctlr context
* Output: None
* Return value: None
*/
TW_VOID
tw_cli_disable_interrupts(struct tw_cli_ctlr_context *ctlr)
{
tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered");
TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle,
TWA_CONTROL_DISABLE_INTERRUPTS);
ctlr->state &= ~TW_CLI_CTLR_STATE_INTR_ENABLED;
}
Loaded 100 of 187 files, more files were not shown because too many files have changed in this diff. Show more