summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-01-29 21:31:29 +0000
committerdim <dim@FreeBSD.org>2015-01-29 21:31:29 +0000
commit6a81e27d5863d222ce25b554541147e5640f6baf (patch)
tree38b8a5e824fa1e190191a21e984081f6e06ae05b
parent1d69d7d4596d0dd39aa58fafb5c376b38bf90686 (diff)
downloadFreeBSD-src-6a81e27d5863d222ce25b554541147e5640f6baf.zip
FreeBSD-src-6a81e27d5863d222ce25b554541147e5640f6baf.tar.gz
Merge ^/head r277896 through r277901.
-rw-r--r--sys/fs/cd9660/cd9660_util.c6
-rw-r--r--sys/fs/msdosfs/msdosfs_conv.c13
-rw-r--r--sys/libkern/strtol.c2
-rw-r--r--sys/sys/conf.h18
-rw-r--r--sys/x86/x86/tsc.c15
5 files changed, 22 insertions, 32 deletions
diff --git a/sys/fs/cd9660/cd9660_util.c b/sys/fs/cd9660/cd9660_util.c
index 5372c75..fdce1da 100644
--- a/sys/fs/cd9660/cd9660_util.c
+++ b/sys/fs/cd9660/cd9660_util.c
@@ -80,7 +80,8 @@ isochar(isofn, isoend, joliet_level, c, clen, flags, handle)
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, joliet_level, flags, handle, lhandle)
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);
diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c
index f6a478c..fc9b4d4 100644
--- a/sys/fs/msdosfs/msdosfs_conv.c
+++ b/sys/fs/msdosfs/msdosfs_conv.c
@@ -253,7 +253,7 @@ dos2unixfn(u_char dn[11], u_char *un, int lower, struct msdosfsmount *pmp)
* 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, int lower, struct msdosfsmount *pmp)
*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_char *un, size_t unlen, int chksum,
* 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, struct msdosfsmount *pmp)
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;
/*
diff --git a/sys/libkern/strtol.c b/sys/libkern/strtol.c
index 3d734ab..4d64025 100644
--- a/sys/libkern/strtol.c
+++ b/sys/libkern/strtol.c
@@ -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);
}
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 035a5fd..315551a 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -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);
diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
index e2ae735..a0b0f42 100644
--- a/sys/x86/x86/tsc.c
+++ b/sys/x86/x86/tsc.c
@@ -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");
}
/*
OpenPOWER on IntegriCloud