Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2002 07:30:09 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17992 for review
Message-ID:  <200209231430.g8NEU98O044984@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17992

Change 17992 by julian@julian_jules1 on 2002/09/23 07:29:11

	Catch cleanup round

Affected files ...

.. //depot/projects/kse/include/wchar.h#8 integrate
.. //depot/projects/kse/lib/libc/stdio/Makefile.inc#4 integrate
.. //depot/projects/kse/lib/libc/stdio/fwscanf.c#1 branch
.. //depot/projects/kse/lib/libc/stdio/local.h#5 integrate
.. //depot/projects/kse/lib/libc/stdio/scanf.3#2 integrate
.. //depot/projects/kse/lib/libc/stdio/swscanf.c#1 branch
.. //depot/projects/kse/lib/libc/stdio/vfscanf.c#3 integrate
.. //depot/projects/kse/lib/libc/stdio/vfwscanf.c#1 branch
.. //depot/projects/kse/lib/libc/stdio/vswscanf.c#1 branch
.. //depot/projects/kse/lib/libc/stdio/vwscanf.c#1 branch
.. //depot/projects/kse/lib/libc/stdio/wscanf.3#1 branch
.. //depot/projects/kse/lib/libc/stdio/wscanf.c#1 branch
.. //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#31 integrate
.. //depot/projects/kse/sys/dev/ciss/cissio.h#2 integrate
.. //depot/projects/kse/sys/dev/sbni/if_sbni.c#5 integrate
.. //depot/projects/kse/sys/i386/include/asm.h#4 integrate
.. //depot/projects/kse/sys/i386/include/segments.h#5 integrate
.. //depot/projects/kse/sys/kern/kern_proc.c#88 integrate
.. //depot/projects/kse/sys/kern/kern_thread.c#112 integrate
.. //depot/projects/kse/sys/net/iso88025.h#4 integrate
.. //depot/projects/kse/sys/netinet/ip_output.c#28 integrate
.. //depot/projects/kse/sys/powerpc/include/asm.h#5 integrate
.. //depot/projects/kse/sys/sys/cdefs.h#19 integrate
.. //depot/projects/kse/sys/sys/proc.h#136 integrate
.. //depot/projects/kse/sys/sys/vnode.h#33 integrate

Differences ...

==== //depot/projects/kse/include/wchar.h#8 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/include/wchar.h,v 1.29 2002/09/22 08:06:45 tjr Exp $
+ * $FreeBSD: src/include/wchar.h,v 1.30 2002/09/23 12:40:06 tjr Exp $
  */
 
 /*-
@@ -112,6 +112,7 @@
 int	fputws(const wchar_t * __restrict, struct __sFILE * __restrict);
 int	fwide(struct __sFILE *, int);
 int	fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
+int	fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
 wint_t	getwc(struct __sFILE *);
 wint_t	getwchar(void);
 size_t	mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
@@ -124,12 +125,18 @@
 wint_t	putwchar(wchar_t);
 int	swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
 	    ...);
+int	swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
 wint_t	ungetwc(wint_t, struct __sFILE *);
 int	vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict,
 	    __va_list);
+int	vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict,
+	    __va_list);
 int	vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
 	    __va_list);
+int	vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
+	    __va_list);
 int	vwprintf(const wchar_t * __restrict, __va_list);
+int	vwscanf(const wchar_t * __restrict, __va_list);
 size_t	wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
 wchar_t	*wcscat(wchar_t * __restrict, const wchar_t * __restrict);
 wchar_t	*wcschr(const wchar_t *, wchar_t);
@@ -166,6 +173,7 @@
 wchar_t	*wmemmove(wchar_t *, const wchar_t *, size_t);
 wchar_t	*wmemset(wchar_t *, wchar_t, size_t);
 int	wprintf(const wchar_t * __restrict, ...);
+int	wscanf(const wchar_t * __restrict, ...);
 
 #if __XSI_VISIBLE
 int	wcswidth(const wchar_t *, size_t);

==== //depot/projects/kse/lib/libc/stdio/Makefile.inc#4 (text+ko) ====

@@ -1,5 +1,5 @@
 #	@(#)Makefile.inc	8.3 (Berkeley) 4/17/94
-# $FreeBSD: src/lib/libc/stdio/Makefile.inc,v 1.24 2002/09/21 13:00:30 tjr Exp $
+# $FreeBSD: src/lib/libc/stdio/Makefile.inc,v 1.25 2002/09/23 12:40:06 tjr Exp $
 
 # stdio sources
 .PATH: ${.CURDIR}/../libc/stdio
@@ -8,21 +8,24 @@
 	fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c fgetws.c \
 	fileno.c findfp.c flags.c fopen.c fprintf.c fpurge.c fputc.c fputs.c \
 	fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \
-	ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwrite.c getc.c \
+	ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \
+	fwrite.c getc.c \
 	getchar.c gets.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \
 	perror.c printf.c putc.c putchar.c puts.c putw.c putwc.c putwchar.c \
 	refill.c remove.c rewind.c rget.c scanf.c setbuf.c setbuffer.c \
-	setvbuf.c snprintf.c sprintf.c sscanf.c stdio.c swprintf.c tempnam.c \
-	tmpfile.c \
+	setvbuf.c snprintf.c sprintf.c sscanf.c stdio.c swprintf.c swscanf.c \
+	tempnam.c tmpfile.c \
 	tmpnam.c ungetc.c ungetwc.c vasprintf.c vfprintf.c vfscanf.c \
-	vfwprintf.c vprintf.c vscanf.c vsnprintf.c vsprintf.c vsscanf.c \
-	vswprintf.c vwprintf.c wbuf.c wprintf.c wsetup.c
+	vfwprintf.c vfwscanf.c vprintf.c vscanf.c vsnprintf.c vsprintf.c \
+	vsscanf.c \
+	vswprintf.c vswscanf.c vwprintf.c vwscanf.c wbuf.c wprintf.c wscanf.c \
+	wsetup.c
 
 .if ${LIB} == "c"
 MAN+=	fclose.3 ferror.3 fflush.3 fgetln.3 fgets.3 fgetws.3 fopen.3 fputs.3 \
 	fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 getwc.3 mktemp.3 \
 	printf.3 putc.3 putwc.3 remove.3 scanf.3 setbuf.3 stdio.3 tmpnam.3 \
-	ungetc.3 ungetwc.3 wprintf.3
+	ungetc.3 ungetwc.3 wprintf.3 wscanf.3
 
 MLINKS+=ferror.3 clearerr.3 ferror.3 feof.3 ferror.3 fileno.3
 MLINKS+=fflush.3 fpurge.3
@@ -49,4 +52,6 @@
 MLINKS+=tmpnam.3 tempnam.3 tmpnam.3 tmpfile.3
 MLINKS+=wprintf.3 fwprintf.3 wprintf.3 swprintf.3 \
 	wprintf.3 vwprintf.3 wprintf.3 vfwprintf.3 wprintf.3 vswprintf.3
+MLINKS+=wscanf.3 fwscanf.3 wscanf.3 swscanf.3 wscanf.3 vwscanf.3 \
+	wscanf.3 vswscanf.3 wscanf.3 vfwscanf.3
 .endif

==== //depot/projects/kse/lib/libc/stdio/local.h#5 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)local.h	8.3 (Berkeley) 7/3/94
- * $FreeBSD: src/lib/libc/stdio/local.h,v 1.17 2002/09/22 05:59:00 tjr Exp $
+ * $FreeBSD: src/lib/libc/stdio/local.h,v 1.19 2002/09/23 12:40:06 tjr Exp $
  */
 
 #include <sys/types.h>	/* for off_t */
@@ -71,9 +71,11 @@
 extern int	__swsetup(FILE *);
 extern int	__sflags(const char *, int *);
 extern int	__ungetc(int, FILE *);
-extern wint_t	__ungetwc(wchar_t, FILE *);
+extern wint_t	__ungetwc(wint_t, FILE *);
 extern int	__vfprintf(FILE *, const char *, __va_list);
 extern int	__vfwprintf(FILE *, const wchar_t *, __va_list);
+extern int	__vfwscanf(FILE * __restrict, const wchar_t * __restrict,
+		    __va_list);
 
 extern int	__sdidinit;
 

==== //depot/projects/kse/lib/libc/stdio/scanf.3#2 (text+ko) ====

@@ -34,7 +34,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)scanf.3	8.2 (Berkeley) 12/11/93
-.\" $FreeBSD: src/lib/libc/stdio/scanf.3,v 1.17 2002/05/30 09:53:47 ru Exp $
+.\" $FreeBSD: src/lib/libc/stdio/scanf.3,v 1.18 2002/09/23 11:35:50 tjr Exp $
 .\"
 .Dd December 11, 1993
 .Dt SCANF 3
@@ -178,9 +178,10 @@
 (rather than
 .Vt float ) ,
 or that the conversion will be one of
-.Cm c
+.Cm c ,
+.Cm s
 or
-.Cm s
+.Cm \&[
 and the next pointer is a pointer to an array of
 .Vt wchar_t
 (rather than
@@ -254,8 +255,15 @@
 a default of
 .Dq infinity
 is used (with one exception, below);
-otherwise at most this many characters are scanned
+otherwise at most this many bytes are scanned
 in processing the conversion.
+In the case of the
+.Cm lc ,
+.Cm ls
+and
+.Cm l[
+conversions, the field width specifies the maximum number
+of multibyte characters that will be scanned.
 Before conversion begins,
 most conversions skip white space;
 this white space is not counted against the field width.
@@ -334,6 +342,13 @@
 character.
 The input string stops at white space
 or at the maximum field width, whichever occurs first.
+.Pp
+If an
+.Cm l
+qualifier is present, the next pointer must be a pointer to
+.Vt wchar_t ,
+into which the input will be placed after conversion by
+.Xr mbrtowc 3 .
 .It Cm S
 The same as
 .Cm ls .
@@ -350,6 +365,13 @@
 is added).
 The usual skip of leading white space is suppressed.
 To skip white space first, use an explicit space in the format.
+.Pp
+If an
+.Cm l
+qualifier is present, the next pointer must be a pointer to
+.Vt wchar_t ,
+into which the input will be placed after conversion by
+.Xr mbrtowc 3 .
 .It Cm C
 The same as
 .Cm lc .
@@ -395,6 +417,13 @@
 The string ends with the appearance of a character not in the
 (or, with a circumflex, in) set
 or when the field width runs out.
+.Pp
+If an
+.Cm l
+qualifier is present, the next pointer must be a pointer to
+.Vt wchar_t ,
+into which the input will be placed after conversion by
+.Xr mbrtowc 3 .
 .It Cm p
 Matches a pointer value (as printed by
 .Ql %p
@@ -492,18 +521,6 @@
 modifiers for positional arguments are not implemented.
 .Pp
 The
-.Cm l
-modifier for
-.Cm %c
-and
-.Cm %s
-(and
-.Cm %C
-and
-.Cm %S )
-to specify wide characters and strings is not implemented.
-.Pp
-The
 .Cm \&%a
 and
 .Cm \&%A

==== //depot/projects/kse/lib/libc/stdio/vfscanf.c#3 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)vfscanf.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.24 2002/08/13 09:30:41 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.25 2002/09/23 11:35:50 tjr Exp $");
 
 #include "namespace.h"
 #include <ctype.h>
@@ -48,6 +48,8 @@
 #include <stddef.h>
 #include <stdarg.h>
 #include <string.h>
+#include <wchar.h>
+#include <wctype.h>
 #include "un-namespace.h"
 
 #include "collate.h"
@@ -136,7 +138,11 @@
 	int nread;		/* number of characters consumed from fp */
 	int base;		/* base argument to conversion function */
 	char ccltab[256];	/* character class table for %[...] */
-	char buf[BUF];		/* buffer for numeric conversions */
+	char buf[BUF];		/* buffer for numeric and mb conversions */
+	wchar_t *wcp;		/* handy wide character pointer */
+	wchar_t *wcp0;		/* saves original value of wcp */
+	mbstate_t mbs;		/* multibyte conversion state */
+	size_t nconv;		/* length of multibyte sequence converted */
 
 	/* `basefix' is used to avoid `if' tests in the integer scanner */
 	static short basefix[17] =
@@ -371,6 +377,32 @@
 					}
 				}
 				nread += sum;
+			} else if (flags & LONG) {
+				wcp = va_arg(ap, wchar_t *);
+				n = 0;
+				while (width != 0) {
+					if (n == MB_CUR_MAX)
+						goto input_failure;
+					buf[n++] = *fp->_p;
+					fp->_p++;
+					fp->_r--;
+					memset(&mbs, 0, sizeof(mbs));
+					nconv = mbrtowc(wcp, buf, n, &mbs);
+					if (nconv == 0 || nconv == (size_t)-1)
+						goto input_failure;
+					if (nconv != (size_t)-2) {
+						nread += n;
+						width--;
+						wcp++;
+						n = 0;
+					}
+					if (fp->_r <= 0 && __srefill(fp)) {
+						if (n != 0)
+							goto input_failure;
+						break;
+					}
+				}
+				nassigned++;
 			} else {
 				size_t r = fread((void *)va_arg(ap, char *), 1,
 				    width, fp);
@@ -402,6 +434,45 @@
 				}
 				if (n == 0)
 					goto match_failure;
+			} else if (flags & LONG) {
+				wcp = wcp0 = va_arg(ap, wchar_t *);
+				n = 0;
+				while (width != 0) {
+					if (n == MB_CUR_MAX)
+						goto input_failure;
+					buf[n++] = *fp->_p;
+					fp->_p++;
+					fp->_r--;
+					memset(&mbs, 0, sizeof(mbs));
+					nconv = mbrtowc(wcp, buf, n, &mbs);
+					if (nconv == 0 || nconv == (size_t)-1)
+						goto input_failure;
+					if (nconv != (size_t)-2) {
+						if (wctob(*wcp) != EOF &&
+						    !ccltab[wctob(*wcp)]) {
+							while (--n > 0)
+								__ungetc(buf[n],
+								    fp);
+							break;
+						}
+						nread += n;
+						width--;
+						wcp++;
+						n = 0;
+					}
+					if (fp->_r <= 0 && __srefill(fp)) {
+						if (n != 0)
+							goto input_failure;
+						break;
+					}
+				}
+				if (n != 0)
+					goto input_failure;
+				n = wcp - wcp0;
+				if (n == 0)
+					goto match_failure;
+				*wcp = L'\0';
+				nassigned++;
 			} else {
 				p0 = p = va_arg(ap, char *);
 				while (ccltab[*fp->_p]) {
@@ -439,6 +510,39 @@
 						break;
 				}
 				nread += n;
+			} else if (flags & LONG) {
+				wcp = va_arg(ap, wchar_t *);
+				n = 0;
+				while (!isspace(*fp->_p) && width != 0) {
+					if (n == MB_CUR_MAX)
+						goto input_failure;
+					buf[n++] = *fp->_p;
+					fp->_p++;
+					fp->_r--;
+					memset(&mbs, 0, sizeof(mbs));
+					nconv = mbrtowc(wcp, buf, n, &mbs);
+					if (nconv == 0 || nconv == (size_t)-1)
+						goto input_failure;
+					if (nconv != (size_t)-2) {
+						if (iswspace(*wcp)) {
+							while (--n > 0)
+								__ungetc(buf[n],
+								    fp);
+							break;
+						}
+						nread += n;
+						width--;
+						wcp++;
+						n = 0;
+					}
+					if (fp->_r <= 0 && __srefill(fp)) {
+						if (n != 0)
+							goto input_failure;
+						break;
+					}
+				}
+				*wcp = L'\0';
+				nassigned++;
 			} else {
 				p0 = p = va_arg(ap, char *);
 				while (!isspace(*fp->_p)) {

==== //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#31 (text+ko) ====

@@ -38,7 +38,7 @@
  *
  *	from: @(#)vm_machdep.c	7.3 (Berkeley) 5/13/91
  *	Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.73 2002/09/17 07:49:40 peter Exp $
+ * $FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.74 2002/09/23 08:04:30 julian Exp $
  */
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -269,35 +269,7 @@
 	td->td_frame = (struct trapframe *)((caddr_t)td->td_pcb) - 1;
 }
 
-struct md_store {
-	struct pcb mds_pcb;
-	struct trapframe mds_frame;
-};
-
-#if 0
 void
-cpu_save_upcall(struct thread *td, struct kse *newkse)
-{
-
-	newkse->ke_mdstorage = malloc(sizeof(struct md_store), M_TEMP,
-	    M_WAITOK);
-	/* Note: use of M_WAITOK means it won't fail. */
-	/* set up shortcuts in MI section */
-	newkse->ke_pcb =
-	    &(((struct md_store *)(newkse->ke_mdstorage))->mds_pcb);
-	newkse->ke_frame =
-	    &(((struct md_store *)(newkse->ke_mdstorage))->mds_frame);
-
-	/* Copy the upcall pcb. Kernel mode & fp regs are here. */
-	/* XXXKSE this may be un-needed */
-	bcopy(td->td_pcb, newkse->ke_pcb, sizeof(struct pcb));
-
-	/* This copies most of the user mode register values. */
-	bcopy(td->td_frame, newkse->ke_frame, sizeof(struct trapframe));
-}
-#endif
-
-void
 cpu_set_upcall(struct thread *td, void *pcb)
 {
 	struct pcb *pcb2;
@@ -354,54 +326,6 @@
 	/* XXX */
 }
 
-#if 0
-void
-cpu_set_args(struct thread *td, struct kse *ke)
-{
-/* XXX
-	suword((void *)(ke->ke_frame->tf_esp + sizeof(void *)),
-	    (int)ke->ke_mailbox);
-*/
-}
-#endif
-
-#if 0
-void
-cpu_free_kse_mdstorage(struct kse *kse)
-{
-
-	free(kse->ke_mdstorage, M_TEMP);
-	kse->ke_mdstorage = NULL;
-	kse->ke_pcb = NULL;
-	kse->ke_frame = NULL;
-}
-#endif
-
-#if 0
-int
-cpu_export_context(struct thread *td)
-{
-
-	/* XXXKSE */
-	struct trapframe *frame;
-	struct thread_mailbox *tm;
-	struct trapframe *uframe;
-	int error;
-
-	frame = td->td_frame;
-	tm = td->td_mailbox;
-	uframe = &tm->ctx.tfrm.tf_tf;
-	error = copyout(frame, uframe, sizeof(*frame));
-	/*
-	 * "What about the fp regs?" I hear you ask.... XXXKSE
-	 * Don't know where gs and "onstack" come from.
-	 * May need to fiddle a few other values too.
-	 */
-	return (error);
-	return (0);
-}
-#endif
-
 void
 cpu_wait(p)
 	struct proc *p;

==== //depot/projects/kse/sys/dev/ciss/cissio.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/dev/ciss/cissio.h,v 1.1 2001/11/27 23:08:36 msmith Exp $
+ *	$FreeBSD: src/sys/dev/ciss/cissio.h,v 1.2 2002/09/23 06:35:32 alfred Exp $
  */
 
 /*
@@ -108,18 +108,18 @@
 	u_int8_t	Dev;
 	u_int8_t	Bus:6;
 	u_int8_t	Mode:2;
-    } PeripDev __attribute__ ((__packed__));
+    } PeripDev __packed;
     struct {
 	u_int8_t	DevLSB;
 	u_int8_t	DevMSB:6;
 	u_int8_t	Mode:2;
-    } LogDev __attribute__ ((__packed__));
+    } LogDev __packed;
     struct {
 	u_int8_t	Dev:5;
 	u_int8_t	Bus:3;
 	u_int8_t	Targ:6;
 	u_int8_t	Mode:2;
-    } LogUnit __attribute__ ((__packed__));
+    } LogUnit __packed;
 } SCSI3Addr_struct;
 
 typedef struct {
@@ -127,20 +127,20 @@
     u_int32_t		Bus:6;
     u_int32_t		Mode:2;
     SCSI3Addr_struct	Target[2];
-} PhysDevAddr_struct __attribute__ ((__packed__));
+} PhysDevAddr_struct __packed;
   
 typedef struct {
     u_int32_t		VolId:30;
     u_int32_t		Mode:2;
     u_int8_t		reserved[4];
-} LogDevAddr_struct __attribute__ ((__packed__));
+} LogDevAddr_struct __packed;
 
 typedef union {
     u_int8_t		LunAddrBytes[8];
     SCSI3Addr_struct	SCSI3Lun[4];
     PhysDevAddr_struct	PhysDev;
     LogDevAddr_struct	LogDev;
-} LUNAddr_struct __attribute__ ((__packed__));
+} LUNAddr_struct __packed;
 
 typedef struct {
     u_int8_t	CDBLen;
@@ -148,24 +148,24 @@
 	u_int8_t	Type:3;
 	u_int8_t	Attribute:3;
 	u_int8_t	Direction:2;
-    } Type __attribute__ ((__packed__));
+    } Type __packed;
     u_int16_t	Timeout;
     u_int8_t	CDB[16];
-} RequestBlock_struct __attribute__ ((__packed__));
+} RequestBlock_struct __packed;
 
 typedef union {
     struct {
 	u_int8_t	Reserved[3];
 	u_int8_t	Type;
 	u_int32_t	ErrorInfo;
-    } Common_Info __attribute__ ((__packed__));
+    } Common_Info __packed;
     struct {
 	u_int8_t	Reserved[2];
 	u_int8_t	offense_size;
 	u_int8_t	offense_num;
 	u_int32_t	offense_value;
-    } Invalid_Cmd __attribute__ ((__packed__));
-} MoreErrInfo_struct __attribute__ ((__packed__));
+    } Invalid_Cmd __packed;
+} MoreErrInfo_struct __packed;
 
 typedef struct {
     u_int8_t		ScsiStatus;
@@ -174,7 +174,7 @@
     u_int32_t		ResidualCnt;
     MoreErrInfo_struct	MoreErrInfo;
     u_int8_t		SenseInfo[SENSEINFOBYTES];
-} ErrorInfo_struct __attribute__ ((__packed__));
+} ErrorInfo_struct __packed;
 
 typedef struct {
     LUNAddr_struct	LUN_info;	/* 8 */
@@ -182,7 +182,7 @@
     ErrorInfo_struct	error_info;	/* 48 */
     u_int16_t		buf_size;	/* 2 */
     u_int8_t		*buf;		/* 4 */
-} IOCTL_Command_struct __attribute__ ((__packed__));
+} IOCTL_Command_struct __packed;
 
 /*
  * Note that we'd normally pass the struct in directly, but

==== //depot/projects/kse/sys/dev/sbni/if_sbni.c#5 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/sbni/if_sbni.c,v 1.5 2002/08/05 18:14:16 fjoe Exp $
+ * $FreeBSD: src/sys/dev/sbni/if_sbni.c,v 1.6 2002/09/23 06:35:33 alfred Exp $
  */
 
 /*
@@ -1253,7 +1253,7 @@
 #endif	/* ASM_CRC */
 
 
-static u_int32_t crc32tab[] __attribute__ ((aligned(8))) = {
+static u_int32_t crc32tab[] __aligned(8) = {
 	0xD202EF8D,  0xA505DF1B,  0x3C0C8EA1,  0x4B0BBE37,
 	0xD56F2B94,  0xA2681B02,  0x3B614AB8,  0x4C667A2E,
 	0xDCD967BF,  0xABDE5729,  0x32D70693,  0x45D03605,

==== //depot/projects/kse/sys/i386/include/asm.h#4 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)DEFS.h	5.1 (Berkeley) 4/23/90
- * $FreeBSD: src/sys/i386/include/asm.h,v 1.9 2002/09/17 01:48:57 peter Exp $
+ * $FreeBSD: src/sys/i386/include/asm.h,v 1.10 2002/09/23 07:27:45 peter Exp $
  */
 
 #ifndef _MACHINE_ASM_H_
@@ -53,13 +53,11 @@
 	popl	%ebx
 #define	PIC_PLT(x)	x@PLT
 #define	PIC_GOT(x)	x@GOT(%ebx)
-#define	PIC_GOTOFF(x)	x@GOTOFF(%ebx)
 #else
 #define	PIC_PROLOGUE
 #define	PIC_EPILOGUE
 #define	PIC_PLT(x)	x
 #define	PIC_GOT(x)	x
-#define	PIC_GOTOFF(x)	x
 #endif
 
 /*

==== //depot/projects/kse/sys/i386/include/segments.h#5 (text+ko) ====

@@ -35,7 +35,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)segments.h	7.1 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/i386/include/segments.h,v 1.30 2002/09/22 04:45:21 peter Exp $
+ * $FreeBSD: src/sys/i386/include/segments.h,v 1.31 2002/09/23 06:50:07 peter Exp $
  */
 
 #ifndef _MACHINE_SEGMENTS_H_
@@ -64,8 +64,7 @@
  */
 struct	segment_descriptor	{
 	unsigned sd_lolimit:16 ;	/* segment extent (lsb) */
-	unsigned sd_lobase:24 __attribute__ ((packed));
-					/* segment base address (lsb) */
+	unsigned sd_lobase:24 __packed;	/* segment base address (lsb) */
 	unsigned sd_type:5 ;		/* segment type */
 	unsigned sd_dpl:2 ;		/* segment descriptor priority level */
 	unsigned sd_p:1 ;		/* segment descriptor present */
@@ -176,8 +175,8 @@
  * region descriptors, used to load gdt/idt tables before segments yet exist.
  */
 struct region_descriptor {
-	unsigned rd_limit:16;				/* segment extent */
-	unsigned rd_base:32 __attribute__ ((packed));	/* base address  */
+	unsigned rd_limit:16;		/* segment extent */
+	unsigned rd_base:32 __packed;	/* base address  */
 };
 
 /*

==== //depot/projects/kse/sys/kern/kern_proc.c#88 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_proc.c	8.7 (Berkeley) 2/14/95
- * $FreeBSD: src/sys/kern/kern_proc.c,v 1.150 2002/09/23 06:10:24 julian Exp $
+ * $FreeBSD: src/sys/kern/kern_proc.c,v 1.151 2002/09/23 14:01:01 julian Exp $
  */
 
 #include "opt_ktrace.h"
@@ -371,8 +371,10 @@
 		bzero(&newke->ke_startzero, RANGEOF(struct kse,
 		      ke_startzero, ke_endzero));
 		mtx_lock_spin(&sched_lock);
+#if 0
 		bcopy(&td->td_kse->ke_startcopy, &newke->ke_startcopy,
 		      RANGEOF(struct kse, ke_startcopy, ke_endcopy));
+#endif
 	} else {
 		/*
 		 * We are switching to KSEs so just

==== //depot/projects/kse/sys/kern/kern_thread.c#112 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  * DAMAGE.
  *
- * $FreeBSD: src/sys/kern/kern_thread.c,v 1.29 2002/09/23 06:14:30 julian Exp $
+ * $FreeBSD: src/sys/kern/kern_thread.c,v 1.30 2002/09/23 14:06:12 julian Exp $
  */
 
 #include <sys/param.h>
@@ -700,7 +700,7 @@
 		 * this thead/KSE up to userland.
 		 */
 		CTR3(KTR_PROC, "userret: upcall thread %p (pid %d, %s)",
-		    td, p->p_pid, p->p_comm);
+		    td, td->td_proc->p_pid, td->td_proc->p_comm);
 
 		/*
 		 * Set user context to the UTS.

==== //depot/projects/kse/sys/net/iso88025.h#4 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/net/iso88025.h,v 1.8 2002/05/11 06:27:24 kbyanc Exp $
+ * $FreeBSD: src/sys/net/iso88025.h,v 1.9 2002/09/23 06:35:33 alfred Exp $
  *
  * Information gathered from tokenring@freebsd, /sys/net/ethernet.h and
  * the Mach token ring driver.
@@ -95,12 +95,12 @@
 	u_int8_t	iso88025_shost[ISO88025_ADDR_LEN];  /* source address */
 	u_int16_t	rcf;				    /* route control field */
 	u_int16_t	rd[RIF_MAX_RD];			    /* routing designators */
-} __attribute__ ((__packed__));
+} __packed;
 
 struct iso88025_rif {
 	u_int16_t	rcf;				    /* route control field */
 	u_int16_t	rd[RIF_MAX_RD];			    /* routing designators */
-} __attribute__ ((__packed__));
+} __packed;
 
 struct iso88025_sockaddr_data {
 	u_char ether_dhost[ISO88025_ADDR_LEN];

==== //depot/projects/kse/sys/netinet/ip_output.c#28 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)ip_output.c	8.3 (Berkeley) 1/21/94
- * $FreeBSD: src/sys/netinet/ip_output.c,v 1.164 2002/09/17 11:13:04 maxim Exp $
+ * $FreeBSD: src/sys/netinet/ip_output.c,v 1.165 2002/09/23 08:56:24 maxim Exp $
  */
 
 #define _IP_VHL
@@ -141,7 +141,6 @@
 	int rv;
 #endif /* PFIL_HOOKS */
 
-	len = 0;
 	args.eh = NULL;
 	args.rule = NULL;
 	args.next_hop = NULL;
@@ -199,8 +198,9 @@
 	}
 
 	if (opt) {
+		len = 0;
 		m = ip_insertoptions(m, opt, &len);
-		if (len >= sizeof(struct ip))
+		if (len != 0)
 			hlen = len;
 	}
 	ip = mtod(m, struct ip *);
@@ -1136,14 +1136,18 @@
 	unsigned optlen;
 
 	optlen = opt->m_len - sizeof(p->ipopt_dst);
-	if (optlen + (u_short)ip->ip_len > IP_MAXPACKET)
+	if (optlen + (u_short)ip->ip_len > IP_MAXPACKET) {
+		*phlen = 0;
 		return (m);		/* XXX should fail */
+	}
 	if (p->ipopt_dst.s_addr)
 		ip->ip_dst = p->ipopt_dst;
 	if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
 		MGETHDR(n, M_DONTWAIT, MT_HEADER);
-		if (n == 0)
+		if (n == 0) {
+			*phlen = 0;
 			return (m);
+		}
 		n->m_pkthdr.rcvif = (struct ifnet *)0;
 #ifdef MAC
 		mac_create_mbuf_from_mbuf(m, n);

==== //depot/projects/kse/sys/powerpc/include/asm.h#5 (text+ko) ====

@@ -29,7 +29,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  *	$NetBSD: asm.h,v 1.6.18.1 2000/07/25 08:37:14 kleink Exp $
- * $FreeBSD: src/sys/powerpc/include/asm.h,v 1.5 2002/09/17 01:48:58 peter Exp $
+ * $FreeBSD: src/sys/powerpc/include/asm.h,v 1.6 2002/09/23 07:27:45 peter Exp $
  */
 
 #ifndef _MACHINE_ASM_H_
@@ -41,17 +41,14 @@
 #define	PIC_PLT(x)	x@plt
 #ifdef	__STDC__
 #define	PIC_GOT(x)	XXX
-#define	PIC_GOTOFF(x)	XXX
 #else	/* not __STDC__ */
 #define	PIC_GOT(x)	XXX
-#define	PIC_GOTOFF(x)	XXX
 #endif	/* __STDC__ */
 #else
 #define	PIC_PROLOGUE
 #define	PIC_EPILOGUE
 #define	PIC_PLT(x)	x
 #define PIC_GOT(x)	x
-#define	PIC_GOTOFF(x)	x
 #endif
 
 #define	CNAME(csym)		csym

==== //depot/projects/kse/sys/sys/cdefs.h#19 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
- * $FreeBSD: src/sys/sys/cdefs.h,v 1.65 2002/09/23 06:19:31 peter Exp $
+ * $FreeBSD: src/sys/sys/cdefs.h,v 1.66 2002/09/23 06:37:48 peter Exp $
  */
 
 #ifndef	_SYS_CDEFS_H_
@@ -110,23 +110,28 @@
  * pure (no side effects) functions, and unused variables.  They are
  * null except for versions of gcc that are known to support the features
  * properly (old versions of gcc-2 supported the dead and pure features
- * in a different (wrong) way).
+ * in a different (wrong) way).  If we do not provide an implementation
+ * for a given compiler, let the compile fail if it is told to use
+ * a feature that we cannot live without.
  */
-#if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5
+#ifdef lint
 #define	__dead2
 #define	__pure2
 #define	__unused
 #define	__packed
 #define	__aligned(x)
 #define	__section(x)
+#else
+#if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5
+#define	__dead2
+#define	__pure2
+#define	__unused
 #endif
 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
 #define	__dead2		__attribute__((__noreturn__))
 #define	__pure2		__attribute__((__const__))
 #define	__unused
-#define	__packed	/* XXX find this out, if we care */
-#define	__aligned(x)	/* XXX find this out, if we care */
-#define	__section(x)	/* XXX find this out, if we care */
+/* XXX Find out what to do for __packed, __aligned and __section */
 #endif
 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ == 3
 #define	__dead2		__attribute__((__noreturn__))
@@ -136,6 +141,7 @@
 #define	__aligned(x)	__attribute__((__aligned__(x)))
 #define	__section(x)	__attribute__((__section__(x)))
 #endif
+#endif
 
 /* XXX: should use `#if __STDC_VERSION__ < 199901'. */
 #if !(__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3)
@@ -226,7 +232,7 @@
  * Embed the rcs id of a source file in the resulting library.  Note that in
  * more recent ELF binutils, we use .ident allowing the ID to be stripped.
  * Usage:
- *	__FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.65 2002/09/23 06:19:31 peter Exp $");
+ *	__FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.66 2002/09/23 06:37:48 peter Exp $");
  */
 #ifndef	__FBSDID
 #if !defined(lint) && !defined(STRIP_FBSDID)

==== //depot/projects/kse/sys/sys/proc.h#136 (text+ko) ====

@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)proc.h	8.15 (Berkeley) 5/19/95
- * $FreeBSD: src/sys/sys/proc.h,v 1.252 2002/09/23 06:14:29 julian Exp $
+ * $FreeBSD: src/sys/sys/proc.h,v 1.254 2002/09/23 08:04:30 julian Exp $
  */
 
 #ifndef _SYS_PROC_H_
@@ -316,63 +316,63 @@
 	vm_offset_t	td_kstack;	/* Kernel VA of kstack. */
 };
 /* flags kept in td_flags */ 
-#define TDF_UNBOUND	0x000001 /* May give away the kse, uses the kg runq. */
-#define TDF_INPANIC	0x000002 /* Caused a panic, let it drive crashdump. */
-#define TDF_SINTR	0x000008 /* Sleep is interruptible. */
-#define TDF_TIMEOUT	0x000010 /* Timing out during sleep. */
-#define TDF_SELECT	0x000040 /* Selecting; wakeup/waiting danger. */
-#define TDF_CVWAITQ	0x000080 /* Thread is on a cv_waitq (not slpq). */
-#define TDF_UPCALLING	0x000100 /* This thread is doing an upcall. */
-#define TDF_ONSLEEPQ	0x000200 /* On the sleep queue. */
-#define TDF_INMSLEEP	0x000400 /* Don't recurse in msleep(). */
-#define TDF_TIMOFAIL	0x001000 /* Timeout from sleep after we were awake. */
-#define TDF_DEADLKTREAT	0x800000 /* Lock aquisition - deadlock treatment. */
+#define	TDF_UNBOUND	0x000001 /* May give away the kse, uses the kg runq. */
+#define	TDF_INPANIC	0x000002 /* Caused a panic, let it drive crashdump. */
+#define	TDF_SINTR	0x000008 /* Sleep is interruptible. */
+#define	TDF_TIMEOUT	0x000010 /* Timing out during sleep. */
+#define	TDF_SELECT	0x000040 /* Selecting; wakeup/waiting danger. */
+#define	TDF_CVWAITQ	0x000080 /* Thread is on a cv_waitq (not slpq). */
+#define	TDF_UPCALLING	0x000100 /* This thread is doing an upcall. */
+#define	TDF_ONSLEEPQ	0x000200 /* On the sleep queue. */
+#define	TDF_INMSLEEP	0x000400 /* Don't recurse in msleep(). */
+#define	TDF_TIMOFAIL	0x001000 /* Timeout from sleep after we were awake. */
+#define	TDF_DEADLKTREAT	0x800000 /* Lock aquisition - deadlock treatment. */
 
-#define TDI_SUSPENDED	0x01	/* On suspension queue. */
-#define TDI_SLEEPING	0x02	/* Actually asleep! (tricky). */
-#define TDI_SWAPPED	0x04	/* Stack not in mem.. bad juju if run. */
-#define TDI_MUTEX	0x08	/* Stopped on a mutex. */
-#define TDI_IWAIT	0x10	/* Awaiting interrupt. */
+#define	TDI_SUSPENDED	0x01	/* On suspension queue. */
+#define	TDI_SLEEPING	0x02	/* Actually asleep! (tricky). */
+#define	TDI_SWAPPED	0x04	/* Stack not in mem.. bad juju if run. */
+#define	TDI_MUTEX	0x08	/* Stopped on a mutex. */
+#define	TDI_IWAIT	0x10	/* Awaiting interrupt. */
 
-#define TD_IS_SLEEPING(td)	((td)->td_inhibitors & TDI_SLEEPING)
-#define TD_ON_SLEEPQ(td)	((td)->td_wchan != NULL)
-#define TD_IS_SUSPENDED(td)	((td)->td_inhibitors & TDI_SUSPENDED)
-#define TD_IS_SWAPPED(td)	((td)->td_inhibitors & TDI_SWAPPED)
-#define TD_ON_MUTEX(td)		((td)->td_inhibitors & TDI_MUTEX)
-#define TD_AWAITING_INTR(td)	((td)->td_inhibitors & TDI_IWAIT)
-#define TD_IS_RUNNING(td)	((td)->td_state == TDS_RUNNING)
-#define TD_ON_RUNQ(td)		((td)->td_state == TDS_RUNQ)
-#define TD_CAN_RUN(td)		((td)->td_state == TDS_CAN_RUN)
-#define TD_IS_INHIBITED(td)	((td)->td_state == TDS_INHIBITED)
+#define	TD_IS_SLEEPING(td)	((td)->td_inhibitors & TDI_SLEEPING)
+#define	TD_ON_SLEEPQ(td)	((td)->td_wchan != NULL)
+#define	TD_IS_SUSPENDED(td)	((td)->td_inhibitors & TDI_SUSPENDED)
+#define	TD_IS_SWAPPED(td)	((td)->td_inhibitors & TDI_SWAPPED)
+#define	TD_ON_MUTEX(td)		((td)->td_inhibitors & TDI_MUTEX)
+#define	TD_AWAITING_INTR(td)	((td)->td_inhibitors & TDI_IWAIT)
+#define	TD_IS_RUNNING(td)	((td)->td_state == TDS_RUNNING)
+#define	TD_ON_RUNQ(td)		((td)->td_state == TDS_RUNQ)
+#define	TD_CAN_RUN(td)		((td)->td_state == TDS_CAN_RUN)
+#define	TD_IS_INHIBITED(td)	((td)->td_state == TDS_INHIBITED)
 
-#define TD_SET_INHIB(td, inhib) do {			\
+#define	TD_SET_INHIB(td, inhib) do {			\
 	(td)->td_state = TDS_INHIBITED;			\
 	(td)->td_inhibitors |= inhib;			\
 } while (0)
 
-#define TD_CLR_INHIB(td, inhib) do {			\
+#define	TD_CLR_INHIB(td, inhib) do {			\
 	if (((td)->td_inhibitors & inhib) &&		\
 	    (((td)->td_inhibitors &= ~inhib) == 0))	\
 		(td)->td_state = TDS_CAN_RUN;		\
 } while (0)
 
-#define TD_SET_SLEEPING(td)	TD_SET_INHIB((td), TDI_SLEEPING)
-#define TD_SET_SWAPPED(td)	TD_SET_INHIB((td), TDI_SWAPPED)

>>> TRUNCATED FOR MAIL (1000 lines) <<<

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209231430.g8NEU98O044984>