svn commit: r233257 - head/usr.sbin/newsyslog

2012-03-21 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar 21 06:51:45 2012
New Revision: 233257
URL: http://svn.freebsd.org/changeset/base/233257

Log:
  Don't run through time checks when entry is definitely oversized. This
  leads to newsyslog rotating on (size OR time) if both are specified.
  
  PR:   100018, 160432

Modified:
  head/usr.sbin/newsyslog/newsyslog.c

Modified: head/usr.sbin/newsyslog/newsyslog.c
==
--- head/usr.sbin/newsyslog/newsyslog.c Wed Mar 21 04:00:58 2012
(r233256)
+++ head/usr.sbin/newsyslog/newsyslog.c Wed Mar 21 06:51:45 2012
(r233257)
@@ -484,12 +484,14 @@ do_entry(struct conf_entry * ent)
fk_entry free_or_keep;
double diffsecs;
char temp_reason[REASON_MAX];
+   int oversized;
 
free_or_keep = FREE_ENT;
if (verbose)
printf(%s %d%s: , ent-log, ent-numlogs,
compress_type[ent-compress].flag);
ent-fsize = sizefile(ent-log);
+   oversized = ((ent-trsize  0)  (ent-fsize = ent-trsize));
modtime = age_old_log(ent-log);
ent-rotate = 0;
ent-firstcreate = 0;
@@ -518,7 +520,8 @@ do_entry(struct conf_entry * ent)
printf(does not exist, skipped%s.\n, temp_reason);
}
} else {
-   if (ent-flags  CE_TRIMAT  !force  !rotatereq) {
+   if (ent-flags  CE_TRIMAT  !force  !rotatereq 
+   !oversized) {
diffsecs = ptimeget_diff(timenow, ent-trim_at);
if (diffsecs  0.0) {
/* trim_at is some time in the future. */
@@ -574,7 +577,7 @@ do_entry(struct conf_entry * ent)
} else if (force) {
ent-rotate = 1;
snprintf(temp_reason, REASON_MAX,  due to -F request);
-   } else if ((ent-trsize  0)  (ent-fsize = ent-trsize)) {
+   } else if (oversized) {
ent-rotate = 1;
snprintf(temp_reason, REASON_MAX,  due to size%dK,
ent-trsize);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233258 - head/usr.sbin/newsyslog

2012-03-21 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar 21 07:02:17 2012
New Revision: 233258
URL: http://svn.freebsd.org/changeset/base/233258

Log:
  Fix a sentence in a paragraph that describes time and interval based
  trimming. This sentence vaguely can be interpreted as if it was speaking
  about time and size interaction, while it wasn't about it.

Modified:
  head/usr.sbin/newsyslog/newsyslog.conf.5

Modified: head/usr.sbin/newsyslog/newsyslog.conf.5
==
--- head/usr.sbin/newsyslog/newsyslog.conf.5Wed Mar 21 06:51:45 2012
(r233257)
+++ head/usr.sbin/newsyslog/newsyslog.conf.5Wed Mar 21 07:02:17 2012
(r233258)
@@ -21,7 +21,7 @@
 .\ the suitability of this software for any purpose.  It is
 .\ provided as is without express or implied warranty.
 .\
-.Dd February 25, 2011
+.Dd March 21, 2012
 .Dt NEWSYSLOG.CONF 5
 .Os
 .Sh NAME
@@ -130,7 +130,7 @@ Additionally, the format may also be con
 sign along with a rotation time specification of once
 a day, once a week, or once a month.
 .Pp
-If a time is specified, the log file will only be trimmed if
+Time based trimming happens only if
 .Xr newsyslog 8
 is run within one hour of the specified time.
 If an interval is specified, the log file will be trimmed if that many
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233262 - head/lib/libc/gen

2012-03-21 Thread David Xu
Author: davidxu
Date: Wed Mar 21 07:12:52 2012
New Revision: 233262
URL: http://svn.freebsd.org/changeset/base/233262

Log:
  Use version 2 of semaphore provided by kernel umtx code, now if there is
  no waiters, we still increase and decrease count in user mode without
  entering kernel, once there is a waiter, sem_post will enter kernel to
  increase count and wake thread up, this is atomicy and allow us to
  gracefully destroy semaphore after sem_wait returned.

Modified:
  head/lib/libc/gen/sem_new.c

Modified: head/lib/libc/gen/sem_new.c
==
--- head/lib/libc/gen/sem_new.c Wed Mar 21 07:07:43 2012(r233261)
+++ head/lib/libc/gen/sem_new.c Wed Mar 21 07:12:52 2012(r233262)
@@ -61,7 +61,8 @@ __weak_reference(_sem_unlink, sem_unlink
 __weak_reference(_sem_wait, sem_wait);
 
 #define SEM_PREFIX /tmp/SEMD
-#define SEM_MAGIC  ((u_int32_t)0x73656d31)
+#define SEM_MAGIC1 ((u_int32_t)0x73656d31)
+#define SEM_MAGIC  ((u_int32_t)0x73656d32)
 
 struct sem_nameinfo {
int open_count;
@@ -109,7 +110,7 @@ static inline int
 sem_check_validity(sem_t *sem)
 {
 
-   if (sem-_magic == SEM_MAGIC)
+   if (sem-_magic == SEM_MAGIC || sem-_magic == SEM_MAGIC1)
return (0);
else {
errno = EINVAL;
@@ -130,7 +131,7 @@ _sem_init(sem_t *sem, int pshared, unsig
sem-_magic = SEM_MAGIC;
sem-_kern._count = (u_int32_t)value;
sem-_kern._has_waiters = 0;
-   sem-_kern._flags = pshared ? USYNC_PROCESS_SHARED : 0;
+   sem-_kern._flags = (pshared ? USYNC_PROCESS_SHARED : 0) | SEM_VER2;
return (0);
 }
 
@@ -207,7 +208,7 @@ _sem_open(const char *name, int flags, .
tmp._magic = SEM_MAGIC;
tmp._kern._has_waiters = 0;
tmp._kern._count = value;
-   tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED;
+   tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED | SEM_VER2;
if (_write(fd, tmp, sizeof(tmp)) != sizeof(tmp)) {
flock(fd, LOCK_UN);
goto error;
@@ -325,20 +326,11 @@ _sem_getvalue(sem_t * __restrict sem, in
if (sem_check_validity(sem) != 0)
return (-1);
 
-   *sval = (int)sem-_kern._count;
+   *sval = (int)sem-_kern._count  ~SEM_WAITERS;
return (0);
 }
 
 static __inline int
-usem_wake(struct _usem *sem)
-{
-   rmb();
-   if (!sem-_has_waiters)
-   return (0);
-   return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL);
-}
-
-static __inline int
 usem_wait(struct _usem *sem, const struct timespec *abstime)
 {
struct _umtx_time *tm_p, timeout;
@@ -358,48 +350,51 @@ usem_wait(struct _usem *sem, const struc
(void *)tm_size, __DECONST(void*, tm_p));
 }
 
+static inline int
+_trywait(sem_t *sem)
+{
+   int count;
+
+   if ((sem-_kern._flags  SEM_VER2) != 0) {
+   while (((count = sem-_kern._count)  ~SEM_WAITERS)  0) {
+   if (atomic_cmpset_acq_int(sem-_kern._count, count, 
count - 1))
+   return (0);
+   }
+   } else {
+   while ((count = sem-_kern._count)  0) {
+   if (atomic_cmpset_acq_int(sem-_kern._count, count, 
count - 1))
+   return (0);
+   }
+   }
+   return (EAGAIN);
+}
+
 int
 _sem_trywait(sem_t *sem)
 {
-   int val;
+   int status;
 
if (sem_check_validity(sem) != 0)
return (-1);
-
-   while ((val = sem-_kern._count)  0) {
-   if (atomic_cmpset_acq_int(sem-_kern._count, val, val - 1))
-   return (0);
-   }
-   errno = EAGAIN;
+   if ((status = _trywait(sem)) == 0)
+   return (0);
+   errno = status;
return (-1);
 }
 
-#define TIMESPEC_SUB(dst, src, val) \
-do {\
-(dst)-tv_sec = (src)-tv_sec - (val)-tv_sec;  \
-(dst)-tv_nsec = (src)-tv_nsec - (val)-tv_nsec; \
-if ((dst)-tv_nsec  0) {   \
-(dst)-tv_sec--;\
-(dst)-tv_nsec += 10;   \
-}   \
-} while (0)
-
-
 int
 _sem_timedwait(sem_t * __restrict sem,
const struct timespec * __restrict abstime)
 {
-   int val, retval;
+   int retval;
 
if (sem_check_validity(sem) != 0)
return (-1);
 
retval = 0;
for (;;) {
-   while ((val = sem-_kern._count)  0) {
-   if (atomic_cmpset_acq_int(sem-_kern._count, val, val 
- 1))
-   return (0);
-   }
+   if (_trywait(sem) == 0)
+ 

svn commit: r233263 - head/lib/libc/gen

2012-03-21 Thread David Xu
Author: davidxu
Date: Wed Mar 21 07:16:58 2012
New Revision: 233263
URL: http://svn.freebsd.org/changeset/base/233263

Log:
  Revert previous change. It is an incomplete change from old branch. :-(

Modified:
  head/lib/libc/gen/sem_new.c

Modified: head/lib/libc/gen/sem_new.c
==
--- head/lib/libc/gen/sem_new.c Wed Mar 21 07:12:52 2012(r233262)
+++ head/lib/libc/gen/sem_new.c Wed Mar 21 07:16:58 2012(r233263)
@@ -61,8 +61,7 @@ __weak_reference(_sem_unlink, sem_unlink
 __weak_reference(_sem_wait, sem_wait);
 
 #define SEM_PREFIX /tmp/SEMD
-#define SEM_MAGIC1 ((u_int32_t)0x73656d31)
-#define SEM_MAGIC  ((u_int32_t)0x73656d32)
+#define SEM_MAGIC  ((u_int32_t)0x73656d31)
 
 struct sem_nameinfo {
int open_count;
@@ -110,7 +109,7 @@ static inline int
 sem_check_validity(sem_t *sem)
 {
 
-   if (sem-_magic == SEM_MAGIC || sem-_magic == SEM_MAGIC1)
+   if (sem-_magic == SEM_MAGIC)
return (0);
else {
errno = EINVAL;
@@ -131,7 +130,7 @@ _sem_init(sem_t *sem, int pshared, unsig
sem-_magic = SEM_MAGIC;
sem-_kern._count = (u_int32_t)value;
sem-_kern._has_waiters = 0;
-   sem-_kern._flags = (pshared ? USYNC_PROCESS_SHARED : 0) | SEM_VER2;
+   sem-_kern._flags = pshared ? USYNC_PROCESS_SHARED : 0;
return (0);
 }
 
@@ -208,7 +207,7 @@ _sem_open(const char *name, int flags, .
tmp._magic = SEM_MAGIC;
tmp._kern._has_waiters = 0;
tmp._kern._count = value;
-   tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED | SEM_VER2;
+   tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED;
if (_write(fd, tmp, sizeof(tmp)) != sizeof(tmp)) {
flock(fd, LOCK_UN);
goto error;
@@ -326,11 +325,20 @@ _sem_getvalue(sem_t * __restrict sem, in
if (sem_check_validity(sem) != 0)
return (-1);
 
-   *sval = (int)sem-_kern._count  ~SEM_WAITERS;
+   *sval = (int)sem-_kern._count;
return (0);
 }
 
 static __inline int
+usem_wake(struct _usem *sem)
+{
+   rmb();
+   if (!sem-_has_waiters)
+   return (0);
+   return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL);
+}
+
+static __inline int
 usem_wait(struct _usem *sem, const struct timespec *abstime)
 {
struct _umtx_time *tm_p, timeout;
@@ -350,51 +358,48 @@ usem_wait(struct _usem *sem, const struc
(void *)tm_size, __DECONST(void*, tm_p));
 }
 
-static inline int
-_trywait(sem_t *sem)
-{
-   int count;
-
-   if ((sem-_kern._flags  SEM_VER2) != 0) {
-   while (((count = sem-_kern._count)  ~SEM_WAITERS)  0) {
-   if (atomic_cmpset_acq_int(sem-_kern._count, count, 
count - 1))
-   return (0);
-   }
-   } else {
-   while ((count = sem-_kern._count)  0) {
-   if (atomic_cmpset_acq_int(sem-_kern._count, count, 
count - 1))
-   return (0);
-   }
-   }
-   return (EAGAIN);
-}
-
 int
 _sem_trywait(sem_t *sem)
 {
-   int status;
+   int val;
 
if (sem_check_validity(sem) != 0)
return (-1);
-   if ((status = _trywait(sem)) == 0)
-   return (0);
-   errno = status;
+
+   while ((val = sem-_kern._count)  0) {
+   if (atomic_cmpset_acq_int(sem-_kern._count, val, val - 1))
+   return (0);
+   }
+   errno = EAGAIN;
return (-1);
 }
 
+#define TIMESPEC_SUB(dst, src, val) \
+do {\
+(dst)-tv_sec = (src)-tv_sec - (val)-tv_sec;  \
+(dst)-tv_nsec = (src)-tv_nsec - (val)-tv_nsec; \
+if ((dst)-tv_nsec  0) {   \
+(dst)-tv_sec--;\
+(dst)-tv_nsec += 10;   \
+}   \
+} while (0)
+
+
 int
 _sem_timedwait(sem_t * __restrict sem,
const struct timespec * __restrict abstime)
 {
-   int retval;
+   int val, retval;
 
if (sem_check_validity(sem) != 0)
return (-1);
 
retval = 0;
for (;;) {
-   if (_trywait(sem) == 0)
-   return (0);
+   while ((val = sem-_kern._count)  0) {
+   if (atomic_cmpset_acq_int(sem-_kern._count, val, val 
- 1))
+   return (0);
+   }
 
if (retval) {
_pthread_testcancel();
@@ -433,36 +438,10 @@ _sem_wait(sem_t *sem)
 int
 _sem_post(sem_t *sem)
 {
-   int count;
 
if (sem_check_validity(sem) != 0)
return 

svn commit: r233269 - head/usr.bin/wall

2012-03-21 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar 21 08:03:07 2012
New Revision: 233269
URL: http://svn.freebsd.org/changeset/base/233269

Log:
  Add multibyte char support.
  
  PR:   165429
  Submitted by: amdmi3

Modified:
  head/usr.bin/wall/wall.1
  head/usr.bin/wall/wall.c

Modified: head/usr.bin/wall/wall.1
==
--- head/usr.bin/wall/wall.1Wed Mar 21 07:49:13 2012(r233268)
+++ head/usr.bin/wall/wall.1Wed Mar 21 08:03:07 2012(r233269)
@@ -28,7 +28,7 @@
 .\ @(#)wall.1 8.1 (Berkeley) 6/6/93
 .\ $FreeBSD$
 .\
-.Dd July 17, 2004
+.Dd February 24, 2012
 .Dt WALL 1
 .Os
 .Sh NAME
@@ -73,7 +73,3 @@ setting is used to determine which chara
 terminal, not the receiver's (which
 .Nm
 has no way of knowing).
-.Pp
-The
-.Nm
-utility does not recognize multibyte characters.

Modified: head/usr.bin/wall/wall.c
==
--- head/usr.bin/wall/wall.cWed Mar 21 07:49:13 2012(r233268)
+++ head/usr.bin/wall/wall.cWed Mar 21 08:03:07 2012(r233269)
@@ -62,6 +62,8 @@ static const char sccsid[] = @(#)wall.c
 #include time.h
 #include unistd.h
 #include utmpx.h
+#include wchar.h
+#include wctype.h
 
 #include ttymsg.h
 
@@ -185,14 +187,15 @@ void
 makemsg(char *fname)
 {
int cnt;
-   unsigned char ch;
+   wchar_t ch;
struct tm *lt;
struct passwd *pw;
struct stat sbuf;
time_t now;
FILE *fp;
int fd;
-   char *p, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
+   char hostname[MAXHOSTNAMELEN], tmpname[64];
+   wchar_t *p, *tmp, lbuf[256], codebuf[13];
const char *tty;
const char *whom;
gid_t egid;
@@ -220,78 +223,61 @@ makemsg(char *fname)
 * Which means that we may leave a non-blank character
 * in column 80, but that can't be helped.
 */
-   (void)fprintf(fp, \r%79s\r\n,  );
-   (void)snprintf(lbuf, sizeof(lbuf), 
-   Broadcast Message from %s@%s,
+   (void)fwprintf(fp, L\r%79s\r\n,  );
+   (void)swprintf(lbuf, sizeof(lbuf)/sizeof(wchar_t),
+   LBroadcast Message from %s@%s,
whom, hostname);
-   (void)fprintf(fp, %-79.79s\007\007\r\n, lbuf);
-   (void)snprintf(lbuf, sizeof(lbuf),
-   (%s) at %d:%02d %s..., tty,
+   (void)fwprintf(fp, L%-79.79S\007\007\r\n, lbuf);
+   (void)swprintf(lbuf, sizeof(lbuf)/sizeof(wchar_t),
+   L(%s) at %d:%02d %s..., tty,
lt-tm_hour, lt-tm_min, lt-tm_zone);
-   (void)fprintf(fp, %-79.79s\r\n, lbuf);
+   (void)fwprintf(fp, L%-79.79S\r\n, lbuf);
}
-   (void)fprintf(fp, %79s\r\n,  );
+   (void)fwprintf(fp, L%79s\r\n,  );
 
if (fname) {
egid = getegid();
setegid(getgid());
-   if (freopen(fname, r, stdin) == NULL)
+   if (freopen(fname, r, stdin) == NULL)
err(1, can't read %s, fname);
setegid(egid);
}
cnt = 0;
-   while (fgets(lbuf, sizeof(lbuf), stdin)) {
-   for (p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) {
-   if (ch == '\r') {
-   putc('\r', fp);
+   while (fgetws(lbuf, sizeof(lbuf)/sizeof(wchar_t), stdin)) {
+   for (p = lbuf; (ch = *p) != L'\0'; ++p, ++cnt) {
+   if (ch == L'\r') {
+   putwc(L'\r', fp);
cnt = 0;
continue;
-   } else if (ch == '\n') {
+   } else if (ch == L'\n') {
for (; cnt  79; ++cnt)
-   putc(' ', fp);
-   putc('\r', fp);
-   putc('\n', fp);
+   putwc(L' ', fp);
+   putwc(L'\r', fp);
+   putwc(L'\n', fp);
break;
}
if (cnt == 79) {
-   putc('\r', fp);
-   putc('\n', fp);
+   putwc(L'\r', fp);
+   putwc(L'\n', fp);
cnt = 0;
}
-   if (((ch  0x80)  ch  0xA0) ||
-  /* disable upper controls */
-  (!isprint(ch)  !isspace(ch) 
-   ch != '\a'  ch != '\b')
- ) {
-   if (ch  0x80) {
-   ch = 0x7F;

svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf

2012-03-21 Thread Ed Schouten
Author: ed
Date: Wed Mar 21 08:38:42 2012
New Revision: 233271
URL: http://svn.freebsd.org/changeset/base/233271

Log:
  Remove pty(4) from our kernel configurations.
  
  As of FreeBSD 8, this driver should not be used. Applications that use
  posix_openpt(2) and openpty(3) use the pts(4) that is built into the
  kernel unconditionally. If it turns out high profile depend on the
  pty(4) module anyway, I'd rather get those fixed. So please report any
  issues to me.
  
  The pty(4) module is still available as a kernel module of course, so a
  simple `kldload pty' can be used to run old-style pseudo-terminals.

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/arm/conf/AVILA
  head/sys/arm/conf/BWCT
  head/sys/arm/conf/CAMBRIA
  head/sys/arm/conf/CNS11XXNAS
  head/sys/arm/conf/CRB
  head/sys/arm/conf/DB-78XXX
  head/sys/arm/conf/DB-88F5XXX
  head/sys/arm/conf/DB-88F6XXX
  head/sys/arm/conf/DOCKSTAR
  head/sys/arm/conf/EP80219
  head/sys/arm/conf/GUMSTIX
  head/sys/arm/conf/HL200
  head/sys/arm/conf/HL201
  head/sys/arm/conf/IQ31244
  head/sys/arm/conf/KB920X
  head/sys/arm/conf/LN2410SBC
  head/sys/arm/conf/NSLU
  head/sys/arm/conf/QILA9G20
  head/sys/arm/conf/SAM9G20EK
  head/sys/arm/conf/SHEEVAPLUG
  head/sys/arm/conf/TS7800
  head/sys/i386/conf/GENERIC
  head/sys/i386/conf/XBOX
  head/sys/i386/conf/XEN
  head/sys/ia64/conf/GENERIC
  head/sys/ia64/conf/SKI
  head/sys/mips/conf/OCTEON1
  head/sys/mips/conf/RT305X
  head/sys/mips/conf/XLR
  head/sys/mips/conf/XLR64
  head/sys/mips/conf/XLRN32
  head/sys/mips/conf/std.XLP
  head/sys/pc98/conf/GENERIC
  head/sys/powerpc/conf/GENERIC
  head/sys/powerpc/conf/GENERIC64
  head/sys/powerpc/conf/MPC85XX
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Wed Mar 21 08:08:23 2012(r233270)
+++ head/sys/amd64/conf/GENERIC Wed Mar 21 08:38:42 2012(r233271)
@@ -285,7 +285,6 @@ device  random  # Entropy device
 device ether   # Ethernet support
 device vlan# 802.1Q VLAN support
 device tun # Packet tunnel.
-device pty # BSD-style compatibility pseudo ttys
 device md  # Memory disks
 device gif # IPv6 and IPv4 tunneling
 device faith   # IPv6-to-IPv4 relaying (translation)

Modified: head/sys/arm/conf/AVILA
==
--- head/sys/arm/conf/AVILA Wed Mar 21 08:08:23 2012(r233270)
+++ head/sys/arm/conf/AVILA Wed Mar 21 08:38:42 2012(r233271)
@@ -103,7 +103,6 @@ device  mii # NB: required by npe
 device ether
 device bpf
 
-device pty
 device loop
 device if_bridge
 

Modified: head/sys/arm/conf/BWCT
==
--- head/sys/arm/conf/BWCT  Wed Mar 21 08:08:23 2012(r233270)
+++ head/sys/arm/conf/BWCT  Wed Mar 21 08:38:42 2012(r233271)
@@ -72,7 +72,6 @@ deviceloop
 device random
 device ether
 device vlan
-device pty
 device uart
 device ate
 device mii

Modified: head/sys/arm/conf/CAMBRIA
==
--- head/sys/arm/conf/CAMBRIA   Wed Mar 21 08:08:23 2012(r233270)
+++ head/sys/arm/conf/CAMBRIA   Wed Mar 21 08:38:42 2012(r233271)
@@ -106,7 +106,6 @@ device  mii # NB: required by npe
 device ether
 device bpf
 
-device pty
 device loop
 device if_bridge
 

Modified: head/sys/arm/conf/CNS11XXNAS
==
--- head/sys/arm/conf/CNS11XXNASWed Mar 21 08:08:23 2012
(r233270)
+++ head/sys/arm/conf/CNS11XXNASWed Mar 21 08:38:42 2012
(r233271)
@@ -98,7 +98,6 @@ devicemii # Minimal mii routines
 device ether
 device bpf
 
-device pty
 device loop
 
 device md

Modified: head/sys/arm/conf/CRB
==
--- head/sys/arm/conf/CRB   Wed Mar 21 08:08:23 2012(r233270)
+++ head/sys/arm/conf/CRB   Wed Mar 21 08:38:42 2012(r233271)
@@ -85,7 +85,6 @@ device7seg
 
 # SCSI Controllers
 
-device pty
 #options   AHC_REG_PRETTY_PRINT# Print register bitfields in debug
# output.  Adds ~128k to driver.
 #options   AHD_REG_PRETTY_PRINT# Print register bitfields in debug

Modified: head/sys/arm/conf/DB-78XXX
==
--- head/sys/arm/conf/DB-78XXX 

svn commit: r233272 - head/sys/netinet6

2012-03-21 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar 21 08:43:38 2012
New Revision: 233272
URL: http://svn.freebsd.org/changeset/base/233272

Log:
  in6_pcblookup_local() still can return a pcb with NULL
  inp_socket. To avoid panic, do not dereference inp_socket,
  but obtain reuse port option from inp_flags2, like this
  is done after next call to in_pcblookup_local() a few lines
  down below.
  
  Submitted by: rwatson

Modified:
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet6/in6_pcb.c
==
--- head/sys/netinet6/in6_pcb.c Wed Mar 21 08:38:42 2012(r233271)
+++ head/sys/netinet6/in6_pcb.c Wed Mar 21 08:43:38 2012(r233272)
@@ -245,8 +245,8 @@ in6_pcbbind(register struct inpcb *inp, 
if (tw == NULL ||
(reuseport  tw-tw_so_options) == 0)
return (EADDRINUSE);
-   } else if (t  (reuseport  t-inp_socket-so_options)
-   == 0) {
+   } else if (t  (reuseport == 0 ||
+   (t-inp_flags2  INP_REUSEPORT) == 0)) {
return (EADDRINUSE);
}
 #ifdef INET
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233274 - in head/sys/dev/ata: . chipsets

2012-03-21 Thread Marius Strobl
Author: marius
Date: Wed Mar 21 08:57:15 2012
New Revision: 233274
URL: http://svn.freebsd.org/changeset/base/233274

Log:
  Remove remnants of ATA_LOCKING uses in the ATA_CAM case and wrap it
  along with functions, SYSCTLs and tunables that are not used with
  ATA_CAM in #ifndef ATA_CAM, similar to the existing #ifdef'ed ATA_CAM
  code for the other way around. This makes it easier to understand
  which parts of ata(4) actually are used in the new world order and
  to later on remove the !ATA_CAM bits. It also makes it obvious that
  there is something fishy with the C-bus front-end as well as in the
  ATP850 support, as these used ATA_LOCKING which is defunct in the
  ATA_CAM case. When fixing the former, ATA_LOCKING probably needs to
  be brought back in some form or other.
  
  Reviewed by:  mav
  MFC after:1 week

Modified:
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ata/ata-cbus.c
  head/sys/dev/ata/ata-pci.c
  head/sys/dev/ata/ata-pci.h
  head/sys/dev/ata/ata-queue.c
  head/sys/dev/ata/chipsets/ata-acard.c

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Wed Mar 21 08:50:47 2012(r233273)
+++ head/sys/dev/ata/ata-all.c  Wed Mar 21 08:57:15 2012(r233274)
@@ -79,9 +79,11 @@ static void ataaction(struct cam_sim *si
 static void atapoll(struct cam_sim *sim);
 #endif
 static void ata_conn_event(void *, int);
+#ifndef ATA_CAM
 static void bswap(int8_t *, int);
 static void btrim(int8_t *, int);
 static void bpack(int8_t *, int8_t *, int);
+#endif
 static void ata_interrupt_locked(void *data);
 #ifdef ATA_CAM
 static void ata_periodic_poll(void *data);
@@ -90,27 +92,36 @@ static void ata_periodic_poll(void *data
 /* global vars */
 MALLOC_DEFINE(M_ATA, ata_generic, ATA driver generic layer);
 int (*ata_raid_ioctl_func)(u_long cmd, caddr_t data) = NULL;
+#ifndef ATA_CAM
 struct intr_config_hook *ata_delayed_attach = NULL;
+#endif
 devclass_t ata_devclass;
 uma_zone_t ata_request_zone;
 uma_zone_t ata_composite_zone;
+#ifndef ATA_CAM
 int ata_wc = 1;
 int ata_setmax = 0;
+#endif
 int ata_dma_check_80pin = 1;
 
 /* local vars */
+#ifndef ATA_CAM
 static int ata_dma = 1;
 static int atapi_dma = 1;
+#endif
 
 /* sysctl vars */
 static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, ATA driver parameters);
+#ifndef ATA_CAM
 TUNABLE_INT(hw.ata.ata_dma, ata_dma);
 SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, CTLFLAG_RDTUN, ata_dma, 0,
   ATA disk DMA mode control);
+#endif
 TUNABLE_INT(hw.ata.ata_dma_check_80pin, ata_dma_check_80pin);
 SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin,
   CTLFLAG_RW, ata_dma_check_80pin, 1,
   Check for 80pin cable before setting ATA DMA mode);
+#ifndef ATA_CAM
 TUNABLE_INT(hw.ata.atapi_dma, atapi_dma);
 SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, atapi_dma, 0,
   ATAPI device DMA mode control);
@@ -120,6 +131,7 @@ SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLA
 TUNABLE_INT(hw.ata.setmax, ata_setmax);
 SYSCTL_INT(_hw_ata, OID_AUTO, setmax, CTLFLAG_RDTUN, ata_setmax, 0,
   ATA disk set max native address);
+#endif
 #ifdef ATA_CAM
 FEATURE(ata_cam, ATA devices are accessed through the cam(4) driver);
 #endif
@@ -186,13 +198,13 @@ ata_attach(device_t dev)
callout_init(ch-poll_callout, 1);
 #endif
 
+#ifndef ATA_CAM
 /* reset the controller HW, the channel and device(s) */
 while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch-unit)
pause(ataatch, 1);
-#ifndef ATA_CAM
 ATA_RESET(dev);
-#endif
 ATA_LOCKING(dev, ATA_LF_UNLOCK);
+#endif
 
 /* allocate DMA resources if DMA HW present*/
 if (ch-dma.alloc)
@@ -606,6 +618,7 @@ ata_print_cable(device_t dev, u_int8_t *
   DMA limited to UDMA33, %s found non-ATA66 cable\n, who);
 }
 
+#ifndef ATA_CAM
 int
 ata_check_80pin(device_t dev, int mode)
 {
@@ -623,7 +636,9 @@ ata_check_80pin(device_t dev, int mode)
 }
 return mode;
 }
+#endif
 
+#ifndef ATA_CAM
 void
 ata_setmode(device_t dev)
 {
@@ -644,6 +659,7 @@ ata_setmode(device_t dev)
(error) ? FAILURE  : , ata_mode2str(mode));
atadev-mode = mode;
 }
+#endif
 
 /*
  * device related interfaces
@@ -732,6 +748,7 @@ ata_ioctl(struct cdev *dev, u_long cmd, 
 }
 #endif
 
+#ifndef ATA_CAM
 int
 ata_device_ioctl(device_t dev, u_long cmd, caddr_t data)
 {
@@ -830,6 +847,7 @@ ata_device_ioctl(device_t dev, u_long cm
return ENOTTY;
 }
 }
+#endif
 
 #ifndef ATA_CAM
 static void
@@ -878,6 +896,7 @@ ata_add_child(device_t parent, struct at
 }
 #endif
 
+#ifndef ATA_CAM
 int
 ata_getparam(struct ata_device *atadev, int init)
 {
@@ -983,6 +1002,7 @@ ata_getparam(struct ata_device *atadev, 
 }
 return error;
 }
+#endif
 
 #ifndef ATA_CAM
 int
@@ -1188,6 +1208,7 @@ ata_udelay(int interval)
pause(ataslp, interval/(100/hz));
 }
 
+#ifndef ATA_CAM
 char *
 ata_unit2str(struct ata_device *atadev)
 {
@@ -1200,6 +1221,7 @@ ata_unit2str(struct 

Re: svn commit: r232721 - head/sys/x86/include

2012-03-21 Thread Bruce Evans

On Wed, 21 Mar 2012, Tijl Coosemans wrote:


On Tuesday 20 March 2012 19:56:14 John Baldwin wrote:

On Tuesday, March 20, 2012 10:19:07 am Tijl Coosemans wrote:

...

No, on i386 bswap64 with a variable argument currently expands to two
bswap instructions. With your change it would be many shifts and logical
operations. The _gen variants are more like fallback implementations.
If bswapNN cannot be implemented directly it is split up. If those
smaller problems can be implemented directly, good, if not split it up
again and so on.


Oh, I now parse the comment in __bswap64_var() correctly.  That's fugly.

Still, it seems that if I keep the patch to port this to ia64 (so it
can do constants as constants), then it will need to use this approach
since it won't have the i386 problem (in its case the _gen variants
are only used for constants).


Maybe name them _const then as on other architectures.


But we hoped to to use the generic version on all arches, with only
1 definition for it, and nothing MD except possibly the var version.

The constant version was renamed because it isn't limited to
constants.  I think it was changed to call the general version (above
the generic version) after that, since it would have made no sense for
the constant version to call a non-constant version.  The generic
version isn't really generic, since it only works for parameters without
side effects.  This is arranged by the var versions copying the parameters
to non-volatile variables and then applying either the generic version or
asm.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233273 - head/sys/conf

2012-03-21 Thread Andre Oppermann

On 21.03.2012 09:50, Marius Strobl wrote:

Author: marius
Date: Wed Mar 21 08:50:47 2012
New Revision: 233273
URL: http://svn.freebsd.org/changeset/base/233273

Log:
   Exclude devices which are mutually exclusive with ATA_CAM. For better
   or worse, the former are still built as modules as part of the LINT
   builds

   Reviewed by: mav
   MFC after:   1 week


Is there any schedule on deorbiting old ATA?

--
Andre
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233276 - head/sys/kern

2012-03-21 Thread Andrey V. Elsukov
Author: ae
Date: Wed Mar 21 09:48:32 2012
New Revision: 233276
URL: http://svn.freebsd.org/changeset/base/233276

Log:
  Acquire modules lock before call module_getname() in the KLD_DEBUG case.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_linker.c

Modified: head/sys/kern/kern_linker.c
==
--- head/sys/kern/kern_linker.c Wed Mar 21 09:19:23 2012(r233275)
+++ head/sys/kern/kern_linker.c Wed Mar 21 09:48:32 2012(r233276)
@@ -638,8 +638,12 @@ linker_file_unload(linker_file_t file, i
 * Give the module a chance to veto the unload.
 */
if ((error = module_unload(mod)) != 0) {
+#ifdef KLD_DEBUG
+   MOD_SLOCK;
KLD_DPF(FILE, (linker_file_unload: module %s
 failed unload\n, module_getname(mod)));
+   MOD_SUNLOCK;
+#endif
return (error);
}
MOD_XLOCK;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-21 Thread Konstantin Belousov
On Tue, Mar 20, 2012 at 08:37:23PM +, Jung-uk Kim wrote:
 Author: jkim
 Date: Tue Mar 20 20:37:23 2012
 New Revision: 233249
 URL: http://svn.freebsd.org/changeset/base/233249
 
 Log:
   Fix another witness panic.  We cannot enter critical section at all because
   AcpiEnterSleepState() executes (optional) _GTS method since ACPICA 20120215
   (r231844).  To evaluate the method, we need malloc(9), which may sleep.
You papered over the issue, and not fixed it.

If sleep may happen, as it is for malloc, you cannot sleep with
interrupts turned off. This would cause a deadlock at best.

   
   Reported by:bschmidt
   MFC after:  3 days
 
 Modified:
   head/sys/amd64/acpica/acpi_wakeup.c
 
 Modified: head/sys/amd64/acpica/acpi_wakeup.c
 ==
 --- head/sys/amd64/acpica/acpi_wakeup.c   Tue Mar 20 19:47:59 2012
 (r233248)
 +++ head/sys/amd64/acpica/acpi_wakeup.c   Tue Mar 20 20:37:23 2012
 (r233249)
 @@ -223,6 +223,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
  #ifdef SMP
   cpuset_twakeup_cpus;
  #endif
 + register_t  rf;
   ACPI_STATUS status;
   int ret;
  
 @@ -241,8 +242,8 @@ acpi_sleep_machdep(struct acpi_softc *sc
  
   AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc));
  
 + rf = intr_disable();
   intr_suspend();
 - spinlock_enter();
  
   if (savectx(susppcbs[0])) {
   ctx_fpusave(suspfpusave[0]);
 @@ -299,8 +300,8 @@ out:
  #endif
  
   mca_resume();
 - spinlock_exit();
   intr_resume();
 + intr_restore(rf);
  
   AcpiSetFirmwareWakingVector(0);
  



pgpZczTVzBIkg.pgp
Description: PGP signature


Re: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf

2012-03-21 Thread Sergey Kandaurov
On 21 March 2012 12:38, Ed Schouten e...@freebsd.org wrote:
 Author: ed
 Date: Wed Mar 21 08:38:42 2012
 New Revision: 233271
 URL: http://svn.freebsd.org/changeset/base/233271

 Log:
  Remove pty(4) from our kernel configurations.

  As of FreeBSD 8, this driver should not be used. Applications that use
  posix_openpt(2) and openpty(3) use the pts(4) that is built into the
  kernel unconditionally. If it turns out high profile depend on the
  pty(4) module anyway, I'd rather get those fixed. So please report any
  issues to me.

  The pty(4) module is still available as a kernel module of course, so a
  simple `kldload pty' can be used to run old-style pseudo-terminals.

Will this affect old binaries like misc/mc build for e.g. 6.x running on GENERIC
w/o kldoaded pty(4), so that I will have to `kldload pty'?
Currently executing old mc results in emitting the following kernel message:

pid 11948 (mc) is using legacy pty devices - not logging anymore

-- 
wbr,
pluknet
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233273 - head/sys/conf

2012-03-21 Thread Marius Strobl
On Wed, Mar 21, 2012 at 10:08:51AM +0100, Andre Oppermann wrote:
 On 21.03.2012 09:50, Marius Strobl wrote:
 Author: marius
 Date: Wed Mar 21 08:50:47 2012
 New Revision: 233273
 URL: http://svn.freebsd.org/changeset/base/233273
 
 Log:
Exclude devices which are mutually exclusive with ATA_CAM. For better
or worse, the former are still built as modules as part of the LINT
builds
 
Reviewed by:  mav
MFC after:1 week
 
 Is there any schedule on deorbiting old ATA?
 

I'd say eventually we should as at them point in time it likely will
start to collect bit rot. Currently, ATA_CAM still has some bugs and
deficiencies like breaking ATAPI DMA for some controllers and generally
not supporting some others (see r233274). So at present it's IMO too
early to think about actually removing the !ATA_CAM bits from ata(4).

Marius

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233250 - in head: share/man/man4 sys/amd64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/c

2012-03-21 Thread Nathan Whitehorn

On 03/20/12 14:37, Jung-uk Kim wrote:

Author: jkim
Date: Tue Mar 20 21:37:52 2012
New Revision: 233250
URL: http://svn.freebsd.org/changeset/base/233250

Log:
   Merge ACPICA 20120320.



After this, I get an endless series of Large reference count - 
(increasingly large hex number) - utdelete-491 on the console when 
trying to boot my laptop. How should I go about trying to debug this?

-Nathan

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233273 - head/sys/conf

2012-03-21 Thread Bruce Evans

On Wed, 21 Mar 2012, Marius Strobl wrote:


Log:
 Exclude devices which are mutually exclusive with ATA_CAM. For better
 or worse, the former are still built as modules as part of the LINT
 builds

 Reviewed by:   mav
 MFC after: 1 week


This breaks NOTES on these devices.  The purpose of NOTES is to test as
much as possible, not to provide notes.  It is also supposed to test
unusual cases.  Thus if these unusualy devices actually conflict at
compile time, then it is the usual ones that confict that should not
be build by NOTES, since the usual ones get adequate testing in GENERIC.


Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Mar 21 08:43:38 2012(r233272)
+++ head/sys/conf/NOTES Wed Mar 21 08:50:47 2012(r233273)
@@ -1715,12 +1715,12 @@ device  siis
# For example to build a system which only supports a VIA chipset,
# omit 'ata' and include the 'atacore', 'atapci' and 'atavia' drivers.
device  ata
-device atadisk # ATA disk drives
-device ataraid # ATA RAID drives
-device atapicd # ATAPI CDROM drives
-device atapifd # ATAPI floppy drives
-device atapist # ATAPI tape drives
-device atapicam# emulate ATAPI devices as SCSI ditto via CAM
+#deviceatadisk # ATA disk drives
+#deviceataraid # ATA RAID drives
+#deviceatapicd # ATAPI CDROM drives
+#deviceatapifd # ATAPI floppy drives
+#deviceatapist # ATAPI tape drives
+#deviceatapicam# emulate ATAPI devices as SCSI ditto 
via CAM
# needs CAM to be present (scbus  pass)

# Modular ATA



This doesn't change the comment about ATA_CAM, so it is now out of date as
well as misformatted.  It still says that the ata peripheral devices are
(only) deprecated by ATA_CAM, not mutually exclusive.

For an example of normal formatting, see the Internet family options
(except for their unsorting and shouting and misformatting of and in the
non-option WARNING.

Another example of misformatting is in the SCHED* options.  These have
ugly ^L and # delimiters, but are
otherwise better formatted than the Internet family options.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf

2012-03-21 Thread Sergey Kandaurov
On 21 March 2012 17:42, John Baldwin j...@freebsd.org wrote:
 On Wednesday, March 21, 2012 6:44:09 am Ed Schouten wrote:
 Hi Sergey,

 * Sergey Kandaurov pluk...@freebsd.org, 20120321 11:18:
  Will this affect old binaries like misc/mc build for e.g. 6.x running on
 GENERIC
  w/o kldoaded pty(4), so that I will have to `kldload pty'?
  Currently executing old mc results in emitting the following kernel
 message:
 
  pid 11948 (mc) is using legacy pty devices - not logging anymore

 If it's dynamically linked against libc and libutil, it's not a problem.
 Otherwise you need to rebuild mc(1). If rebuilding mc(1) doesn't help,
 let me know and I'll take a look at the port.

 If apps print the is using legacy pty devices message, you probably
 need to load pty(4).

 6.x predates the symbol versioned libc, so even if it is dynamically linked it
 is still using older versions of the pty lookup routines.  It will likely need
 pty(4) forever.  Perhaps you could enable pty(4) by default if one of the
 relevant COMPAT_FREEBSD options is included?


Hmm..
I just tested misc/mc on amd64 recent head (after pty removal from GENERIC)
inside 6.2-RELEASE i386, and it works there without pty(4) in kernel.
If I made testing right, that means nothing should be changed.

-- 
wbr,
pluknet
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233273 - head/sys/conf

2012-03-21 Thread Marius Strobl
On Thu, Mar 22, 2012 at 03:28:04AM +1100, Bruce Evans wrote:
 On Wed, 21 Mar 2012, Marius Strobl wrote:
 
 Log:
  Exclude devices which are mutually exclusive with ATA_CAM. For better
  or worse, the former are still built as modules as part of the LINT
  builds
 
  Reviewed by:mav
  MFC after:  1 week
 
 This breaks NOTES on these devices.  The purpose of NOTES is to test as
 much as possible, not to provide notes.  It is also supposed to test
 unusual cases.  Thus if these unusualy devices actually conflict at
 compile time, then it is the usual ones that confict that should not
 be build by NOTES, since the usual ones get adequate testing in GENERIC.

As I wrote above, the unusual case (!ATA_CAM) is still built as modules
as part of the LINT builds. R233271 actually was the minimal change to
still build both the usual (ATA_CAM) and the unusual case as apart of the
LINT builds.

Marius

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233282 - in head/sys/dev/ata: . chipsets

2012-03-21 Thread Marius Strobl
Author: marius
Date: Wed Mar 21 16:59:39 2012
New Revision: 233282
URL: http://svn.freebsd.org/changeset/base/233282

Log:
  - First pass at const'ifying ata(4) as appropriate.
  - Use DEVMETHOD_END.
  - Use NULL instead of 0 for pointers
  
  MFC after:1 week

Modified:
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ata/ata-all.h
  head/sys/dev/ata/ata-card.c
  head/sys/dev/ata/ata-cbus.c
  head/sys/dev/ata/ata-disk.c
  head/sys/dev/ata/ata-pci.c
  head/sys/dev/ata/ata-pci.h
  head/sys/dev/ata/ata-queue.c
  head/sys/dev/ata/ata-raid.c
  head/sys/dev/ata/atapi-cam.c
  head/sys/dev/ata/atapi-cd.c
  head/sys/dev/ata/atapi-fd.c
  head/sys/dev/ata/atapi-tape.c
  head/sys/dev/ata/chipsets/ata-acard.c
  head/sys/dev/ata/chipsets/ata-acerlabs.c
  head/sys/dev/ata/chipsets/ata-adaptec.c
  head/sys/dev/ata/chipsets/ata-ahci.c
  head/sys/dev/ata/chipsets/ata-amd.c
  head/sys/dev/ata/chipsets/ata-ati.c
  head/sys/dev/ata/chipsets/ata-cyrix.c
  head/sys/dev/ata/chipsets/ata-highpoint.c
  head/sys/dev/ata/chipsets/ata-intel.c
  head/sys/dev/ata/chipsets/ata-ite.c
  head/sys/dev/ata/chipsets/ata-jmicron.c
  head/sys/dev/ata/chipsets/ata-marvell.c
  head/sys/dev/ata/chipsets/ata-national.c
  head/sys/dev/ata/chipsets/ata-nvidia.c
  head/sys/dev/ata/chipsets/ata-promise.c
  head/sys/dev/ata/chipsets/ata-serverworks.c
  head/sys/dev/ata/chipsets/ata-siliconimage.c
  head/sys/dev/ata/chipsets/ata-sis.c
  head/sys/dev/ata/chipsets/ata-via.c

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Wed Mar 21 16:16:59 2012(r233281)
+++ head/sys/dev/ata/ata-all.c  Wed Mar 21 16:59:39 2012(r233282)
@@ -1209,7 +1209,7 @@ ata_udelay(int interval)
 }
 
 #ifndef ATA_CAM
-char *
+const char *
 ata_unit2str(struct ata_device *atadev)
 {
 struct ata_channel *ch = device_get_softc(device_get_parent(atadev-dev));

Modified: head/sys/dev/ata/ata-all.h
==
--- head/sys/dev/ata/ata-all.h  Wed Mar 21 16:16:59 2012(r233281)
+++ head/sys/dev/ata/ata-all.h  Wed Mar 21 16:59:39 2012(r233282)
@@ -622,7 +622,7 @@ int ata_identify(device_t dev);
 void ata_default_registers(device_t dev);
 void ata_modify_if_48bit(struct ata_request *request);
 void ata_udelay(int interval);
-char *ata_unit2str(struct ata_device *atadev);
+const char *ata_unit2str(struct ata_device *atadev);
 const char *ata_mode2str(int mode);
 int ata_str2mode(const char *str);
 const char *ata_satarev2str(int rev);
@@ -649,7 +649,7 @@ void ata_timeout(struct ata_request *);
 void ata_catch_inflight(device_t dev);
 void ata_fail_requests(device_t dev);
 void ata_drop_requests(device_t dev);
-char *ata_cmd2str(struct ata_request *request);
+const char *ata_cmd2str(struct ata_request *request);
 
 /* ata-lowlevel.c: */
 void ata_generic_hw(device_t dev);

Modified: head/sys/dev/ata/ata-card.c
==
--- head/sys/dev/ata/ata-card.c Wed Mar 21 16:16:59 2012(r233281)
+++ head/sys/dev/ata/ata-card.c Wed Mar 21 16:59:39 2012(r233282)
@@ -49,7 +49,7 @@ __FBSDID($FreeBSD$);
 
 #include pccarddevs.h
 
-static const struct pccard_product ata_pccard_products[] = {
+static const struct pccard_product const ata_pccard_products[] = {
PCMCIA_CARD(FREECOM, PCCARDIDE),
PCMCIA_CARD(EXP, EXPMULTIMEDIA),
PCMCIA_CARD(IODATA3, CBIDE2),
@@ -172,7 +172,7 @@ static device_method_t ata_pccard_method
 DEVMETHOD(device_attach,ata_pccard_attach),
 DEVMETHOD(device_detach,ata_pccard_detach),
 
-{ 0, 0 }
+DEVMETHOD_END
 };
 
 static driver_t ata_pccard_driver = {
@@ -181,5 +181,5 @@ static driver_t ata_pccard_driver = {
 sizeof(struct ata_channel),
 };
 
-DRIVER_MODULE(ata, pccard, ata_pccard_driver, ata_devclass, 0, 0);
+DRIVER_MODULE(ata, pccard, ata_pccard_driver, ata_devclass, NULL, NULL);
 MODULE_DEPEND(ata, ata, 1, 1, 1);

Modified: head/sys/dev/ata/ata-cbus.c
==
--- head/sys/dev/ata/ata-cbus.c Wed Mar 21 16:16:59 2012(r233281)
+++ head/sys/dev/ata/ata-cbus.c Wed Mar 21 16:59:39 2012(r233282)
@@ -248,7 +248,7 @@ static device_method_t ata_cbus_methods[
 DEVMETHOD(bus_setup_intr,   ata_cbus_setup_intr),
 DEVMETHOD(bus_print_child,  ata_cbus_print_child),
 
-{ 0, 0 }
+DEVMETHOD_END
 };
 
 static driver_t ata_cbus_driver = {
@@ -393,7 +393,7 @@ static device_method_t ata_cbuschannel_m
 /* ATA methods */
 DEVMETHOD(ata_locking,  ata_cbuschannel_banking),
 #endif
-{ 0, 0 }
+DEVMETHOD_END
 };
 
 static driver_t ata_cbuschannel_driver = {
@@ -402,5 +402,5 @@ static driver_t ata_cbuschannel_driver =
 sizeof(struct ata_channel),
 };
 
-DRIVER_MODULE(ata, atacbus, ata_cbuschannel_driver, ata_devclass, 0, 0);

Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-21 Thread Jung-uk Kim
On Wednesday 21 March 2012 06:07 am, Konstantin Belousov wrote:
 On Tue, Mar 20, 2012 at 08:37:23PM +, Jung-uk Kim wrote:
  Author: jkim
  Date: Tue Mar 20 20:37:23 2012
  New Revision: 233249
  URL: http://svn.freebsd.org/changeset/base/233249
 
  Log:
Fix another witness panic.  We cannot enter critical section at
  all because AcpiEnterSleepState() executes (optional) _GTS method
  since ACPICA 20120215 (r231844).  To evaluate the method, we need
  malloc(9), which may sleep.

 You papered over the issue, and not fixed it.

Yes, it is a stopgap.

 If sleep may happen, as it is for malloc, you cannot sleep with
 interrupts turned off. This would cause a deadlock at best.

I am well aware of the problem.  In fact, that's why I had to merge 
ACPICA 20120320 rather quickly, which added a new flag to not execute 
_GTS method.  Both _GTS and _BFS are turned off by default.  You can 
control them with a new tunable debug.acpi.sleep_flags if you want.  
Please see the updated acpi(4).

Jung-uk Kim
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-21 Thread Andriy Gapon
on 21/03/2012 19:41 Jung-uk Kim said the following:
 I am well aware of the problem.  In fact, that's why I had to merge 
 ACPICA 20120320 rather quickly, which added a new flag to not execute 
 _GTS method.  Both _GTS and _BFS are turned off by default.  You can 
 control them with a new tunable debug.acpi.sleep_flags if you want.  

But the bug still has to be fixed, right?
Even if it takes a non-default sysctl value to give the bug a chance.

-- 
Andriy Gapon
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233273 - head/sys/conf

2012-03-21 Thread Bruce Evans

On Wed, 21 Mar 2012, Marius Strobl wrote:


On Thu, Mar 22, 2012 at 03:28:04AM +1100, Bruce Evans wrote:

On Wed, 21 Mar 2012, Marius Strobl wrote:


Log:
Exclude devices which are mutually exclusive with ATA_CAM. For better
or worse, the former are still built as modules as part of the LINT
builds

Reviewed by:mav
MFC after:  1 week


This breaks NOTES on these devices.  The purpose of NOTES is to test as
much as possible, not to provide notes.  It is also supposed to test
unusual cases.  Thus if these unusualy devices actually conflict at
compile time, then it is the usual ones that confict that should not
be build by NOTES, since the usual ones get adequate testing in GENERIC.


As I wrote above, the unusual case (!ATA_CAM) is still built as modules
as part of the LINT builds. R233271 actually was the minimal change to
still build both the usual (ATA_CAM) and the unusual case as apart of the
LINT builds.


Not on systems which build the correct number of modules (that is,
zero) as part of building kernels.  Though LINT should arguably ignore
the system's preferences for modules (as expressed by NO_MODULES in
/etc/make.conf), it actually respects them, and it must not ignore the
user's preferences for modules (as expressed by NO_MODULES in the
environment).

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-21 Thread Jung-uk Kim
On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote:
 on 21/03/2012 19:41 Jung-uk Kim said the following:
  I am well aware of the problem.  In fact, that's why I had to
  merge ACPICA 20120320 rather quickly, which added a new flag to
  not execute _GTS method.  Both _GTS and _BFS are turned off by
  default.  You can control them with a new tunable
  debug.acpi.sleep_flags if you want.

 But the bug still has to be fixed, right?
 Even if it takes a non-default sysctl value to give the bug a
 chance.

Ideally, yes.  However, I am not so sure if we can call it a bug 
because AcpiEnterSleepState() must be called with interrupt disabled 
and there is no way to change that API without breaking other OSes.  
We can only work around it locally or persuade upstream to find a 
better way to do this in ACPICA itself.  Either way, it will be 
pretty hackish. :-(

Jung-uk Kim
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233283 - head/sys/dev/usb/wlan

2012-03-21 Thread Bernhard Schmidt
Author: bschmidt
Date: Wed Mar 21 19:08:44 2012
New Revision: 233283
URL: http://svn.freebsd.org/changeset/base/233283

Log:
  Load the firmware during init not attach, as a root filesystem might
  not yet be available. While here, also print the firmware version.
  
  Submitted by: PseudoCylon
  MFC after:3 days

Modified:
  head/sys/dev/usb/wlan/if_run.c

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Wed Mar 21 16:59:39 2012
(r233282)
+++ head/sys/dev/usb/wlan/if_run.c  Wed Mar 21 19:08:44 2012
(r233283)
@@ -600,12 +600,6 @@ run_attach(device_t self)
sc-mac_ver, sc-mac_rev, run_get_rf(sc-rf_rev),
sc-ntxchains, sc-nrxchains, ether_sprintf(sc-sc_bssid));
 
-   if ((error = run_load_microcode(sc)) != 0) {
-   device_printf(sc-sc_dev, could not load 8051 microcode\n);
-   RUN_UNLOCK(sc);
-   goto detach;
-   }
-
RUN_UNLOCK(sc);
 
ifp = sc-sc_ifp = if_alloc(IFT_IEEE80211);
@@ -1050,8 +1044,9 @@ run_load_microcode(struct run_softc *sc)
error = ETIMEDOUT;
goto fail;
}
-   device_printf(sc-sc_dev, firmware %s loaded\n,
-   (base == fw-data) ? RT2870 : RT3071);
+   device_printf(sc-sc_dev, firmware %s ver. %u.%u loaded\n,
+   (base == fw-data) ? RT2870 : RT3071,
+   *(base + 4092), *(base + 4093));
 
 fail:
firmware_put(fw, FIRMWARE_UNLOAD);
@@ -4677,6 +4672,11 @@ run_init_locked(struct run_softc *sc)
 
run_stop(sc);
 
+   if (run_load_microcode(sc) != 0) {
+   device_printf(sc-sc_dev, could not load 8051 microcode\n);
+   goto fail;
+   }
+
for (ntries = 0; ntries  100; ntries++) {
if (run_read(sc, RT2860_ASIC_VER_ID, tmp) != 0)
goto fail;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233284 - head/sys/contrib/dev/run

2012-03-21 Thread Bernhard Schmidt
Author: bschmidt
Date: Wed Mar 21 19:09:52 2012
New Revision: 233284
URL: http://svn.freebsd.org/changeset/base/233284

Log:
  Update the firmware to version 0.236
  
  Submitted by: PseudoCylon
  MFC after:2 weeks

Modified:
  head/sys/contrib/dev/run/rt2870.fw.uu

Modified: head/sys/contrib/dev/run/rt2870.fw.uu
==
--- head/sys/contrib/dev/run/rt2870.fw.uu   Wed Mar 21 19:08:44 2012
(r233283)
+++ head/sys/contrib/dev/run/rt2870.fw.uu   Wed Mar 21 19:09:52 2012
(r233284)
@@ -39,70 +39,77 @@
 # DAMAGE.
 #
 # This file contains two 4KB firmware, first half is RT2870 and last half
-# is RT3071. On each 4KB firmware, 3rd last byte is major version number and
-# 2nd last byte is minor version number.
+# is RT3071. On each 4KB firmware, the last 2 bytes are CRC, 3rd last byte
+# is minor version number and 4th last byte is major version number.
 # This file comes with
-#  RT2870 v. 0.17
-#  RT3071 v. 0.17
+#  RT2870 v. 0.236
+#  RT3071 v. 0.236
 begin 644 rt2870.fw.uu
-M`A`H`A`R`A!X`A,J`A,K`A-*`A-/$A-+(@(7N0(8\`(42`(3@S`%!B`-
-M`Q(9R*0`8S@,.,;Y4PPX`1_0(`?P0$_O\)`!C'0(\.20`:?PD`,X##@
-M')`!@.T`A6CX+0!$)`!A.T@0F0`8QT`?`2#@BD`04X#G`P(3*9!P$N#U
-M5I`$!.`2IT0V3$0O381`E`1.5$10E(10E,10E01@U41TE82,'`26W$2B7(2
-MX',3`8```!,ID'`1X/4\Y)!P$_0!!1T@/#E5O1P`P(3*0(3(B``S`#'7T
-MKU82Y0!!1T@/#DD'`3\.56]'`#`A,I`A,BA59!T@(BD'`0X%1__[\*#9!P
-M$T`9U3@%U3X20!#@5'__OP(2D'`1X0(8`3@M`=4X#=4\@Y/4G(I!P
-M$`D_Y)'(I`$!.`EX1=]50!#@_W1')5?XQN_D'`1X/]T257^,;OQN3]
-MKU82Y0!!1T@/#DD'`3\.56]'`#`A,I`A,BY4=D!V`=Y4=D`7Y4=D6`1
-MY4=DF`+Y4=DV`%Y4T#`B0!'@5`_U.N5'M`D(Y3JT`P/D]4;E1[0*.4Z
-MM`$#Y/5Y/VO5A(+D=($(I!P$#T_Y!P$.!?_Y!P$!5)T^0!CPD'`1X)!P
-M?#D_:]6$@N1,!4$TA2`)I!P.#U)Y`*#_D'`9X/[O7I`*?`P1P2O)X`$
-MY2?T_Y`*._PY5;T`,$RD$R*0!#@_I!P$#][?CF]5?]KU82Y0!!1T
-M@/#DD'`3\.56]'`#`A,I`A,BD'`0X/Z0!'@_WU@HZ#X/57_:]6$@N1D`04
-M=(#PY)!P$_#E5O1P`P(3*0(3(I`0`.#U5Y`0`N#U6*/@]5GE6+1P'N59M#`9
-MD`4(X$0!\/V0!07@5/OP1`3P[53^D`4(\.3U3O5/=3K_=3S_K5O5A(+D9`$
-M%'2`\.20!/PY5;T8$N`0I!P$.`D_Y*3Y/VO5A(+D9`$%'2`\.20!/PY5;T
-M8J`(9!P$.`D_Y)*T@6M5Z]6$@N1D`04=(#PY)!P$_#E5O1@!Y!P)!$`?`B
-M(N53!HP8`FR33!-!`5P@3E3T5.8`CE3Q5/`(53B(BPD+3(C`4,)!P!5
-M)_^0!C@3_4GD`(IX/^0!G@_N]D`(I\#!'!*\G@`3E)_3_D`(H[_#%+
-M2\),Y402IT3I0`4,P04+P@4#Q`3N2`3V6`3ZJ```!0UA4A#A4IA4QY4=D
-M!F`#`A0U@!OE2,14#_5#Y4K$5`_U0N5,Q%0/]5[E1V0%30P^`7(5)0X5+
-M0H5-7N5'9`9P38`;Y4G$5`_U0^5+Q%0/]4+E314#_5Y4=D!G`PY4-4#T00
-M]4.`)N5'9`1@!5'M`40UX$=4()Y4T!A#E0U0/1##U0X`TDN``M),Y/4E
-MY4+$5/#_Y4-4#T_U7])@(M(5Y4D]6`+),M@!R1``;%2(2%X02%K%*O
-MP@32KR+KY`$%.!4#F`$TAB`.5.14\D_Y(8TJ^0!!3@HN2270\.5?5`_U
-M+4E!,P`7E7R#ES`95?5##_OS`1Y25P!74E#(`%272;-)M@`_E7S#F
-M!L)LTFV`!-)LPFWE1V0#$P2P;;-)M@!CE)7`#,$P1PDSE)7`%=24'@`(5
-M)=)LTFWE1[0)%.5$(.,+Y3ID`F`%Y3JT`P3;-)MY4TA/E.K0!!L)LTFV`
-M.4Z`32;,)M(D'Y5X@X`*R:!K!^5(.$LFH@;0?E7B#B`K)L=2Y`(D$
-MHFB`)C!H!N5HN*`'5(.($?P``G\`Y494\/Z^\`1^`8`?@#N;R3_DG.2
-MB!K!*)J@8P:@;E1J+B@!WE7B#@!'\!@`)_`.55/#^OO`$?@``GX`[F\D
-M_Y)UDG0@;02B;(`FY4=DG`B,PY4:BXX`7Y3JT`0;E1J+C@#3E1B#D`S#E
-M`].``.`)C!L!N5HN*`'5(.$$?P``G\`Y494\/Z^\`1^`8`?@#N;R3_
-MDG2)`0`.0$SPD!`#X,.4,$`4HG2=Z)PDG;E+A,35#_U+L)WTG:0$_E
-M+O#E1V0#F0`BG@5/[PY4/$5`\48`PD_F`,)`-P$\(X@`_2.(`+Y48PX@/3
-M@`'#DC@P1P6O)P(7?N4G]/\%W[E1V0'8`_E1V0(8`GE1V0)8`,%OV0`BG@
-M5/SPY3H48(48448TD_!))/E@%0.%#E1A,35#]U\`.$Y?`D_X`ZTCG
-M.(`^Y48PX@/3@!W#@!KE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(XPCF`
-M$^5,.(#TX`!PY(YPCB`!,(XPCDP1P2O)X`$Y2?T_P(7?N5'9`Q@!N5'9`MP
-MI`*!4_?#E.A1@(!1@(11@*R3\8$4D^6`2)`YP2N5$Q-4/W7P`X3E\(`I
-MTCF`.N5,.(#TX`!PY(Y@WE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(Y
-M@`_E1C#B`].``.2.8`PCDP1P2O)X`$Y2?T_Y`*._P(N5'M`L0D`(IX%3K
-M\.4G5.M%1?4G(N20`BGP,$$KT6`!.5%]/^0`BCO\*/4-)9(H]4TE@BY/5B
-MPJ_E411@2!1@9B08`,-326755`9`HN!4?_CX#G(Y`$-.T`ARCX+0
-M%Z/@M`(2?R`2%Z^0$`3@5//P=5$!`AC4Y5!P!G5B`P(8U)`2`.!4`W`2?R`2
-M%Z^0`J+@5+_P=5$`AC4Y5!P`P(8SY`H^`PY@,,N0!#?@9)@`P(8RY`!
-MBG1^\)`!EO0$@1TO#E6+1R%59M#40Y)`%`/C=`CPHW0!\'0#\'\!$@TJ
-MD!,HX)!PO0$RG@D'`;\)`3*.!4\/CX%3P\.59M#44Y3ST8`:CX%3S@!20
-M$RK@5/OP@!3E//20$RI@.!4\D4\\(`$X%3Z\)`$`!4_?!U8@%U50+D]5`
-M50`5U8@/U45B8!7`3U4)9K6*O0!(9E.5BM`,T@/2KR+KS`!$N20
-M`9;P]5'6(!?0*O0!(9E.52%`,!`#`AF1=5(!=54#D`0!X$0.\)!PN0
-M$RCPD'`;X)`3*?#E//1@.4\1`C\(`D!,J=`7PD!($=`/PY5BTA;E6;0U
-M$9`%`'3B\*-T/C=`'P=`/P?P$2#2J0`J+@1,#PD!`$X$0,\.3U4O55,`()
-MP@)]`:]!$AF4,`,P@/DD`6\-*O(N_T8WD_G04+O6Y#1P]8/@M/\9=!0N
-M]8+D-'#U@^_P=!PN]8+D-'#U@^WP(@Z^!-4B(B*0K@,.%-PJ^0C@D!`
-M\)!P*0$!WPD'`JX)`0'O0$!S@]6*0$![@(.'SD!`X)!P*/0$!W@D'`I
-M\)`0'N0KP,$H'D'`DX$0!\,(%TJ\B(B(`
+M`A`H`A`R`A!]`A.[`A.\`A/;`A/@$A/(@(8V@(:@(5/`(4=S`%!B`-
+M`Q(:_R*0`8S@,.,@Y5@PX!#E3##@!']`@`)_`)`0+^_PD`,=`CPY)`!I_0
+M`8S@,.`D``X+0%:/@M`$0D`$X+2!9`!C'0!\!(-R*0!!3@(.#`A.Z
+MD'`2X/56D`0$X!(*G1#A,1#%-A$*4!%!41%*4A%*4Q%*5!+51':5A(X!)C
+M1*1A,\Q-=@!.`D```$[J0!'@]3SDD'`3\)`$%'2`\.56]'`#`A.Z`A.S
+M(`(#,`,=?0*O5A(+D9`$%'2`\.20!/PY5;T`,$[H$[.%5D'2`B*0!#@
+M5'__OPH-D'`1X+0(!G5.`75/A)!P$.!4?_^_`A*0!'@9`A@!.T(`9U3@-U
+M3R#D]2BD'`1X3_DDBD`0$X7@)%WU5Y!P$.#_=$E5_C[\:0!'@_W1(

svn commit: r233287 - head/sys/boot/uboot/lib

2012-03-21 Thread Marius Strobl
Author: marius
Date: Wed Mar 21 20:53:47 2012
New Revision: 233287
URL: http://svn.freebsd.org/changeset/base/233287

Log:
  Use the common/shared CRC-32 implementation instead of duplicating it.
  
  MFC after:1 week

Modified:
  head/sys/boot/uboot/lib/Makefile
  head/sys/boot/uboot/lib/glue.c

Modified: head/sys/boot/uboot/lib/Makefile
==
--- head/sys/boot/uboot/lib/MakefileWed Mar 21 20:50:47 2012
(r233286)
+++ head/sys/boot/uboot/lib/MakefileWed Mar 21 20:53:47 2012
(r233287)
@@ -1,11 +1,13 @@
 # $FreeBSD$
 
+.PATH: ${.CURDIR}/../../common
+
 LIB=   uboot
 INTERNALLIB=
 WARNS?=2
 
-SRCS=  devicename.c elf_freebsd.c console.c copy.c disk.c \
-   module.c net.c reboot.c time.c glue.c
+SRCS=  crc32.c console.c copy.c devicename.c disk.c elf_freebsd.c glue.c
+SRCS+= module.c net.c reboot.c time.c
 
 CFLAGS+=   -ffreestanding -msoft-float
 

Modified: head/sys/boot/uboot/lib/glue.c
==
--- head/sys/boot/uboot/lib/glue.c  Wed Mar 21 20:50:47 2012
(r233286)
+++ head/sys/boot/uboot/lib/glue.c  Wed Mar 21 20:53:47 2012
(r233287)
@@ -27,6 +27,9 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#include sys/types.h
+
+#include crc32.h
 #include stand.h
 #include api_public.h
 #include glue.h
@@ -43,69 +46,6 @@ __FBSDID($FreeBSD$);
 /* Some random address used by U-Boot. */
 extern long uboot_address;
 
-/* crc32 stuff stolen from lib/libdisk/write_ia64_disk.c */
-static uint32_t crc32_tab[] = {
-   0x, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
-   0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
-   0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
-   0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-   0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
-   0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
-   0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
-   0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-   0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
-   0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
-   0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
-   0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-   0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
-   0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
-   0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
-   0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-   0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
-   0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
-   0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
-   0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-   0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
-   0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
-   0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
-   0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-   0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
-   0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
-   0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
-   0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-   0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
-   0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
-   0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
-   0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-   0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
-   0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
-   0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
-   0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-   0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
-   0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
-   0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
-   0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-   0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
-   0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 

Re: svn commit: r233250 - in head: share/man/man4 sys/amd64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/c

2012-03-21 Thread Jung-uk Kim
On Wednesday 21 March 2012 05:18 pm, Andreas Tobler wrote:
 On 21.03.12 15:31, Nathan Whitehorn wrote:
  On 03/20/12 14:37, Jung-uk Kim wrote:
  Author: jkim
  Date: Tue Mar 20 21:37:52 2012
  New Revision: 233250
  URL: http://svn.freebsd.org/changeset/base/233250
 
  Log:
  Merge ACPICA 20120320.
 
  After this, I get an endless series of Large reference count -
  (increasingly large hex number) - utdelete-491 on the console
  when trying to boot my laptop. How should I go about trying to
  debug this?

 I have the same situation on my IBM T60. Only a boot with
 kernel.old helps

I just reported the issue to upstream becuase I cannot reproduce it.  
Please stay tuned.

Jung-uk Kim
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233290 - head/sys/amd64/amd64

2012-03-21 Thread Alan Cox
Author: alc
Date: Thu Mar 22 04:40:22 2012
New Revision: 233290
URL: http://svn.freebsd.org/changeset/base/233290

Log:
  Change pv_entry_count to a long.  During the lifetime of FreeBSD 10.x,
  physical memory sizes at the high-end will likely reach a point that
  the number of pv entries could overflow an int.
  
  Submitted by: kib

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Mar 21 23:10:16 2012(r233289)
+++ head/sys/amd64/amd64/pmap.c Thu Mar 22 04:40:22 2012(r233290)
@@ -202,7 +202,7 @@ static u_int64_tDMPDPphys;  /* phys addr
 /*
  * Data for the pv entry allocation mechanism
  */
-static int pv_entry_count;
+static long pv_entry_count;
 static struct md_page *pv_table;
 
 /*
@@ -2005,7 +2005,7 @@ pv_to_chunk(pv_entry_t pv)
 
 static uint64_t pc_freemask[_NPCM] = { PC_FREE0, PC_FREE1, PC_FREE2 };
 
-SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, pv_entry_count, 0,
+SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, pv_entry_count, 0,
Current number of pv entries);
 
 #ifdef PV_STATS
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r233291 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include kern sys vm

2012-03-21 Thread Alan Cox
Author: alc
Date: Thu Mar 22 04:52:51 2012
New Revision: 233291
URL: http://svn.freebsd.org/changeset/base/233291

Log:
  Handle spurious page faults that may occur in no-fault sections of the
  kernel.
  
  When access restrictions are added to a page table entry, we flush the
  corresponding virtual address mapping from the TLB.  In contrast, when
  access restrictions are removed from a page table entry, we do not
  flush the virtual address mapping from the TLB.  This is exactly as
  recommended in AMD's documentation.  In effect, when access
  restrictions are removed from a page table entry, AMD's MMUs will
  transparently refresh a stale TLB entry.  In short, this saves us from
  having to perform potentially costly TLB flushes.  In contrast,
  Intel's MMUs are allowed to generate a spurious page fault based upon
  the stale TLB entry.  Usually, such spurious page faults are handled
  by vm_fault() without incident.  However, when we are executing
  no-fault sections of the kernel, we are not allowed to execute
  vm_fault().  This change introduces special-case handling for spurious
  page faults that occur in no-fault sections of the kernel.
  
  In collaboration with:kib
  Tested by:gibbs (an earlier version)
  
  I would also like to acknowledge Hiroki Sato's assistance in
  diagnosing this problem.
  
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/include/proc.h
  head/sys/i386/i386/trap.c
  head/sys/i386/include/proc.h
  head/sys/kern/kern_sysctl.c
  head/sys/kern/subr_uio.c
  head/sys/sys/proc.h
  head/sys/vm/vm_fault.c

Modified: head/sys/amd64/amd64/trap.c
==
--- head/sys/amd64/amd64/trap.c Thu Mar 22 04:40:22 2012(r233290)
+++ head/sys/amd64/amd64/trap.c Thu Mar 22 04:52:51 2012(r233291)
@@ -301,26 +301,6 @@ trap(struct trapframe *frame)
}
 
code = frame-tf_err;
-   if (type == T_PAGEFLT) {
-   /*
-* If we get a page fault while in a critical section, then
-* it is most likely a fatal kernel page fault.  The kernel
-* is already going to panic trying to get a sleep lock to
-* do the VM lookup, so just consider it a fatal trap so the
-* kernel can print out a useful trap message and even get
-* to the debugger.
-*
-* If we get a page fault while holding a non-sleepable
-* lock, then it is most likely a fatal kernel page fault.
-* If WITNESS is enabled, then it's going to whine about
-* bogus LORs with various VM locks, so just skip to the
-* fatal trap handling directly.
-*/
-   if (td-td_critnest != 0 ||
-   WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
-   Kernel page fault) != 0)
-   trap_fatal(frame, frame-tf_addr);
-   }
 
 if (ISPL(frame-tf_cs) == SEL_UPL) {
/* user trap */
@@ -653,6 +633,50 @@ trap_pfault(frame, usermode)
struct proc *p = td-td_proc;
vm_offset_t eva = frame-tf_addr;
 
+   if (__predict_false((td-td_pflags  TDP_NOFAULTING) != 0)) {
+   /*
+* Due to both processor errata and lazy TLB invalidation when
+* access restrictions are removed from virtual pages, memory
+* accesses that are allowed by the physical mapping layer may
+* nonetheless cause one spurious page fault per virtual page. 
+* When the thread is executing a no faulting section that
+* is bracketed by vm_fault_{disable,enable}_pagefaults(),
+* every page fault is treated as a spurious page fault,
+* unless it accesses the same virtual address as the most
+* recent page fault within the same no faulting section.
+*/
+   if (td-td_md.md_spurflt_addr != eva ||
+   (td-td_pflags  TDP_RESETSPUR) != 0) {
+   /*
+* Do nothing to the TLB.  A stale TLB entry is
+* flushed automatically by a page fault.
+*/
+   td-td_md.md_spurflt_addr = eva;
+   td-td_pflags = ~TDP_RESETSPUR;
+   return (0);
+   }
+   } else {
+   /*
+* If we get a page fault while in a critical section, then
+* it is most likely a fatal kernel page fault.  The kernel
+* is already going to panic trying to get a sleep lock to
+* do the VM lookup, so just consider it a fatal trap so the
+* kernel can print out a useful trap message and even get
+* to the debugger.
+*
+