xref: /titanic_50/usr/src/lib/libshell/misc/ERRATA.txt (revision 34f9b3eef6fdadbda0a846aa4d68691ac40eace5)
1da2e3ebdSchin#
2da2e3ebdSchin# CDDL HEADER START
3da2e3ebdSchin#
4da2e3ebdSchin# The contents of this file are subject to the terms of the
5da2e3ebdSchin# Common Development and Distribution License (the "License").
6da2e3ebdSchin# You may not use this file except in compliance with the License.
7da2e3ebdSchin#
8da2e3ebdSchin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9da2e3ebdSchin# or http://www.opensolaris.org/os/licensing.
10da2e3ebdSchin# See the License for the specific language governing permissions
11da2e3ebdSchin# and limitations under the License.
12da2e3ebdSchin#
13da2e3ebdSchin# When distributing Covered Code, include this CDDL HEADER in each
14da2e3ebdSchin# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15da2e3ebdSchin# If applicable, add the following below this CDDL HEADER, with the
16da2e3ebdSchin# fields enclosed by brackets "[]" replaced with your own identifying
17da2e3ebdSchin# information: Portions Copyright [yyyy] [name of copyright owner]
18da2e3ebdSchin#
19da2e3ebdSchin# CDDL HEADER END
20da2e3ebdSchin#
217c2fbfb3SApril Chin
22da2e3ebdSchin#
2381af778eSCasper H.S. Dik# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c2fbfb3SApril Chin# Use is subject to license terms.
25da2e3ebdSchin#
26da2e3ebdSchin
27da2e3ebdSchin#
28da2e3ebdSchin# ERRATA.txt
29da2e3ebdSchin#
30da2e3ebdSchin# Errata/problems/notes about problems in the current sources
31da2e3ebdSchin#
32da2e3ebdSchin
33da2e3ebdSchin######## Errata #001: ########
347c2fbfb3SApril ChinThe usage of |posix_spawn()| has been manually disabled because there seems to be a
357c2fbfb3SApril Chinrace condition which cases sporadic failures like this:
36*34f9b3eeSRoland Mainz-- snip --
377c2fbfb3SApril Chin$ builtin | fgrep sum | fgrep sum
387c2fbfb3SApril Chin/usr/ast/bin/sum
397c2fbfb3SApril Chin/usr/bin/sum
407c2fbfb3SApril Chin$ builtin | fgrep sum | fgrep sum
417c2fbfb3SApril Chinfgrep: fgrep: cannot execute [Exec format error]
427c2fbfb3SApril Chin-- snip --.
437c2fbfb3SApril ChinThe following files have been changed:
44da2e3ebdSchin-- snip --
457c2fbfb3SApril ChinIndex: src/lib/libast/sparcv9/include/ast/ast_lib.h
467c2fbfb3SApril Chin===================================================================
47*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/include/ast/ast_lib.h	(revision 888)
48*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/include/ast/ast_lib.h	(working copy)
497c2fbfb3SApril Chin@@ -160,7 +160,7 @@
507c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
517c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
527c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
537c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
547c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
557c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
567c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
577c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
587c2fbfb3SApril ChinIndex: src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
597c2fbfb3SApril Chin===================================================================
60*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h	(revision 888)
61*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h	(working copy)
627c2fbfb3SApril Chin@@ -139,7 +139,7 @@
637c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
647c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
657c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
667c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
677c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
687c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
697c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
707c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
717c2fbfb3SApril ChinIndex: src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
727c2fbfb3SApril Chin===================================================================
73*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib	(revision 888)
74*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib	(working copy)
757c2fbfb3SApril Chin@@ -139,7 +139,7 @@
767c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
777c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
787c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
797c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
807c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
817c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
827c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
837c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
847c2fbfb3SApril ChinIndex: src/lib/libast/sparc/include/ast/ast_lib.h
857c2fbfb3SApril Chin===================================================================
86*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/include/ast/ast_lib.h	(revision 888)
87*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/include/ast/ast_lib.h	(working copy)
887c2fbfb3SApril Chin@@ -171,7 +171,7 @@
897c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
907c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
917c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
927c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
937c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
947c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
957c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
967c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
977c2fbfb3SApril ChinIndex: src/lib/libast/sparc/src/lib/libast/ast_lib.h
987c2fbfb3SApril Chin===================================================================
99*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h	(revision 888)
100*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h	(working copy)
1017c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1027c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1037c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1047c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1057c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1067c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1077c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1087c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1097c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1107c2fbfb3SApril ChinIndex: src/lib/libast/sparc/src/lib/libast/FEATURE/lib
1117c2fbfb3SApril Chin===================================================================
112*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib	(revision 888)
113*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib	(working copy)
1147c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1157c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1167c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1177c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1187c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1197c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1207c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1217c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1227c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1237c2fbfb3SApril ChinIndex: src/lib/libast/i386/include/ast/ast_lib.h
1247c2fbfb3SApril Chin===================================================================
125*34f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/include/ast/ast_lib.h	(revision 888)
126*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/include/ast/ast_lib.h	(working copy)
1277c2fbfb3SApril Chin@@ -171,7 +171,7 @@
1287c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1297c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1307c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1317c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1327c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1337c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1347c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1357c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1367c2fbfb3SApril ChinIndex: src/lib/libast/i386/src/lib/libast/ast_lib.h
1377c2fbfb3SApril Chin===================================================================
138*34f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/ast_lib.h	(revision 888)
139*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/ast_lib.h	(working copy)
1407c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1417c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1427c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1437c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1447c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1457c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1467c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1477c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1487c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1497c2fbfb3SApril ChinIndex: src/lib/libast/i386/src/lib/libast/FEATURE/lib
1507c2fbfb3SApril Chin===================================================================
151*34f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib	(revision 888)
152*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib	(working copy)
1537c2fbfb3SApril Chin@@ -150,7 +150,7 @@
1547c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1557c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1567c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1577c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1587c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1597c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1607c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1617c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1627c2fbfb3SApril ChinIndex: src/lib/libast/amd64/include/ast/ast_lib.h
1637c2fbfb3SApril Chin===================================================================
164*34f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/include/ast/ast_lib.h	(revision 888)
165*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/include/ast/ast_lib.h	(working copy)
1667c2fbfb3SApril Chin@@ -160,7 +160,7 @@
1677c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1687c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1697c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1707c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1717c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1727c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1737c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1747c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1757c2fbfb3SApril ChinIndex: src/lib/libast/amd64/src/lib/libast/ast_lib.h
1767c2fbfb3SApril Chin===================================================================
177*34f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h	(revision 888)
178*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h	(working copy)
1797c2fbfb3SApril Chin@@ -139,7 +139,7 @@
1807c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1817c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1827c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1837c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1847c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1857c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1867c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
1877c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
1887c2fbfb3SApril ChinIndex: src/lib/libast/amd64/src/lib/libast/FEATURE/lib
1897c2fbfb3SApril Chin===================================================================
190*34f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib	(revision 888)
191*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib	(working copy)
1927c2fbfb3SApril Chin@@ -139,7 +139,7 @@
1937c2fbfb3SApril Chin #define _hdr_unistd	1	/* #include <unistd.h> ok */
1947c2fbfb3SApril Chin #define _lib_vfork	1	/* vfork exists and it works */
1957c2fbfb3SApril Chin #define _real_vfork	1	/* vfork child shares data with parent */
1967c2fbfb3SApril Chin-#define _lib_posix_spawn	2	/* posix_spawn exists and it works and its worth using */
1977c2fbfb3SApril Chin+#define _lib_posix_spawn	1	/* posix_spawn exists and it works and its worth using */
1987c2fbfb3SApril Chin #define _stream_peek	1	/* ioctl(I_PEEK) works */
1997c2fbfb3SApril Chin #define _socket_peek	1	/* recv(MSG_PEEK) works */
2007c2fbfb3SApril Chin #define _hdr_string	1	/* #include <string.h> ok */
201da2e3ebdSchin-- snip --
202da2e3ebdSchin
203da2e3ebdSchin
204da2e3ebdSchin######## Errata #002: ########
205*34f9b3eeSRoland MainzThe usage of |mmap()| has been manually enabled to improve I/O performance.
206*34f9b3eeSRoland MainzThe following files have been changed:
207*34f9b3eeSRoland Mainz-- snip --
208*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
209*34f9b3eeSRoland Mainz===================================================================
210*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h	(revision 1701)
211*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h	(working copy)
212*34f9b3eeSRoland Mainz@@ -28,6 +28,7 @@
213*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
214*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
215*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
216*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
217*34f9b3eeSRoland Mainz
218*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
219*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
220*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
221*34f9b3eeSRoland Mainz===================================================================
222*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h	(revision 1701)
223*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h	(working copy)
224*34f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
225*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
226*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
227*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
228*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
229*34f9b3eeSRoland Mainz
230*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
231*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
232*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
233*34f9b3eeSRoland Mainz===================================================================
234*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap	(revision 1701)
235*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap	(working copy)
236*34f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
237*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
238*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
239*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
240*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
241*34f9b3eeSRoland Mainz
242*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
243*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
244*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparc/include/ast/ast_mmap.h
245*34f9b3eeSRoland Mainz===================================================================
246*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/include/ast/ast_mmap.h	(revision 1701)
247*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/include/ast/ast_mmap.h	(working copy)
248*34f9b3eeSRoland Mainz@@ -28,7 +28,7 @@
249*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
250*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
251*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
252*34f9b3eeSRoland Mainz-#define _mmap_worthy	1	/* mmap is good */
253*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
254*34f9b3eeSRoland Mainz
255*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
256*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
257*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
258*34f9b3eeSRoland Mainz===================================================================
259*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h	(revision 1701)
260*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h	(working copy)
261*34f9b3eeSRoland Mainz@@ -7,7 +7,7 @@
262*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
263*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
264*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
265*34f9b3eeSRoland Mainz-#define _mmap_worthy	1	/* mmap is good */
266*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
267*34f9b3eeSRoland Mainz
268*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
269*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
270*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
271*34f9b3eeSRoland Mainz===================================================================
272*34f9b3eeSRoland Mainz--- usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap	(revision 1701)
273*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap	(working copy)
274*34f9b3eeSRoland Mainz@@ -7,7 +7,7 @@
275*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
276*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
277*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
278*34f9b3eeSRoland Mainz-#define _mmap_worthy	1	/* mmap is good */
279*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
280*34f9b3eeSRoland Mainz
281*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
282*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
283*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/i386/include/ast/ast_mmap.h
284*34f9b3eeSRoland Mainz===================================================================
285*34f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/include/ast/ast_mmap.h	(revision 1701)
286*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/include/ast/ast_mmap.h	(working copy)
287*34f9b3eeSRoland Mainz@@ -28,6 +28,7 @@
288*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
289*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
290*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
291*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
292*34f9b3eeSRoland Mainz
293*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
294*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
295*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
296*34f9b3eeSRoland Mainz===================================================================
297*34f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h	(revision 1701)
298*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h	(working copy)
299*34f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
300*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
301*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
302*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
303*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
304*34f9b3eeSRoland Mainz
305*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
306*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
307*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
308*34f9b3eeSRoland Mainz===================================================================
309*34f9b3eeSRoland Mainz--- usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap	(revision 1701)
310*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap	(working copy)
311*34f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
312*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
313*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
314*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
315*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
316*34f9b3eeSRoland Mainz
317*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
318*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
319*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/amd64/include/ast/ast_mmap.h
320*34f9b3eeSRoland Mainz===================================================================
321*34f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/include/ast/ast_mmap.h	(revision 1701)
322*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/include/ast/ast_mmap.h	(working copy)
323*34f9b3eeSRoland Mainz@@ -28,6 +28,7 @@
324*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
325*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
326*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
327*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
328*34f9b3eeSRoland Mainz
329*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
330*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
331*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
332*34f9b3eeSRoland Mainz===================================================================
333*34f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h	(revision 1701)
334*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h	(working copy)
335*34f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
336*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
337*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
338*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
339*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
340*34f9b3eeSRoland Mainz
341*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
342*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
343*34f9b3eeSRoland MainzIndex: usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
344*34f9b3eeSRoland Mainz===================================================================
345*34f9b3eeSRoland Mainz--- usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap	(revision 1701)
346*34f9b3eeSRoland Mainz+++ usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap	(working copy)
347*34f9b3eeSRoland Mainz@@ -7,6 +7,7 @@
348*34f9b3eeSRoland Mainz #define _lib_mmap64	1	/* mmap64 interface and implementation work */
349*34f9b3eeSRoland Mainz #define _mmap_anon	1	/* use mmap MAP_ANON to get raw memory */
350*34f9b3eeSRoland Mainz #define _mmap_devzero	1	/* use mmap on /dev/zero to get raw memory */
351*34f9b3eeSRoland Mainz+#define _mmap_worthy	2	/* mmap is good */
352*34f9b3eeSRoland Mainz
353*34f9b3eeSRoland Mainz /* some systems get it wrong but escape concise detection */
354*34f9b3eeSRoland Mainz #ifndef _NO_MMAP
355*34f9b3eeSRoland Mainz-- snip --
356*34f9b3eeSRoland Mainz
357*34f9b3eeSRoland Mainz
358*34f9b3eeSRoland Mainz######## Errata #003: ########
3597c2fbfb3SApril ChinA workaround was added for a problem with the "multiline" editor mode which
3607c2fbfb3SApril Chinoccurs when the edit line becomes longer than the terminal's width and the
3617c2fbfb3SApril Chinterminal cursor is not at position 0 when PS1 is send to the terminal.
362da2e3ebdSchin
3637c2fbfb3SApril ChinFor example: The user executes a $ printf "foo"<enter> # the prompt will start
3647c2fbfb3SApril Chinat position 3 instead of 0. If the user enters a command which is longer than
3657c2fbfb3SApril Chinthe terminal width and then removes enougth characters that the edit line fits
3667c2fbfb3SApril Chinagain into one line the "foo" at the beginning will be overwritten with the
3677c2fbfb3SApril Chinprompt.
3687c2fbfb3SApril Chin
3697c2fbfb3SApril ChinThe workaround is to add $(printf "%*s\r%s" COLUMNS "") at the beginning of
3707c2fbfb3SApril ChinPS1 set by /etc/ksh.kshrc, this causes the shell to move to the beginning
3717c2fbfb3SApril Chinof the next line if the terminal cursor is not at position 0.
372da2e3ebdSchin
373da2e3ebdSchin
37481af778eSCasper H.S. Dik######## Errata #004: ########
375*34f9b3eeSRoland MainzA workaround has been added for a probem with the AST "tail" builtin which
376*34f9b3eeSRoland Mainzcauses "tail" to sleep too long when polling for data in "follow" mode.
37781af778eSCasper H.S. DikThe following files have been changed:
37881af778eSCasper H.S. Dik-- snip --
379*34f9b3eeSRoland MainzIndex: src/lib/libcmd/common/tail.c
38081af778eSCasper H.S. Dik===================================================================
381*34f9b3eeSRoland Mainz--- usr/src/lib/libcmd/common/tail.c	(revision 1701)
382*34f9b3eeSRoland Mainz+++ usr/src/lib/libcmd/common/tail.c	(working copy)
383*34f9b3eeSRoland Mainz@@ -636,7 +636,14 @@
38481af778eSCasper H.S. Dik 		{
385*34f9b3eeSRoland Mainz 			if (sfsync(sfstdout))
386*34f9b3eeSRoland Mainz 				error(ERROR_system(1), "write error");
387*34f9b3eeSRoland Mainz+#if 0
388*34f9b3eeSRoland Mainz 			sleep(1);
389*34f9b3eeSRoland Mainz+#else
39081af778eSCasper H.S. Dik+			{
391*34f9b3eeSRoland Mainz+				struct timespec rqt = { 0L, 1000000000L/4L };
392*34f9b3eeSRoland Mainz+				(void)nanosleep(&rqt, NULL);
39381af778eSCasper H.S. Dik+			}
394*34f9b3eeSRoland Mainz+#endif
395*34f9b3eeSRoland Mainz 			n = 0;
396*34f9b3eeSRoland Mainz 			pp = 0;
397*34f9b3eeSRoland Mainz 			while (fp)
39881af778eSCasper H.S. Dik-- snip --
3999a6f360eSCasper H.S. Dik
4009a6f360eSCasper H.S. Dik
4019a6f360eSCasper H.S. Dik######## Errata #005: ########
402*34f9b3eeSRoland MainzThe POSIX "cksum"/CRC and AT&T "sum" codepaths in libsum have been reworked
403*34f9b3eeSRoland Mainzand then backpoprted to address a performance regression on some
404*34f9b3eeSRoland Mainzmachine/architecture combinations.
4059a6f360eSCasper H.S. DikThe following files have been changed:
4069a6f360eSCasper H.S. Dik-- snip --
407*34f9b3eeSRoland MainzIndex: usr/src/lib/libsum/common/sum-crc.c
408*34f9b3eeSRoland Mainz===================================================================
409*34f9b3eeSRoland Mainz--- usr/src/lib/libsum/common/sum-crc.c	(revision 1724)
410*34f9b3eeSRoland Mainz+++ usr/src/lib/libsum/common/sum-crc.c	(working copy)
411*34f9b3eeSRoland Mainz@@ -48,7 +48,8 @@
412*34f9b3eeSRoland Mainz 	Crcnum_t		init;
413*34f9b3eeSRoland Mainz 	Crcnum_t		done;
414*34f9b3eeSRoland Mainz 	Crcnum_t		xorsize;
415*34f9b3eeSRoland Mainz-	Crcnum_t		tab[256];
416*34f9b3eeSRoland Mainz+	const Crcnum_t		*tab; /* use |const| to give the compiler a hint that the data won't change */
417*34f9b3eeSRoland Mainz+	Crcnum_t		tabdata[256];
418*34f9b3eeSRoland Mainz 	unsigned int		addsize;
419*34f9b3eeSRoland Mainz 	unsigned int		rotate;
420*34f9b3eeSRoland Mainz } Crc_t;
421*34f9b3eeSRoland Mainz@@ -56,6 +57,62 @@
422*34f9b3eeSRoland Mainz #define CRC(p,s,c)		(s = (s >> 8) ^ (p)->tab[(s ^ (c)) & 0xff])
423*34f9b3eeSRoland Mainz #define CRCROTATE(p,s,c)	(s = (s << 8) ^ (p)->tab[((s >> 24) ^ (c)) & 0xff])
4249a6f360eSCasper H.S. Dik
425*34f9b3eeSRoland Mainz+static const
426*34f9b3eeSRoland Mainz+Crcnum_t posix_cksum_tab[256] = {
427*34f9b3eeSRoland Mainz+	0x00000000U,
428*34f9b3eeSRoland Mainz+	0x04c11db7U, 0x09823b6eU, 0x0d4326d9U, 0x130476dcU, 0x17c56b6bU,
429*34f9b3eeSRoland Mainz+	0x1a864db2U, 0x1e475005U, 0x2608edb8U, 0x22c9f00fU, 0x2f8ad6d6U,
430*34f9b3eeSRoland Mainz+	0x2b4bcb61U, 0x350c9b64U, 0x31cd86d3U, 0x3c8ea00aU, 0x384fbdbdU,
431*34f9b3eeSRoland Mainz+	0x4c11db70U, 0x48d0c6c7U, 0x4593e01eU, 0x4152fda9U, 0x5f15adacU,
432*34f9b3eeSRoland Mainz+	0x5bd4b01bU, 0x569796c2U, 0x52568b75U, 0x6a1936c8U, 0x6ed82b7fU,
433*34f9b3eeSRoland Mainz+	0x639b0da6U, 0x675a1011U, 0x791d4014U, 0x7ddc5da3U, 0x709f7b7aU,
434*34f9b3eeSRoland Mainz+	0x745e66cdU, 0x9823b6e0U, 0x9ce2ab57U, 0x91a18d8eU, 0x95609039U,
435*34f9b3eeSRoland Mainz+	0x8b27c03cU, 0x8fe6dd8bU, 0x82a5fb52U, 0x8664e6e5U, 0xbe2b5b58U,
436*34f9b3eeSRoland Mainz+	0xbaea46efU, 0xb7a96036U, 0xb3687d81U, 0xad2f2d84U, 0xa9ee3033U,
437*34f9b3eeSRoland Mainz+	0xa4ad16eaU, 0xa06c0b5dU, 0xd4326d90U, 0xd0f37027U, 0xddb056feU,
438*34f9b3eeSRoland Mainz+	0xd9714b49U, 0xc7361b4cU, 0xc3f706fbU, 0xceb42022U, 0xca753d95U,
439*34f9b3eeSRoland Mainz+	0xf23a8028U, 0xf6fb9d9fU, 0xfbb8bb46U, 0xff79a6f1U, 0xe13ef6f4U,
440*34f9b3eeSRoland Mainz+	0xe5ffeb43U, 0xe8bccd9aU, 0xec7dd02dU, 0x34867077U, 0x30476dc0U,
441*34f9b3eeSRoland Mainz+	0x3d044b19U, 0x39c556aeU, 0x278206abU, 0x23431b1cU, 0x2e003dc5U,
442*34f9b3eeSRoland Mainz+	0x2ac12072U, 0x128e9dcfU, 0x164f8078U, 0x1b0ca6a1U, 0x1fcdbb16U,
443*34f9b3eeSRoland Mainz+	0x018aeb13U, 0x054bf6a4U, 0x0808d07dU, 0x0cc9cdcaU, 0x7897ab07U,
444*34f9b3eeSRoland Mainz+	0x7c56b6b0U, 0x71159069U, 0x75d48ddeU, 0x6b93dddbU, 0x6f52c06cU,
445*34f9b3eeSRoland Mainz+	0x6211e6b5U, 0x66d0fb02U, 0x5e9f46bfU, 0x5a5e5b08U, 0x571d7dd1U,
446*34f9b3eeSRoland Mainz+	0x53dc6066U, 0x4d9b3063U, 0x495a2dd4U, 0x44190b0dU, 0x40d816baU,
447*34f9b3eeSRoland Mainz+	0xaca5c697U, 0xa864db20U, 0xa527fdf9U, 0xa1e6e04eU, 0xbfa1b04bU,
448*34f9b3eeSRoland Mainz+	0xbb60adfcU, 0xb6238b25U, 0xb2e29692U, 0x8aad2b2fU, 0x8e6c3698U,
449*34f9b3eeSRoland Mainz+	0x832f1041U, 0x87ee0df6U, 0x99a95df3U, 0x9d684044U, 0x902b669dU,
450*34f9b3eeSRoland Mainz+	0x94ea7b2aU, 0xe0b41de7U, 0xe4750050U, 0xe9362689U, 0xedf73b3eU,
451*34f9b3eeSRoland Mainz+	0xf3b06b3bU, 0xf771768cU, 0xfa325055U, 0xfef34de2U, 0xc6bcf05fU,
452*34f9b3eeSRoland Mainz+	0xc27dede8U, 0xcf3ecb31U, 0xcbffd686U, 0xd5b88683U, 0xd1799b34U,
453*34f9b3eeSRoland Mainz+	0xdc3abdedU, 0xd8fba05aU, 0x690ce0eeU, 0x6dcdfd59U, 0x608edb80U,
454*34f9b3eeSRoland Mainz+	0x644fc637U, 0x7a089632U, 0x7ec98b85U, 0x738aad5cU, 0x774bb0ebU,
455*34f9b3eeSRoland Mainz+	0x4f040d56U, 0x4bc510e1U, 0x46863638U, 0x42472b8fU, 0x5c007b8aU,
456*34f9b3eeSRoland Mainz+	0x58c1663dU, 0x558240e4U, 0x51435d53U, 0x251d3b9eU, 0x21dc2629U,
457*34f9b3eeSRoland Mainz+	0x2c9f00f0U, 0x285e1d47U, 0x36194d42U, 0x32d850f5U, 0x3f9b762cU,
458*34f9b3eeSRoland Mainz+	0x3b5a6b9bU, 0x0315d626U, 0x07d4cb91U, 0x0a97ed48U, 0x0e56f0ffU,
459*34f9b3eeSRoland Mainz+	0x1011a0faU, 0x14d0bd4dU, 0x19939b94U, 0x1d528623U, 0xf12f560eU,
460*34f9b3eeSRoland Mainz+	0xf5ee4bb9U, 0xf8ad6d60U, 0xfc6c70d7U, 0xe22b20d2U, 0xe6ea3d65U,
461*34f9b3eeSRoland Mainz+	0xeba91bbcU, 0xef68060bU, 0xd727bbb6U, 0xd3e6a601U, 0xdea580d8U,
462*34f9b3eeSRoland Mainz+	0xda649d6fU, 0xc423cd6aU, 0xc0e2d0ddU, 0xcda1f604U, 0xc960ebb3U,
463*34f9b3eeSRoland Mainz+	0xbd3e8d7eU, 0xb9ff90c9U, 0xb4bcb610U, 0xb07daba7U, 0xae3afba2U,
464*34f9b3eeSRoland Mainz+	0xaafbe615U, 0xa7b8c0ccU, 0xa379dd7bU, 0x9b3660c6U, 0x9ff77d71U,
465*34f9b3eeSRoland Mainz+	0x92b45ba8U, 0x9675461fU, 0x8832161aU, 0x8cf30badU, 0x81b02d74U,
466*34f9b3eeSRoland Mainz+	0x857130c3U, 0x5d8a9099U, 0x594b8d2eU, 0x5408abf7U, 0x50c9b640U,
467*34f9b3eeSRoland Mainz+	0x4e8ee645U, 0x4a4ffbf2U, 0x470cdd2bU, 0x43cdc09cU, 0x7b827d21U,
468*34f9b3eeSRoland Mainz+	0x7f436096U, 0x7200464fU, 0x76c15bf8U, 0x68860bfdU, 0x6c47164aU,
469*34f9b3eeSRoland Mainz+	0x61043093U, 0x65c52d24U, 0x119b4be9U, 0x155a565eU, 0x18197087U,
470*34f9b3eeSRoland Mainz+	0x1cd86d30U, 0x029f3d35U, 0x065e2082U, 0x0b1d065bU, 0x0fdc1becU,
471*34f9b3eeSRoland Mainz+	0x3793a651U, 0x3352bbe6U, 0x3e119d3fU, 0x3ad08088U, 0x2497d08dU,
472*34f9b3eeSRoland Mainz+	0x2056cd3aU, 0x2d15ebe3U, 0x29d4f654U, 0xc5a92679U, 0xc1683bceU,
473*34f9b3eeSRoland Mainz+	0xcc2b1d17U, 0xc8ea00a0U, 0xd6ad50a5U, 0xd26c4d12U, 0xdf2f6bcbU,
474*34f9b3eeSRoland Mainz+	0xdbee767cU, 0xe3a1cbc1U, 0xe760d676U, 0xea23f0afU, 0xeee2ed18U,
475*34f9b3eeSRoland Mainz+	0xf0a5bd1dU, 0xf464a0aaU, 0xf9278673U, 0xfde69bc4U, 0x89b8fd09U,
476*34f9b3eeSRoland Mainz+	0x8d79e0beU, 0x803ac667U, 0x84fbdbd0U, 0x9abc8bd5U, 0x9e7d9662U,
477*34f9b3eeSRoland Mainz+	0x933eb0bbU, 0x97ffad0cU, 0xafb010b1U, 0xab710d06U, 0xa6322bdfU,
478*34f9b3eeSRoland Mainz+	0xa2f33668U, 0xbcb4666dU, 0xb8757bdaU, 0xb5365d03U, 0xb1f740b4U
479*34f9b3eeSRoland Mainz+};
480*34f9b3eeSRoland Mainz+
481*34f9b3eeSRoland Mainz static Sum_t*
482*34f9b3eeSRoland Mainz crc_open(const Method_t* method, const char* name)
483*34f9b3eeSRoland Mainz {
484*34f9b3eeSRoland Mainz@@ -73,62 +130,80 @@
485*34f9b3eeSRoland Mainz 		sum->method = (Method_t*)method;
486*34f9b3eeSRoland Mainz 		sum->name = name;
487*34f9b3eeSRoland Mainz 	}
488*34f9b3eeSRoland Mainz-	polynomial = 0xedb88320;
489*34f9b3eeSRoland Mainz-	s = name;
490*34f9b3eeSRoland Mainz-	while (*(t = s))
491*34f9b3eeSRoland Mainz+
492*34f9b3eeSRoland Mainz+	if(!strcmp(name, "crc-0x04c11db7-rotate-done-size"))
493*34f9b3eeSRoland Mainz 	{
494*34f9b3eeSRoland Mainz-		for (t = s, v = 0; *s && *s != '-'; s++)
495*34f9b3eeSRoland Mainz-			if (*s == '=' && !v)
496*34f9b3eeSRoland Mainz-				v = s;
497*34f9b3eeSRoland Mainz-		i = (v ? v : s) - t;
498*34f9b3eeSRoland Mainz-		if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
499*34f9b3eeSRoland Mainz-			polynomial = strtoul(t, NiL, 0);
500*34f9b3eeSRoland Mainz-		else if (strneq(t, "done", i))
501*34f9b3eeSRoland Mainz-			sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
502*34f9b3eeSRoland Mainz-		else if (strneq(t, "init", i))
503*34f9b3eeSRoland Mainz-			sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
504*34f9b3eeSRoland Mainz-		else if (strneq(t, "rotate", i))
505*34f9b3eeSRoland Mainz-			sum->rotate = 1;
506*34f9b3eeSRoland Mainz-		else if (strneq(t, "size", i))
507*34f9b3eeSRoland Mainz-		{
508*34f9b3eeSRoland Mainz-			sum->addsize = 1;
509*34f9b3eeSRoland Mainz-			if (v)
510*34f9b3eeSRoland Mainz-				sum->xorsize = strtoul(v + 1, NiL, 0);
511*34f9b3eeSRoland Mainz-		}
512*34f9b3eeSRoland Mainz-		if (*s == '-')
513*34f9b3eeSRoland Mainz-			s++;
514*34f9b3eeSRoland Mainz+		sum->init=0;
515*34f9b3eeSRoland Mainz+		sum->done=0xffffffff;
516*34f9b3eeSRoland Mainz+		sum->xorsize=0x0;
517*34f9b3eeSRoland Mainz+		sum->addsize=0x1;
518*34f9b3eeSRoland Mainz+		sum->rotate=1;
519*34f9b3eeSRoland Mainz+
520*34f9b3eeSRoland Mainz+		/* Optimized codepath for POSIX cksum to save startup time */
521*34f9b3eeSRoland Mainz+		sum->tab=posix_cksum_tab;
522*34f9b3eeSRoland Mainz 	}
523*34f9b3eeSRoland Mainz-	if (sum->rotate)
524*34f9b3eeSRoland Mainz+	else
525*34f9b3eeSRoland Mainz 	{
526*34f9b3eeSRoland Mainz-		Crcnum_t	t;
527*34f9b3eeSRoland Mainz-		Crcnum_t	p[8];
528*34f9b3eeSRoland Mainz-
529*34f9b3eeSRoland Mainz-		p[0] = polynomial;
530*34f9b3eeSRoland Mainz-		for (i = 1; i < 8; i++)
531*34f9b3eeSRoland Mainz-			p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
532*34f9b3eeSRoland Mainz-		for (i = 0; i < elementsof(sum->tab); i++)
533*34f9b3eeSRoland Mainz+		polynomial = 0xedb88320;
534*34f9b3eeSRoland Mainz+		s = name;
535*34f9b3eeSRoland Mainz+		while (*(t = s))
536*34f9b3eeSRoland Mainz 		{
537*34f9b3eeSRoland Mainz-			t = 0;
538*34f9b3eeSRoland Mainz-			x = i;
539*34f9b3eeSRoland Mainz-			for (j = 0; j < 8; j++)
540*34f9b3eeSRoland Mainz+			for (t = s, v = 0; *s && *s != '-'; s++)
541*34f9b3eeSRoland Mainz+				if (*s == '=' && !v)
542*34f9b3eeSRoland Mainz+					v = s;
543*34f9b3eeSRoland Mainz+			i = (v ? v : s) - t;
544*34f9b3eeSRoland Mainz+			if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
545*34f9b3eeSRoland Mainz+				polynomial = strtoul(t, NiL, 0);
546*34f9b3eeSRoland Mainz+			else if (strneq(t, "done", i))
547*34f9b3eeSRoland Mainz+				sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
548*34f9b3eeSRoland Mainz+			else if (strneq(t, "init", i))
549*34f9b3eeSRoland Mainz+				sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
550*34f9b3eeSRoland Mainz+			else if (strneq(t, "rotate", i))
551*34f9b3eeSRoland Mainz+				sum->rotate = 1;
552*34f9b3eeSRoland Mainz+			else if (strneq(t, "size", i))
553*34f9b3eeSRoland Mainz 			{
554*34f9b3eeSRoland Mainz-				if (x & 1)
555*34f9b3eeSRoland Mainz-					t ^= p[j];
556*34f9b3eeSRoland Mainz-				x >>= 1;
557*34f9b3eeSRoland Mainz+				sum->addsize = 1;
558*34f9b3eeSRoland Mainz+				if (v)
559*34f9b3eeSRoland Mainz+					sum->xorsize = strtoul(v + 1, NiL, 0);
560*34f9b3eeSRoland Mainz 			}
561*34f9b3eeSRoland Mainz-			sum->tab[i] = t;
562*34f9b3eeSRoland Mainz+			if (*s == '-')
563*34f9b3eeSRoland Mainz+				s++;
564*34f9b3eeSRoland Mainz 		}
565*34f9b3eeSRoland Mainz-	}
566*34f9b3eeSRoland Mainz-	else
567*34f9b3eeSRoland Mainz-	{
568*34f9b3eeSRoland Mainz-		for (i = 0; i < elementsof(sum->tab); i++)
569*34f9b3eeSRoland Mainz+		if (sum->rotate)
570*34f9b3eeSRoland Mainz 		{
571*34f9b3eeSRoland Mainz-			x = i;
572*34f9b3eeSRoland Mainz-			for (j = 0; j < 8; j++)
573*34f9b3eeSRoland Mainz-				x = (x>>1) ^ ((x & 1) ? polynomial : 0);
574*34f9b3eeSRoland Mainz-			sum->tab[i] = x;
575*34f9b3eeSRoland Mainz+			Crcnum_t	t;
576*34f9b3eeSRoland Mainz+			Crcnum_t	p[8];
577*34f9b3eeSRoland Mainz+
578*34f9b3eeSRoland Mainz+			p[0] = polynomial;
579*34f9b3eeSRoland Mainz+			for (i = 1; i < 8; i++)
580*34f9b3eeSRoland Mainz+				p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
581*34f9b3eeSRoland Mainz+			for (i = 0; i < elementsof(sum->tabdata); i++)
582*34f9b3eeSRoland Mainz+			{
583*34f9b3eeSRoland Mainz+				t = 0;
584*34f9b3eeSRoland Mainz+				x = i;
585*34f9b3eeSRoland Mainz+				for (j = 0; j < 8; j++)
586*34f9b3eeSRoland Mainz+				{
587*34f9b3eeSRoland Mainz+					if (x & 1)
588*34f9b3eeSRoland Mainz+						t ^= p[j];
589*34f9b3eeSRoland Mainz+					x >>= 1;
590*34f9b3eeSRoland Mainz+				}
591*34f9b3eeSRoland Mainz+				sum->tabdata[i] = t;
592*34f9b3eeSRoland Mainz+			}
593*34f9b3eeSRoland Mainz 		}
594*34f9b3eeSRoland Mainz+		else
595*34f9b3eeSRoland Mainz+		{
596*34f9b3eeSRoland Mainz+			for (i = 0; i < elementsof(sum->tabdata); i++)
597*34f9b3eeSRoland Mainz+			{
598*34f9b3eeSRoland Mainz+				x = i;
599*34f9b3eeSRoland Mainz+				for (j = 0; j < 8; j++)
600*34f9b3eeSRoland Mainz+					x = (x>>1) ^ ((x & 1) ? polynomial : 0);
601*34f9b3eeSRoland Mainz+				sum->tabdata[i] = x;
602*34f9b3eeSRoland Mainz+			}
603*34f9b3eeSRoland Mainz+		}
604*34f9b3eeSRoland Mainz+
605*34f9b3eeSRoland Mainz+		sum->tab=sum->tabdata;
606*34f9b3eeSRoland Mainz 	}
607*34f9b3eeSRoland Mainz+
608*34f9b3eeSRoland Mainz 	return (Sum_t*)sum;
609*34f9b3eeSRoland Mainz }
610*34f9b3eeSRoland Mainz
611*34f9b3eeSRoland Mainz@@ -141,11 +216,77 @@
612*34f9b3eeSRoland Mainz 	return 0;
613*34f9b3eeSRoland Mainz }
614*34f9b3eeSRoland Mainz
615*34f9b3eeSRoland Mainz+#if defined(__SUNPRO_C) || defined(__GNUC__)
616*34f9b3eeSRoland Mainz+
617*34f9b3eeSRoland Mainz+#if defined(__SUNPRO_C)
618*34f9b3eeSRoland Mainz+#    include <sun_prefetch.h>
619*34f9b3eeSRoland Mainz+#    define sum_prefetch(addr) sun_prefetch_read_many((void *)(addr))
620*34f9b3eeSRoland Mainz+#elif defined(__GNUC__)
621*34f9b3eeSRoland Mainz+#    define sum_prefetch(addr) __builtin_prefetch((addr), 0, 3)
622*34f9b3eeSRoland Mainz+#else
623*34f9b3eeSRoland Mainz+#    error Unknown compiler
624*34f9b3eeSRoland Mainz+#endif
625*34f9b3eeSRoland Mainz+
626*34f9b3eeSRoland Mainz+#define CBLOCK_SIZE (64)
627*34f9b3eeSRoland Mainz+#pragma unroll(16)
628*34f9b3eeSRoland Mainz+
629*34f9b3eeSRoland Mainz static int
630*34f9b3eeSRoland Mainz crc_block(Sum_t* p, const void* s, size_t n)
631*34f9b3eeSRoland Mainz {
632*34f9b3eeSRoland Mainz 	Crc_t*			sum = (Crc_t*)p;
633*34f9b3eeSRoland Mainz 	register Crcnum_t	c = sum->sum;
634*34f9b3eeSRoland Mainz+	register const unsigned char*	b = (const unsigned char*)s;
635*34f9b3eeSRoland Mainz+	register const unsigned char*	e = b + n;
636*34f9b3eeSRoland Mainz+	unsigned short i;
637*34f9b3eeSRoland Mainz+
638*34f9b3eeSRoland Mainz+	sum_prefetch(b);
639*34f9b3eeSRoland Mainz+
640*34f9b3eeSRoland Mainz+	if (sum->rotate)
641*34f9b3eeSRoland Mainz+	{
642*34f9b3eeSRoland Mainz+		while (n > CBLOCK_SIZE)
643*34f9b3eeSRoland Mainz+		{
644*34f9b3eeSRoland Mainz+			sum_prefetch(b+CBLOCK_SIZE);
645*34f9b3eeSRoland Mainz+			for(i=0 ; i < CBLOCK_SIZE ; i++)
646*34f9b3eeSRoland Mainz+			{
647*34f9b3eeSRoland Mainz+				CRCROTATE(sum, c, *b++);
648*34f9b3eeSRoland Mainz+			}
649*34f9b3eeSRoland Mainz+
650*34f9b3eeSRoland Mainz+			n-=CBLOCK_SIZE;
651*34f9b3eeSRoland Mainz+		}
652*34f9b3eeSRoland Mainz+
653*34f9b3eeSRoland Mainz+		while (b < e)
654*34f9b3eeSRoland Mainz+		{
655*34f9b3eeSRoland Mainz+			CRCROTATE(sum, c, *b++);
656*34f9b3eeSRoland Mainz+		}
657*34f9b3eeSRoland Mainz+	}
658*34f9b3eeSRoland Mainz+	else
659*34f9b3eeSRoland Mainz+	{
660*34f9b3eeSRoland Mainz+		while (n > CBLOCK_SIZE)
661*34f9b3eeSRoland Mainz+		{
662*34f9b3eeSRoland Mainz+			sum_prefetch(b+CBLOCK_SIZE);
663*34f9b3eeSRoland Mainz+			for(i=0 ; i < CBLOCK_SIZE ; i++)
664*34f9b3eeSRoland Mainz+			{
665*34f9b3eeSRoland Mainz+				CRC(sum, c, *b++);
666*34f9b3eeSRoland Mainz+			}
667*34f9b3eeSRoland Mainz+
668*34f9b3eeSRoland Mainz+			n-=CBLOCK_SIZE;
669*34f9b3eeSRoland Mainz+		}
670*34f9b3eeSRoland Mainz+
671*34f9b3eeSRoland Mainz+		while (b < e)
672*34f9b3eeSRoland Mainz+		{
673*34f9b3eeSRoland Mainz+			CRC(sum, c, *b++);
674*34f9b3eeSRoland Mainz+		}
675*34f9b3eeSRoland Mainz+	}
676*34f9b3eeSRoland Mainz+
677*34f9b3eeSRoland Mainz+	sum->sum = c;
678*34f9b3eeSRoland Mainz+	return 0;
679*34f9b3eeSRoland Mainz+}
680*34f9b3eeSRoland Mainz+#else
681*34f9b3eeSRoland Mainz+static int
682*34f9b3eeSRoland Mainz+crc_block(Sum_t* p, const void* s, size_t n)
683*34f9b3eeSRoland Mainz+{
684*34f9b3eeSRoland Mainz+	Crc_t*			sum = (Crc_t*)p;
685*34f9b3eeSRoland Mainz+	register Crcnum_t	c = sum->sum;
686*34f9b3eeSRoland Mainz 	register unsigned char*	b = (unsigned char*)s;
687*34f9b3eeSRoland Mainz 	register unsigned char*	e = b + n;
688*34f9b3eeSRoland Mainz
689*34f9b3eeSRoland Mainz@@ -158,6 +299,7 @@
690*34f9b3eeSRoland Mainz 	sum->sum = c;
691*34f9b3eeSRoland Mainz 	return 0;
692*34f9b3eeSRoland Mainz }
693*34f9b3eeSRoland Mainz+#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
694*34f9b3eeSRoland Mainz
695*34f9b3eeSRoland Mainz static int
696*34f9b3eeSRoland Mainz crc_done(Sum_t* p)
697*34f9b3eeSRoland MainzIndex: usr/src/lib/libsum/common/sum-att.c
698*34f9b3eeSRoland Mainz===================================================================
699*34f9b3eeSRoland Mainz--- usr/src/lib/libsum/common/sum-att.c	(revision 1724)
700*34f9b3eeSRoland Mainz+++ usr/src/lib/libsum/common/sum-att.c	(working copy)
701*34f9b3eeSRoland Mainz@@ -35,10 +35,73 @@
702*34f9b3eeSRoland Mainz #define att_data	long_data
703*34f9b3eeSRoland Mainz #define att_scale	512
704*34f9b3eeSRoland Mainz
705*34f9b3eeSRoland Mainz+#if defined(__SUNPRO_C) || defined(__GNUC__)
706*34f9b3eeSRoland Mainz+
707*34f9b3eeSRoland Mainz+#if defined(__SUNPRO_C)
708*34f9b3eeSRoland Mainz+#    include <sun_prefetch.h>
709*34f9b3eeSRoland Mainz+#    define sum_prefetch(addr) sun_prefetch_read_many((void *)(addr))
710*34f9b3eeSRoland Mainz+#elif defined(__GNUC__)
711*34f9b3eeSRoland Mainz+#    define sum_prefetch(addr) __builtin_prefetch((addr), 0, 3)
712*34f9b3eeSRoland Mainz+#else
713*34f9b3eeSRoland Mainz+#    error Unknown compiler
714*34f9b3eeSRoland Mainz+#endif
715*34f9b3eeSRoland Mainz+
716*34f9b3eeSRoland Mainz+#define CBLOCK_SIZE (64)
717*34f9b3eeSRoland Mainz+#pragma unroll(16)
718*34f9b3eeSRoland Mainz+
719*34f9b3eeSRoland Mainz+/* Inmos transputer would love this algorithm */
720*34f9b3eeSRoland Mainz static int
721*34f9b3eeSRoland Mainz att_block(register Sum_t* p, const void* s, size_t n)
722*34f9b3eeSRoland Mainz {
723*34f9b3eeSRoland Mainz 	register uint32_t	c = ((Integral_t*)p)->sum;
724*34f9b3eeSRoland Mainz+	register const unsigned char*	b = (const unsigned char*)s;
725*34f9b3eeSRoland Mainz+	register const unsigned char*	e = b + n;
726*34f9b3eeSRoland Mainz+	register uint32_t s0, s1, s2, s3, s4, s5, s6, s7;
727*34f9b3eeSRoland Mainz+	register unsigned int i;
728*34f9b3eeSRoland Mainz+
729*34f9b3eeSRoland Mainz+	s0=s1=s2=s3=s4=s5=s6=s7=0U;
730*34f9b3eeSRoland Mainz+
731*34f9b3eeSRoland Mainz+	sum_prefetch((void *)b);
732*34f9b3eeSRoland Mainz+
733*34f9b3eeSRoland Mainz+	while (n > CBLOCK_SIZE)
734*34f9b3eeSRoland Mainz+	{
735*34f9b3eeSRoland Mainz+		sum_prefetch((b+CBLOCK_SIZE));
736*34f9b3eeSRoland Mainz+
737*34f9b3eeSRoland Mainz+		/* Compiler will unroll for() loops per #pragma unroll */
738*34f9b3eeSRoland Mainz+		for (i=0 ; i < (CBLOCK_SIZE/8) ; i++)
739*34f9b3eeSRoland Mainz+		{
740*34f9b3eeSRoland Mainz+			/*
741*34f9b3eeSRoland Mainz+			 * use s0-s7 to decouple calculations (this improves pipelining)
742*34f9b3eeSRoland Mainz+			 * because each operation is completely independent from it's
743*34f9b3eeSRoland Mainz+			 * siblings
744*34f9b3eeSRoland Mainz+			 */
745*34f9b3eeSRoland Mainz+			s0+=b[0];
746*34f9b3eeSRoland Mainz+			s1+=b[1];
747*34f9b3eeSRoland Mainz+			s2+=b[2];
748*34f9b3eeSRoland Mainz+			s3+=b[3];
749*34f9b3eeSRoland Mainz+			s4+=b[4];
750*34f9b3eeSRoland Mainz+			s5+=b[5];
751*34f9b3eeSRoland Mainz+			s6+=b[6];
752*34f9b3eeSRoland Mainz+			s7+=b[7];
753*34f9b3eeSRoland Mainz+
754*34f9b3eeSRoland Mainz+			b+=8;
755*34f9b3eeSRoland Mainz+			n-=8;
756*34f9b3eeSRoland Mainz+		}
757*34f9b3eeSRoland Mainz+	}
758*34f9b3eeSRoland Mainz+
759*34f9b3eeSRoland Mainz+	c+=s0+s1+s2+s3+s4+s5+s6+s7;
760*34f9b3eeSRoland Mainz+
761*34f9b3eeSRoland Mainz+	while (b < e)
762*34f9b3eeSRoland Mainz+		c += *b++;
763*34f9b3eeSRoland Mainz+	((Integral_t*)p)->sum = c;
764*34f9b3eeSRoland Mainz+	return 0;
765*34f9b3eeSRoland Mainz+}
766*34f9b3eeSRoland Mainz+
767*34f9b3eeSRoland Mainz+#else
768*34f9b3eeSRoland Mainz+static int
769*34f9b3eeSRoland Mainz+att_block(register Sum_t* p, const void* s, size_t n)
770*34f9b3eeSRoland Mainz+{
771*34f9b3eeSRoland Mainz+	register uint32_t	c = ((Integral_t*)p)->sum;
772*34f9b3eeSRoland Mainz 	register unsigned char*	b = (unsigned char*)s;
773*34f9b3eeSRoland Mainz 	register unsigned char*	e = b + n;
774*34f9b3eeSRoland Mainz
775*34f9b3eeSRoland Mainz@@ -47,6 +110,7 @@
776*34f9b3eeSRoland Mainz 	((Integral_t*)p)->sum = c;
777*34f9b3eeSRoland Mainz 	return 0;
778*34f9b3eeSRoland Mainz }
779*34f9b3eeSRoland Mainz+#endif /* defined(__SUNPRO_C) || defined(__GNUC__) */
780*34f9b3eeSRoland Mainz
781*34f9b3eeSRoland Mainz static int
782*34f9b3eeSRoland Mainz att_done(Sum_t* p)
7839a6f360eSCasper H.S. Dik-- snip --
7849a6f360eSCasper H.S. Dik
785da2e3ebdSchin# EOF.
786