Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2015 21:31:29 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r277902 - in projects/clang360-import/sys: fs/cd9660 fs/msdosfs libkern sys x86/x86
Message-ID:  <201501292131.t0TLVTeX052641@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Thu Jan 29 21:31:29 2015
New Revision: 277902
URL: https://svnweb.freebsd.org/changeset/base/277902

Log:
  Merge ^/head r277896 through r277901.

Modified:
  projects/clang360-import/sys/fs/cd9660/cd9660_util.c
  projects/clang360-import/sys/fs/msdosfs/msdosfs_conv.c
  projects/clang360-import/sys/libkern/strtol.c
  projects/clang360-import/sys/sys/conf.h
  projects/clang360-import/sys/x86/x86/tsc.c
Directory Properties:
  projects/clang360-import/   (props changed)
  projects/clang360-import/sys/   (props changed)

Modified: projects/clang360-import/sys/fs/cd9660/cd9660_util.c
==============================================================================
--- projects/clang360-import/sys/fs/cd9660/cd9660_util.c	Thu Jan 29 21:16:45 2015	(r277901)
+++ projects/clang360-import/sys/fs/cd9660/cd9660_util.c	Thu Jan 29 21:31:29 2015	(r277902)
@@ -80,7 +80,8 @@ isochar(isofn, isoend, joliet_level, c, 
               inbuf[2]='\0';
               inp = inbuf;
               outp = outbuf;
-              cd9660_iconv->convchr(handle, (const char **)&inp, &i, &outp, &j);
+              cd9660_iconv->convchr(handle, __DECONST(const char **, &inp), &i,
+                  &outp, &j);
               len -= j;
               if (clen) *clen = len;
               *c = '\0';
@@ -121,7 +122,8 @@ isofncmp(fn, fnlen, isofn, isolen, jolie
 	u_char *fnend = fn + fnlen, *isoend = isofn + isolen;
 
 	for (; fn < fnend; ) {
-		d = sgetrune(fn, fnend - fn, (char const **)&fn, flags, lhandle);
+		d = sgetrune(fn, fnend - fn, __DECONST(const char **, &fn),
+		    flags, lhandle);
 		if (isofn == isoend)
 			return d;
 		isofn += isochar(isofn, isoend, joliet_level, &c, NULL, flags, handle);

Modified: projects/clang360-import/sys/fs/msdosfs/msdosfs_conv.c
==============================================================================
--- projects/clang360-import/sys/fs/msdosfs/msdosfs_conv.c	Thu Jan 29 21:16:45 2015	(r277901)
+++ projects/clang360-import/sys/fs/msdosfs/msdosfs_conv.c	Thu Jan 29 21:31:29 2015	(r277902)
@@ -253,7 +253,7 @@ dos2unixfn(u_char dn[11], u_char *un, in
 	 * Copy the name portion into the unix filename string.
 	 */
 	for (i = 8; i > 0 && *dn != ' ';) {
-		c = dos2unixchr(tmpbuf, (const u_char **)&dn, &i,
+		c = dos2unixchr(tmpbuf, __DECONST(const u_char **, &dn), &i,
 		    lower & LCASE_BASE, pmp);
 		while (*c != '\0') {
 			*un++ = *c++;
@@ -270,8 +270,8 @@ dos2unixfn(u_char dn[11], u_char *un, in
 		*un++ = '.';
 		thislong++;
 		for (i = 3; i > 0 && *dn != ' ';) {
-			c = dos2unixchr(tmpbuf, (const u_char **)&dn, &i,
-			    lower & LCASE_EXT, pmp);
+			c = dos2unixchr(tmpbuf, __DECONST(const u_char **, &dn),
+			    &i, lower & LCASE_EXT, pmp);
 			while (*c != '\0') {
 				*un++ = *c++;
 				thislong++;
@@ -612,7 +612,8 @@ winChkName(struct mbnambuf *nbp, const u
 		 * to look up or create files in case sensitive even when
 		 * it's a long file name.
 		 */
-		c1 = unix2winchr((const u_char **)&np, &len, LCASE_BASE, pmp);
+		c1 = unix2winchr(__DECONST(const u_char **, &np), &len,
+		    LCASE_BASE, pmp);
 		c2 = unix2winchr(&un, &unlen, LCASE_BASE, pmp);
 		if (c1 != c2)
 			return -2;
@@ -922,8 +923,8 @@ win2unixchr(u_char *outbuf, u_int16_t wc
 		ilen = 2;
 		olen = len = 4;
 		inp = inbuf;
-		msdosfs_iconv->convchr(pmp->pm_w2u, (const char **)&inp, &ilen,
-				     (char **)&outp, &olen);
+		msdosfs_iconv->convchr(pmp->pm_w2u, __DECONST(const char **,
+		    &inp), &ilen, (char **)&outp, &olen);
 		len -= olen;
 
 		/*

Modified: projects/clang360-import/sys/libkern/strtol.c
==============================================================================
--- projects/clang360-import/sys/libkern/strtol.c	Thu Jan 29 21:16:45 2015	(r277901)
+++ projects/clang360-import/sys/libkern/strtol.c	Thu Jan 29 21:31:29 2015	(r277902)
@@ -124,6 +124,6 @@ strtol(nptr, endptr, base)
 	} else if (neg)
 		acc = -acc;
 	if (endptr != 0)
-		*((const char **)endptr) = any ? s - 1 : nptr;
+		*endptr = __DECONST(char *, any ? s - 1 : nptr);
 	return (acc);
 }

Modified: projects/clang360-import/sys/sys/conf.h
==============================================================================
--- projects/clang360-import/sys/sys/conf.h	Thu Jan 29 21:16:45 2015	(r277901)
+++ projects/clang360-import/sys/sys/conf.h	Thu Jan 29 21:31:29 2015	(r277902)
@@ -106,24 +106,6 @@ struct clonedevs;
 struct vm_object;
 struct vnode;
 
-/*
- * Note: d_thread_t is provided as a transition aid for those drivers
- * that treat struct proc/struct thread as an opaque data type and
- * exist in substantially the same form in both 4.x and 5.x.  Writers
- * of drivers that dips into the d_thread_t structure should use
- * struct thread or struct proc as appropriate for the version of the
- * OS they are using.  It is provided in lieu of each device driver
- * inventing its own way of doing this.  While it does violate style(9)
- * in a number of ways, this violation is deemed to be less
- * important than the benefits that a uniform API between releases
- * gives.
- *
- * Users of struct thread/struct proc that aren't device drivers should
- * not use d_thread_t.
- */
-
-typedef struct thread d_thread_t;
-
 typedef int d_open_t(struct cdev *dev, int oflags, int devtype, struct thread *td);
 typedef int d_fdopen_t(struct cdev *dev, int oflags, struct thread *td, struct file *fp);
 typedef int d_close_t(struct cdev *dev, int fflag, int devtype, struct thread *td);

Modified: projects/clang360-import/sys/x86/x86/tsc.c
==============================================================================
--- projects/clang360-import/sys/x86/x86/tsc.c	Thu Jan 29 21:16:45 2015	(r277901)
+++ projects/clang360-import/sys/x86/x86/tsc.c	Thu Jan 29 21:31:29 2015	(r277902)
@@ -522,17 +522,22 @@ init_TSC_tc(void)
 	}
 
 	/*
-	 * We cannot use the TSC if it stops incrementing while idle.
 	 * Intel CPUs without a C-state invariant TSC can stop the TSC
-	 * in either C2 or C3.
+	 * in either C2 or C3.  Disable use of C2 and C3 while using
+	 * the TSC as the timecounter.  The timecounter can be changed
+	 * to enable C2 and C3.
+	 *
+	 * Note that the TSC is used as the cputicker for computing
+	 * thread runtime regardless of the timecounter setting, so
+	 * using an alternate timecounter and enabling C2 or C3 can
+	 * result incorrect runtimes for kernel idle threads (but not
+	 * for any non-idle threads).
 	 */
 	if (cpu_deepest_sleep >= 2 && cpu_vendor_id == CPU_VENDOR_INTEL &&
 	    (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) {
-		tsc_timecounter.tc_quality = -1000;
 		tsc_timecounter.tc_flags |= TC_FLAGS_C2STOP;
 		if (bootverbose)
-			printf("TSC timecounter disabled: C2/C3 may halt it.\n");
-		goto init;
+			printf("TSC timecounter disables C2 and C3.\n");
 	}
 
 	/*



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