Re: svn commit: r209578 - head/sys/sys

2010-06-29 Thread Kostik Belousov
On Mon, Jun 28, 2010 at 02:07:02PM -0700, Matthew Fleming wrote:
> On Mon, Jun 28, 2010 at 10:59 AM, Konstantin Belousov  
> wrote:
> > Author: kib
> > Date: Mon Jun 28 17:59:45 2010
> > New Revision: 209578
> > URL: http://svn.freebsd.org/changeset/base/209578
> >
> > Log:
> >  Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
> >
> >  MFC after:    1 week
> >
> > Modified:
> >  head/sys/sys/sysent.h
> >
> > Modified: head/sys/sys/sysent.h
> > ==
> > --- head/sys/sys/sysent.h       Mon Jun 28 17:45:00 2010        (r209577)
> > +++ head/sys/sys/sysent.h       Mon Jun 28 17:59:45 2010        (r209578)
> > @@ -144,10 +144,10 @@ struct syscall_module_data {
> >
> >  #define        MAKE_SYSENT(syscallname)                                \
> >  static struct sysent syscallname##_sysent = {                  \
> > -       (sizeof(struct syscallname ## _args )                   \
> > +       .sy_narg = (sizeof(struct syscallname ## _args )        \
> >            / sizeof(register_t)),                              \
> > -       (sy_call_t *)& syscallname,                             \
> > -       SYS_AUE_##syscallname                                   \
> > +       .sy_call = (sy_call_t *)& syscallname,                  \
> > +       .sy_auevent = SYS_AUE_##syscallname,                    \
> >  }
> >
> >  #define SYSCALL_MODULE(name, offset, new_sysent, evh, arg)     \
> >
> 
> This change prevents (I assume) the use of MAKE_SYSENT() in a C++
> kernel module, as C++ does not support the .name = value style of
> named initializers.
> 
> gcc does allow name: value initializers and it's easy to patch it to
> accept .name = value, but it's not strictly conforming C++ code
> anymore.
I do not mind reverting this, I think it would be better then
having #ifdef __cplusplus and two definitions. I really wanted to
have a way to provide sparce initializator for the struct sysent.
I managed to not require it for r209579.


pgpWqOcrlYRSc.pgp
Description: PGP signature


Re: svn commit: r209578 - head/sys/sys

2010-06-29 Thread mdf
2010/6/29 Kostik Belousov :
> On Mon, Jun 28, 2010 at 02:07:02PM -0700, Matthew Fleming wrote:
>> On Mon, Jun 28, 2010 at 10:59 AM, Konstantin Belousov  
>> wrote:
>> > Author: kib
>> > Date: Mon Jun 28 17:59:45 2010
>> > New Revision: 209578
>> > URL: http://svn.freebsd.org/changeset/base/209578
>> >
>> > Log:
>> >  Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
>> >
>> >  MFC after:    1 week
>> >
>> > Modified:
>> >  head/sys/sys/sysent.h
>> >
>> > Modified: head/sys/sys/sysent.h
>> > ==
>> > --- head/sys/sys/sysent.h       Mon Jun 28 17:45:00 2010        (r209577)
>> > +++ head/sys/sys/sysent.h       Mon Jun 28 17:59:45 2010        (r209578)
>> > @@ -144,10 +144,10 @@ struct syscall_module_data {
>> >
>> >  #define        MAKE_SYSENT(syscallname)                                \
>> >  static struct sysent syscallname##_sysent = {                  \
>> > -       (sizeof(struct syscallname ## _args )                   \
>> > +       .sy_narg = (sizeof(struct syscallname ## _args )        \
>> >            / sizeof(register_t)),                              \
>> > -       (sy_call_t *)& syscallname,                             \
>> > -       SYS_AUE_##syscallname                                   \
>> > +       .sy_call = (sy_call_t *)& syscallname,                  \
>> > +       .sy_auevent = SYS_AUE_##syscallname,                    \
>> >  }
>> >
>> >  #define SYSCALL_MODULE(name, offset, new_sysent, evh, arg)     \
>> >
>>
>> This change prevents (I assume) the use of MAKE_SYSENT() in a C++
>> kernel module, as C++ does not support the .name = value style of
>> named initializers.
>>
>> gcc does allow name: value initializers and it's easy to patch it to
>> accept .name = value, but it's not strictly conforming C++ code
>> anymore.
> I do not mind reverting this, I think it would be better then
> having #ifdef __cplusplus and two definitions. I really wanted to
> have a way to provide sparce initializator for the struct sysent.
> I managed to not require it for r209579.

I agree it's really handy to have sparse initializers; I just haven't
thought of a way to do that and continue to allow 3rd party c++
modules.  Perhaps we'll get a new c++ standard soon that supports this
syntax. :-)

Thanks,
matthew
___
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: r209587 - head/sys/sys

2010-06-29 Thread Konstantin Belousov
Author: kib
Date: Tue Jun 29 14:31:49 2010
New Revision: 209587
URL: http://svn.freebsd.org/changeset/base/209587

Log:
  Revert r209578:
Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
  C++ does not have designator-initializer facility of C99, not using this
  in the header makes us friendly to C++ kernel modules, whoever wants
  such schism.
  
  Requested by: mdf
  MFC after:6 days (not really)

Modified:
  head/sys/sys/sysent.h

Modified: head/sys/sys/sysent.h
==
--- head/sys/sys/sysent.h   Tue Jun 29 10:21:34 2010(r209586)
+++ head/sys/sys/sysent.h   Tue Jun 29 14:31:49 2010(r209587)
@@ -151,10 +151,10 @@ struct syscall_module_data {
 
 #defineMAKE_SYSENT(syscallname)\
 static struct sysent syscallname##_sysent = {  \
-   .sy_narg = (sizeof(struct syscallname ## _args )\
+   (sizeof(struct syscallname ## _args )   \
/ sizeof(register_t)),  \
-   .sy_call = (sy_call_t *)& syscallname,  \
-   .sy_auevent = SYS_AUE_##syscallname,\
+   (sy_call_t *)& syscallname, \
+   SYS_AUE_##syscallname   \
 }
 
 #define SYSCALL_MODULE(name, offset, new_sysent, evh, arg) \
___
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: r209588 - head/share/man/man3

2010-06-29 Thread John Baldwin
Author: jhb
Date: Tue Jun 29 14:32:01 2010
New Revision: 209588
URL: http://svn.freebsd.org/changeset/base/209588

Log:
  - The ETIMEDOUT error applies to pthread_timedjoin_np(), not pthread_join().
  - Tweak wording in history section for pthread_timedjoin_np().
  
  MFC after:3 days

Modified:
  head/share/man/man3/pthread_join.3

Modified: head/share/man/man3/pthread_join.3
==
--- head/share/man/man3/pthread_join.3  Tue Jun 29 14:31:49 2010
(r209587)
+++ head/share/man/man3/pthread_join.3  Tue Jun 29 14:32:01 2010
(r209588)
@@ -116,7 +116,7 @@ The implementation detected that another
 .El
 .Pp
 Additionally, the
-.Fn pthread_join
+.Fn pthread_timedjoin_np
 function will fail if:
 .Bl -tag -width Er
 .It Bq Er ETIMEDOUT
@@ -134,7 +134,7 @@ function conforms to
 .St -p1003.1-96 .
 The
 .Fn pthread_timedjoin_np
-is
+is a
 .Fx
-extension, first appeared in
+extension which first appeared in
 .Fx 6.1 .
___
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: r209589 - head/sys/netinet/ipfw

2010-06-29 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jun 29 16:57:30 2010
New Revision: 209589
URL: http://svn.freebsd.org/changeset/base/209589

Log:
  After processing the O_SKIPTO opcode our cmd points to the next rule, and
  "match" processing at the end of inner loop would look ahead into the next
  rule, which is incorrect. Particularly, in the case when the next rule
  started with F_NOT opcode it was skipped blindly.
  
  To fix this, exit the inner loop with the continue operator forcibly and
  explicitly.
  
  PR:   kern/147798

Modified:
  head/sys/netinet/ipfw/ip_fw2.c

Modified: head/sys/netinet/ipfw/ip_fw2.c
==
--- head/sys/netinet/ipfw/ip_fw2.c  Tue Jun 29 14:32:01 2010
(r209588)
+++ head/sys/netinet/ipfw/ip_fw2.c  Tue Jun 29 16:57:30 2010
(r209589)
@@ -2012,14 +2012,15 @@ do {
\
 (1 << chain->map[f_pos]->set));
f_pos++)
;
-   /* prepare to enter the inner loop */
+   /* Re-enter the inner loop at the skipto rule. */
f = chain->map[f_pos];
l = f->cmd_len;
cmd = f->cmd;
match = 1;
cmdlen = 0;
skip_or = 0;
-   break;
+   continue;
+   break;  /* not reached */
 
case O_REJECT:
/*
___
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: r209590 - head/sys/cam

2010-06-29 Thread Matt Jacob
Author: mjacob
Date: Tue Jun 29 17:10:55 2010
New Revision: 209590
URL: http://svn.freebsd.org/changeset/base/209590

Log:
  Don't lock buses around a call to xptperiphlistmatch- the buses will be
  locked at appropriate places.
  
  MFC after:1 week
  X-MFC:208752

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Tue Jun 29 16:57:30 2010(r209589)
+++ head/sys/cam/cam_xpt.c  Tue Jun 29 17:10:55 2010(r209590)
@@ -2683,9 +2683,7 @@ xpt_action_default(union ccb *start_ccb)
xptedtmatch(cdm);
break;
case CAM_DEV_POS_PDRV:
-   xpt_lock_buses();
xptperiphlistmatch(cdm);
-   xpt_unlock_buses();
break;
default:
cdm->status = CAM_DEV_MATCH_ERROR;
___
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: r208752 - head/sys/cam

2010-06-29 Thread Matthew Jacob

Fixed, thanks.

___
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: r209591 - head/sys/powerpc/include

2010-06-29 Thread Marcel Moolenaar
Author: marcel
Date: Tue Jun 29 19:07:44 2010
New Revision: 209591
URL: http://svn.freebsd.org/changeset/base/209591

Log:
  Fix profiling (part 1):
  o   Functions are 4-byte aligned for Book-E.
  o   We get compiled with -DPROF and not -DGPROF if profiling
  is enabled.

Modified:
  head/sys/powerpc/include/asm.h
  head/sys/powerpc/include/profile.h

Modified: head/sys/powerpc/include/asm.h
==
--- head/sys/powerpc/include/asm.h  Tue Jun 29 17:10:55 2010
(r209590)
+++ head/sys/powerpc/include/asm.h  Tue Jun 29 19:07:44 2010
(r209591)
@@ -63,7 +63,7 @@
 #define_ENTRY(x) \
.text; .align 4; .globl x; .type x,@function; x:
 
-#ifdef GPROF
+#ifdef PROF
 # define   _PROF_PROLOGUE  mflr 0; stw 0,4(1); bl _mcount
 #else
 # define   _PROF_PROLOGUE

Modified: head/sys/powerpc/include/profile.h
==
--- head/sys/powerpc/include/profile.h  Tue Jun 29 17:10:55 2010
(r209590)
+++ head/sys/powerpc/include/profile.h  Tue Jun 29 19:07:44 2010
(r209591)
@@ -34,7 +34,7 @@
 
 #define_MCOUNT_DECLvoid __mcount
 
-#define FUNCTION_ALIGNMENT 16
+#defineFUNCTION_ALIGNMENT  4
 
 typedef u_int  fptrdiff_t;
 
___
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: r209592 - in head/sys: compat/linux kern sys

2010-06-29 Thread John Baldwin
Author: jhb
Date: Tue Jun 29 20:41:52 2010
New Revision: 209592
URL: http://svn.freebsd.org/changeset/base/209592

Log:
  Tweak the in-kernel API for sending signals to threads:
  - Rename tdsignal() to tdsendsignal() and make it private to kern_sig.c.
  - Add tdsignal() and tdksignal() routines that mirror psignal() and
pksignal() except that they accept a thread as an argument instead of
a process.  They send a signal to a specific thread rather than to an
individual process.
  
  Reviewed by:  kib

Modified:
  head/sys/compat/linux/linux_signal.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_exit.c
  head/sys/kern/kern_sig.c
  head/sys/kern/kern_thr.c
  head/sys/sys/signalvar.h

Modified: head/sys/compat/linux/linux_signal.c
==
--- head/sys/compat/linux/linux_signal.cTue Jun 29 19:07:44 2010
(r209591)
+++ head/sys/compat/linux/linux_signal.cTue Jun 29 20:41:52 2010
(r209592)
@@ -501,7 +501,7 @@ linux_rt_sigtimedwait(struct thread *td,
/* Repost if we got an error. */
if (error && info.ksi_signo) {
PROC_LOCK(td->td_proc);
-   tdsignal(td->td_proc, td, info.ksi_signo, &info);
+   tdksignal(td, info.ksi_signo, &info);
PROC_UNLOCK(td->td_proc);
} else
td->td_retval[0] = info.ksi_signo; 
@@ -587,7 +587,7 @@ linux_do_tkill(struct thread *td, l_int 
ksi.ksi_pid = proc->p_pid;
ksi.ksi_uid = proc->p_ucred->cr_ruid;
 
-   error = tdsignal(p, NULL, ksi.ksi_signo, &ksi);
+   error = pksignal(p, ksi.ksi_signo, &ksi);
 
 out:
PROC_UNLOCK(p);

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Tue Jun 29 19:07:44 2010(r209591)
+++ head/sys/kern/kern_exec.c   Tue Jun 29 20:41:52 2010(r209592)
@@ -755,13 +755,13 @@ interpret:
/*
 * If tracing the process, trap to debugger so breakpoints
 * can be set before the program executes.
-* Use tdsignal to deliver signal to current thread, use
+* Use tdsignal to deliver signal to current thread, using
 * psignal may cause the signal to be delivered to wrong thread
 * because that thread will exit, remember we are going to enter
 * single thread mode.
 */
if (p->p_flag & P_TRACED)
-   tdsignal(p, td, SIGTRAP, NULL);
+   tdsignal(td, SIGTRAP);
 
/* clear "fork but no exec" flag, as we _are_ execing */
p->p_acflag &= ~AFORK;

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Tue Jun 29 19:07:44 2010(r209591)
+++ head/sys/kern/kern_exit.c   Tue Jun 29 20:41:52 2010(r209592)
@@ -732,7 +732,7 @@ proc_reap(struct thread *td, struct proc
p->p_oppid = 0;
proc_reparent(p, t);
PROC_UNLOCK(p);
-   tdsignal(t, NULL, SIGCHLD, p->p_ksi);
+   pksignal(t, SIGCHLD, p->p_ksi);
wakeup(t);
cv_broadcast(&p->p_pwait);
PROC_UNLOCK(t);

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cTue Jun 29 19:07:44 2010(r209591)
+++ head/sys/kern/kern_sig.cTue Jun 29 20:41:52 2010(r209592)
@@ -107,6 +107,8 @@ static int  killpg1(struct thread *td, in
ksiginfo_t *ksi);
 static int issignal(struct thread *td, int stop_allowed);
 static int sigprop(int sig);
+static int tdsendsignal(struct proc *p, struct thread *td, int sig,
+   ksiginfo_t *ksi);
 static voidtdsigwakeup(struct thread *, int, sig_t, int);
 static voidsig_suspend_threads(struct thread *, struct proc *, int);
 static int filt_sigattach(struct knote *kn);
@@ -1797,7 +1799,7 @@ sigqueue(struct thread *td, struct sigqu
ksi.ksi_pid = td->td_proc->p_pid;
ksi.ksi_uid = td->td_ucred->cr_ruid;
ksi.ksi_value.sival_ptr = uap->value;
-   error = tdsignal(p, NULL, ksi.ksi_signo, &ksi);
+   error = pksignal(p, ksi.ksi_signo, &ksi);
}
PROC_UNLOCK(p);
return (error);
@@ -1907,7 +1909,7 @@ trapsignal(struct thread *td, ksiginfo_t
mtx_unlock(&ps->ps_mtx);
p->p_code = code;   /* XXX for core dump/debugger */
p->p_sig = sig; /* XXX to verify code */
-   tdsignal(p, td, sig, ksi);
+   tdsendsignal(p, td, sig, ksi);
}
PROC_UNLOCK(p);
 }
@@ -1962,14 +1964,14 @@ psignal(struct proc *p, int sig)
ksiginfo_init(&ksi);
ksi.ksi_signo = sig;
ksi.ksi_code = SI_KERNEL;
-   (void) tdsigna

svn commit: r209595 - head/sys/kern

2010-06-29 Thread John Baldwin
Author: jhb
Date: Tue Jun 29 20:44:19 2010
New Revision: 209595
URL: http://svn.freebsd.org/changeset/base/209595

Log:
  Send SIGPIPE to the thread that issued the offending system call
  rather than to the entire process.
  
  Reported by:  Anit Chakraborty
  Reviewed by:  kib, deischen (concept)
  MFC after:1 week

Modified:
  head/sys/kern/sys_generic.c
  head/sys/kern/sys_socket.c
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/sys_generic.c
==
--- head/sys/kern/sys_generic.c Tue Jun 29 20:43:39 2010(r209594)
+++ head/sys/kern/sys_generic.c Tue Jun 29 20:44:19 2010(r209595)
@@ -532,7 +532,7 @@ dofilewrite(td, fd, fp, auio, offset, fl
/* Socket layer is responsible for issuing SIGPIPE. */
if (fp->f_type != DTYPE_SOCKET && error == EPIPE) {
PROC_LOCK(td->td_proc);
-   psignal(td->td_proc, SIGPIPE);
+   tdsignal(td, SIGPIPE);
PROC_UNLOCK(td->td_proc);
}
}

Modified: head/sys/kern/sys_socket.c
==
--- head/sys/kern/sys_socket.c  Tue Jun 29 20:43:39 2010(r209594)
+++ head/sys/kern/sys_socket.c  Tue Jun 29 20:44:19 2010(r209595)
@@ -102,7 +102,7 @@ soo_write(struct file *fp, struct uio *u
error = sosend(so, 0, uio, 0, 0, 0, uio->uio_td);
if (error == EPIPE && (so->so_options & SO_NOSIGPIPE) == 0) {
PROC_LOCK(uio->uio_td->td_proc);
-   psignal(uio->uio_td->td_proc, SIGPIPE);
+   tdsignal(uio->uio_td, SIGPIPE);
PROC_UNLOCK(uio->uio_td->td_proc);
}
return (error);

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Tue Jun 29 20:43:39 2010
(r209594)
+++ head/sys/kern/uipc_syscalls.c   Tue Jun 29 20:44:19 2010
(r209595)
@@ -794,7 +794,7 @@ kern_sendit(td, s, mp, flags, control, s
if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) &&
!(flags & MSG_NOSIGNAL)) {
PROC_LOCK(td->td_proc);
-   psignal(td->td_proc, SIGPIPE);
+   tdsignal(td, SIGPIPE);
PROC_UNLOCK(td->td_proc);
}
}
@@ -2444,7 +2444,7 @@ sctp_generic_sendmsg (td, uap)
if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) &&
!(uap->flags & MSG_NOSIGNAL)) {
PROC_LOCK(td->td_proc);
-   psignal(td->td_proc, SIGPIPE);
+   tdsignal(td, SIGPIPE);
PROC_UNLOCK(td->td_proc);
}
}
@@ -2562,7 +2562,7 @@ sctp_generic_sendmsg_iov(td, uap)
if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) &&
!(uap->flags & MSG_NOSIGNAL)) {
PROC_LOCK(td->td_proc);
-   psignal(td->td_proc, SIGPIPE);
+   tdsignal(td, SIGPIPE);
PROC_UNLOCK(td->td_proc);
}
}
___
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: r209596 - head/sys/sys

2010-06-29 Thread John Baldwin
Author: jhb
Date: Tue Jun 29 20:55:12 2010
New Revision: 209596
URL: http://svn.freebsd.org/changeset/base/209596

Log:
  Sort function prototypes (since I didn't manage to insert tdksignal()
  correctly).

Modified:
  head/sys/sys/signalvar.h

Modified: head/sys/sys/signalvar.h
==
--- head/sys/sys/signalvar.hTue Jun 29 20:44:19 2010(r209595)
+++ head/sys/sys/signalvar.hTue Jun 29 20:55:12 2010(r209596)
@@ -330,12 +330,15 @@ int   cursig(struct thread *td, int stop_a
 void   execsigs(struct proc *p);
 void   gsignal(int pgid, int sig, ksiginfo_t *ksi);
 void   killproc(struct proc *p, char *why);
+ksiginfo_t * ksiginfo_alloc(int);
+void   ksiginfo_free(ksiginfo_t *);
 intpksignal(struct proc *p, int sig, ksiginfo_t *ksi);
 void   pgsigio(struct sigio **, int signum, int checkctty);
 void   pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi);
 intpostsig(int sig);
 void   psignal(struct proc *p, int sig);
 intpsignal_event(struct proc *p, struct sigevent *, ksiginfo_t *);
+intptracestop(struct thread *td, int sig);
 struct sigacts *sigacts_alloc(void);
 void   sigacts_copy(struct sigacts *dest, struct sigacts *src);
 void   sigacts_free(struct sigacts *ps);
@@ -345,18 +348,15 @@ void  sigexit(struct thread *td, int sign
 intsig_ffs(sigset_t *set);
 void   siginit(struct proc *p);
 void   signotify(struct thread *td);
+void   sigqueue_delete(struct sigqueue *queue, int sig);
+void   sigqueue_delete_proc(struct proc *p, int sig);
+void   sigqueue_flush(struct sigqueue *queue);
+void   sigqueue_init(struct sigqueue *queue, struct proc *p);
+void   sigqueue_take(ksiginfo_t *ksi);
+void   tdksignal(struct thread *td, int sig, ksiginfo_t *ksi);
 void   tdsigcleanup(struct thread *td);
 void   tdsignal(struct thread *td, int sig);
-void   tdksignal(struct thread *td, int sig, ksiginfo_t *ksi);
 void   trapsignal(struct thread *td, ksiginfo_t *);
-intptracestop(struct thread *td, int sig);
-ksiginfo_t * ksiginfo_alloc(int);
-void   ksiginfo_free(ksiginfo_t *);
-void   sigqueue_init(struct sigqueue *queue, struct proc *p);
-void   sigqueue_flush(struct sigqueue *queue);
-void   sigqueue_delete_proc(struct proc *p, int sig);
-void   sigqueue_delete(struct sigqueue *queue, int sig);
-void   sigqueue_take(ksiginfo_t *ksi);
 intkern_sigtimedwait(struct thread *, sigset_t,
ksiginfo_t *, struct timespec *);
 intkern_sigprocmask(struct thread *td, int how,
___
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: r209595 - head/sys/kern

2010-06-29 Thread Ed Schouten
* John Baldwin  wrote:
> Log:
>   Send SIGPIPE to the thread that issued the offending system call
>   rather than to the entire process.

Should something similar be used inside the TTY layer, where
reads/writes may cause signals to be generated?

Greetings,
-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgp9VkQNkgOOg.pgp
Description: PGP signature


svn commit: r209597 - head/sys/dev/bwi

2010-06-29 Thread Weongyo Jeong
Author: weongyo
Date: Tue Jun 29 21:52:40 2010
New Revision: 209597
URL: http://svn.freebsd.org/changeset/base/209597

Log:
  Fixes NULL pointer reference that it's occurred when the state is
  changed to RUN because ic->ic_newassoc isn't set anywhere now.  In the
  previous bwi_newassoc() is used to initialize AMRR rate routines.
  
  Tested by:Warren Block 
  MFC after:3 days

Modified:
  head/sys/dev/bwi/if_bwi.c

Modified: head/sys/dev/bwi/if_bwi.c
==
--- head/sys/dev/bwi/if_bwi.c   Tue Jun 29 20:55:12 2010(r209596)
+++ head/sys/dev/bwi/if_bwi.c   Tue Jun 29 21:52:40 2010(r209597)
@@ -1774,7 +1774,6 @@ bwi_newstate(struct ieee80211vap *vap, e
enum ieee80211_state ostate = vap->iv_state;
struct bwi_softc *sc = ifp->if_softc;
struct bwi_mac *mac;
-   struct ieee80211_node *ni = vap->iv_bss;
int error;
 
BWI_LOCK(sc);
@@ -1822,10 +1821,6 @@ bwi_newstate(struct ieee80211vap *vap, e
 #else
sc->sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
-   if (vap->iv_opmode == IEEE80211_M_STA) {
-   /* fake a join to init the tx rate */
-   ic->ic_newassoc(ni, 1);
-   }
 
callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc);
}
___
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: r209598 - head/sys/dev/bwi

2010-06-29 Thread Weongyo Jeong
Author: weongyo
Date: Tue Jun 29 21:56:42 2010
New Revision: 209598
URL: http://svn.freebsd.org/changeset/base/209598

Log:
  Initializes the ratectl for a node when the state is changed to RUN.
  This prevents a kernel fault by dividing with zero because the initial
  rate was 0 and didn't be initialized.
  
  Tested by:Warren Block 
  MFC after:3 days

Modified:
  head/sys/dev/bwi/if_bwi.c

Modified: head/sys/dev/bwi/if_bwi.c
==
--- head/sys/dev/bwi/if_bwi.c   Tue Jun 29 21:52:40 2010(r209597)
+++ head/sys/dev/bwi/if_bwi.c   Tue Jun 29 21:56:42 2010(r209598)
@@ -1769,6 +1769,7 @@ static int
 bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
struct bwi_vap *bvp = BWI_VAP(vap);
+   const struct ieee80211_txparam *tp;
struct ieee80211com *ic= vap->iv_ic;
struct ifnet *ifp = ic->ic_ifp;
enum ieee80211_state ostate = vap->iv_state;
@@ -1822,6 +1823,11 @@ bwi_newstate(struct ieee80211vap *vap, e
sc->sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
 
+   /* Initializes ratectl for a node. */
+   tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
+   if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
+   ieee80211_ratectl_node_init(vap->iv_bss);
+
callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc);
}
 back:
___
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: r209595 - head/sys/kern

2010-06-29 Thread Jilles Tjoelker
On Tue, Jun 29, 2010 at 11:05:22PM +0200, Ed Schouten wrote:
> * John Baldwin  wrote:
> > Log:
> >   Send SIGPIPE to the thread that issued the offending system call
> >   rather than to the entire process.

> Should something similar be used inside the TTY layer, where
> reads/writes may cause signals to be generated?

SIGTTIN and SIGTTOU from read/write/ioctl are sent to the entire process
group and are therefore not sent to a specific thread.

-- 
Jilles Tjoelker
___
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: r209599 - head/sys/dev/mpt

2010-06-29 Thread Kenneth D. Merry
Author: ken
Date: Tue Jun 29 22:07:53 2010
New Revision: 209599
URL: http://svn.freebsd.org/changeset/base/209599

Log:
  Change the mpt driver to allow larger I/O sizes.
  
  The mpt driver previously didn't report a 'maxio' size to CAM, and so the
  da(4) driver limited I/O sizes to DFLTPHYS (64K) by default.  The number
  of scatter gather segments allowed, as reported to busdma, was
  (128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages.
  
  Change things around so that we wait until we've determined how many
  segments the adapter can support before creating the busdma tag used for
  buffers, so we can potentially support more S/G segments and therefore
  larger I/O sizes.
  
  Also, fix some things that were broken about the module unload path.  It
  still gets hung up inside CAM, though.
  
  mpt.c:Move some busdma initialization calls in here, and call
them just after we've gotten the IOCFacts, and know how
many S/G segments this adapter can support.
  
  mpt.h:Get rid of MPT_MAXPHYS, it is no longer used.
  
Add max_cam_seg_cnt, which is used to report our maximum
I/O size up to CAM.
  
  mpt_cam.c:Use max_cam_seg_cnt to report our maximum I/O size to CAM.
  
Fix the locking in mpt_cam_detach().
  
  mpt_pci.c:Pull some busdma initialization and teardown out and put
it in mpt.c.  We now delay it until we know many scatter
gather segments the adapter can support, and therefore
how to setup our busdma tags.
  
  mpt_raid.c:   Make sure we wake up the right wait channel to get the
raid thread to wake up when we're trying to shut it down.
  
  Reviewed by:  gibbs, mjacob
  MFC after:2 weeks

Modified:
  head/sys/dev/mpt/mpt.c
  head/sys/dev/mpt/mpt.h
  head/sys/dev/mpt/mpt_cam.c
  head/sys/dev/mpt/mpt_pci.c
  head/sys/dev/mpt/mpt_raid.c

Modified: head/sys/dev/mpt/mpt.c
==
--- head/sys/dev/mpt/mpt.c  Tue Jun 29 21:56:42 2010(r209598)
+++ head/sys/dev/mpt/mpt.c  Tue Jun 29 22:07:53 2010(r209599)
@@ -128,6 +128,7 @@ static void mpt_send_event_ack(struct mp
 static int mpt_send_event_request(struct mpt_softc *mpt, int onoff);
 static int mpt_soft_reset(struct mpt_softc *mpt);
 static void mpt_hard_reset(struct mpt_softc *mpt);
+static void mpt_dma_buf_free(struct mpt_softc *mpt);
 static int mpt_configure_ioc(struct mpt_softc *mpt, int, int);
 static int mpt_enable_ioc(struct mpt_softc *mpt, int);
 
@@ -2246,14 +2247,6 @@ mpt_core_attach(struct mpt_softc *mpt)
TAILQ_INIT(&mpt->request_pending_list);
TAILQ_INIT(&mpt->request_free_list);
TAILQ_INIT(&mpt->request_timeout_list);
-   MPT_LOCK(mpt);
-   for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) {
-   request_t *req = &mpt->request_pool[val];
-   req->state = REQ_STATE_ALLOCATED;
-   mpt_callout_init(mpt, &req->callout);
-   mpt_free_request(mpt, req);
-   }
-   MPT_UNLOCK(mpt);
for (val = 0; val < MPT_MAX_LUNS; val++) {
STAILQ_INIT(&mpt->trt[val].atios);
STAILQ_INIT(&mpt->trt[val].inots);
@@ -2346,6 +2339,8 @@ mpt_core_detach(struct mpt_softc *mpt)
request_t *req = &mpt->request_pool[val];
mpt_callout_drain(mpt, &req->callout);
}
+
+   mpt_dma_buf_free(mpt);
 }
 
 int
@@ -2480,6 +2475,104 @@ mpt_download_fw(struct mpt_softc *mpt)
return (0);
 }
 
+int
+mpt_dma_buf_alloc(struct mpt_softc *mpt)
+{
+   struct mpt_map_info mi;
+   uint8_t *vptr;
+   uint32_t pptr, end;
+   int i, error;
+
+   /* Create a child tag for data buffers */
+   if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1,
+   0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
+   NULL, NULL, MAXBSIZE, mpt->max_cam_seg_cnt,
+   BUS_SPACE_MAXSIZE_32BIT, 0, &mpt->buffer_dmat) != 0) {
+   mpt_prt(mpt, "cannot create a dma tag for data buffers\n");
+   return (1);
+   }
+
+   /* Create a child tag for request buffers */
+   if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0,
+   BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
+   NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0,
+   &mpt->request_dmat) != 0) {
+   mpt_prt(mpt, "cannot create a dma tag for requests\n");
+   return (1);
+   }
+
+   /* Allocate some DMA accessable memory for requests */
+   if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request,
+   BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) {
+   mpt_prt(mpt, "cannot allocate %d bytes of request memory\n",
+   MPT_REQ_MEM_SIZE(mpt));
+   return (1);
+   }
+
+   mi.mpt = mpt;
+   mi.error = 0;
+
+  

svn commit: r209600 - head/bin/sh

2010-06-29 Thread Jilles Tjoelker
Author: jilles
Date: Tue Jun 29 22:37:45 2010
New Revision: 209600
URL: http://svn.freebsd.org/changeset/base/209600

Log:
  sh: Forget about terminated background processes sooner.
  
  Unless $! has been referenced for a particular job or $! still contains that
  job's pid, forget about it after it has terminated. If $! has been
  referenced, remember the job until the wait builtin has reported its
  completion (either with the pid as parameter or without parameters).
  
  In interactive mode, jobs are forgotten after termination has been reported,
  which happens before primary prompts and through the jobs builtin. Even
  then, though, remember a job if $! has been referenced.
  
  This is similar to what is suggested by POSIX and should fix most memory
  leaks (which also tend to cause sh to use more CPU time) with long running
  scripts that start background jobs.
  
  Caveats:
  * Repeatedly referencing $! without ever doing 'wait', like
  while :; do foo & echo started foo: $!; sleep 60; done
will still use a lot of memory and CPU time in the long run.
  * The jobs and jobid builtins do not cause a job to be remembered for longer
like expanding $! does.
  
  PR:   bin/55346

Modified:
  head/bin/sh/expand.c
  head/bin/sh/jobs.c
  head/bin/sh/jobs.h
  head/bin/sh/sh.1

Modified: head/bin/sh/expand.c
==
--- head/bin/sh/expand.cTue Jun 29 22:07:53 2010(r209599)
+++ head/bin/sh/expand.cTue Jun 29 22:37:45 2010(r209600)
@@ -818,7 +818,7 @@ varisset(char *name, int nulok)
 {
 
if (*name == '!')
-   return backgndpid != -1;
+   return backgndpidset();
else if (*name == '@' || *name == '*') {
if (*shellparam.p == NULL)
return 0;
@@ -891,7 +891,7 @@ varvalue(char *name, int quoted, int sub
num = shellparam.nparam;
goto numvar;
case '!':
-   num = backgndpid;
+   num = backgndpidval();
 numvar:
expdest = cvtnum(num, expdest);
break;

Modified: head/bin/sh/jobs.c
==
--- head/bin/sh/jobs.c  Tue Jun 29 22:07:53 2010(r209599)
+++ head/bin/sh/jobs.c  Tue Jun 29 22:37:45 2010(r209600)
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
 STATIC struct job *jobtab; /* array of jobs */
 STATIC int njobs;  /* size of array */
 MKINIT pid_t backgndpid = -1;  /* pid of last background process */
+MKINIT struct job *bgjob = NULL; /* last background process */
 #if JOBS
 STATIC struct job *jobmru; /* most recently used job list */
 STATIC pid_t initialpgrp;  /* pgrp of shell on invocation */
@@ -183,6 +184,7 @@ INCLUDE 
 
 SHELLPROC {
backgndpid = -1;
+   bgjob = NULL;
 #if JOBS
jobctl = 0;
 #endif
@@ -413,7 +415,11 @@ showjobs(int change, int mode)
continue;
showjob(jp, 0, mode);
jp->changed = 0;
-   if (jp->state == JOBDONE) {
+   /* Hack: discard jobs for which $! has not been referenced
+* in interactive mode when they terminate.
+*/
+   if (jp->state == JOBDONE && !jp->remembered &&
+   (iflag || jp != bgjob)) {
freejob(jp);
}
}
@@ -431,6 +437,8 @@ freejob(struct job *jp)
int i;
 
INTOFF;
+   if (bgjob == jp)
+   bgjob = NULL;
for (i = jp->nprocs, ps = jp->ps ; --i >= 0 ; ps++) {
if (ps->cmd != nullstr)
ckfree(ps->cmd);
@@ -477,12 +485,27 @@ waitcmd(int argc, char **argv)
 #endif
else
retval = WTERMSIG(status) + 128;
-   if (! iflag)
+   if (! iflag || ! job->changed)
freejob(job);
+   else {
+   job->remembered = 0;
+   if (job == bgjob)
+   bgjob = NULL;
+   }
in_waitcmd--;
return retval;
}
} else {
+   for (jp = jobtab ; jp < jobtab + njobs; jp++)
+   if (jp->used && jp->state == JOBDONE) {
+   if (! iflag || ! jp->changed)
+   freejob(jp);
+   else {
+   jp->remembered = 0;
+   if (jp == bgjob)
+ 

svn commit: r209602 - head/sys/dev/ixgbe

2010-06-29 Thread Jack F Vogel
Author: jfv
Date: Wed Jun 30 01:01:06 2010
New Revision: 209602
URL: http://svn.freebsd.org/changeset/base/209602

Log:
  Add a new sysctl option, this will allow one to
  limit the advertised speed of an SFP+ to 1G, effectively
  "forcing" link at that lower speed. It is off by default
  and is enabled by sysctl dev.ix.0.force_gig=1, 0 will
  set it back to the norm.

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Tue Jun 29 23:08:33 2010(r209601)
+++ head/sys/dev/ixgbe/ixgbe.c  Wed Jun 30 01:01:06 2010(r209602)
@@ -239,6 +239,15 @@ static int ixgbe_flow_control = ixgbe_fc
 TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control);
 
 /*
+** These adapters do not really autoneg, but slower
+** speed can be set by forcing the advertised value
+** to only 1G. Default to 0, set it to 1 to
+** force 1G link.
+*/
+static int ixgbe_force_speed = 0;
+TUNABLE_INT("hw.ixgbe.force_speed", &ixgbe_force_speed);
+
+/*
 ** Smart speed setting, default to on
 ** this only works as a compile option
 ** right now as its during attach, set
@@ -464,6 +473,11 @@ ixgbe_attach(device_t dev)
OID_AUTO, "flow_control", CTLTYPE_INT | CTLFLAG_RW,
adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control");
 
+   SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+   OID_AUTO, "force_gig", CTLTYPE_INT | CTLFLAG_RW,
+   adapter, 0, ixgbe_set_gigspeed, "I", "Force 1G Speed");
+
 SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW,
@@ -4942,6 +4956,34 @@ ixgbe_sysctl_debug(SYSCTL_HANDLER_ARGS)
 }
 
 /*
+** Set link advertisement to 1G:
+** 0 - off
+** 1 - off
+*/
+static int
+ixgbe_set_gigspeed(SYSCTL_HANDLER_ARGS)
+{
+   struct adapter *adapter;
+   struct ixgbe_hw *hw;
+   int error;
+
+   error = sysctl_handle_int(oidp, &ixgbe_force_speed, 0, req);
+
+   if (error)
+   return (error);
+
+   adapter = (struct adapter *) arg1;
+   hw = &adapter->hw;
+   if (ixgbe_force_speed)
+hw->phy.autoneg_advertised = IXGBE_LINK_SPEED_1GB_FULL;
+   else
+hw->phy.autoneg_advertised = IXGBE_LINK_SPEED_10GB_FULL;
+   
+   return error;
+}
+
+
+/*
 ** Set flow control using sysctl:
 ** Flow control values:
 ** 0 - off
___
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: r209603 - head/sys/dev/ixgbe

2010-06-29 Thread Jack F Vogel
Author: jfv
Date: Wed Jun 30 01:10:08 2010
New Revision: 209603
URL: http://svn.freebsd.org/changeset/base/209603

Log:
  BAH, I apologize, the wrong version of the code got
  fat fingered in place, this is the correct version
  that actually works... 
  
  MFC: in a week

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Wed Jun 30 01:01:06 2010(r209602)
+++ head/sys/dev/ixgbe/ixgbe.c  Wed Jun 30 01:10:08 2010(r209603)
@@ -46,7 +46,7 @@ int ixgbe_display_debug_stat
 /*
  *  Driver version
  */
-char ixgbe_driver_version[] = "2.2.1";
+char ixgbe_driver_version[] = "2.2.3";
 
 /*
  *  PCI Device ID Table
@@ -154,6 +154,7 @@ static int  ixgbe_xmit(struct tx_rin
 static int  ixgbe_sysctl_stats(SYSCTL_HANDLER_ARGS);
 static int ixgbe_sysctl_debug(SYSCTL_HANDLER_ARGS);
 static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS);
+static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS);
 static int ixgbe_dma_malloc(struct adapter *, bus_size_t,
struct ixgbe_dma_alloc *, int);
 static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *);
@@ -239,15 +240,6 @@ static int ixgbe_flow_control = ixgbe_fc
 TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control);
 
 /*
-** These adapters do not really autoneg, but slower
-** speed can be set by forcing the advertised value
-** to only 1G. Default to 0, set it to 1 to
-** force 1G link.
-*/
-static int ixgbe_force_speed = 0;
-TUNABLE_INT("hw.ixgbe.force_speed", &ixgbe_force_speed);
-
-/*
 ** Smart speed setting, default to on
 ** this only works as a compile option
 ** right now as its during attach, set
@@ -475,8 +467,8 @@ ixgbe_attach(device_t dev)
 
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-   OID_AUTO, "force_gig", CTLTYPE_INT | CTLFLAG_RW,
-   adapter, 0, ixgbe_set_gigspeed, "I", "Force 1G Speed");
+   OID_AUTO, "advertise_gig", CTLTYPE_INT | CTLFLAG_RW,
+   adapter, 0, ixgbe_set_advertise, "I", "1G Link");
 
 SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -4956,34 +4948,6 @@ ixgbe_sysctl_debug(SYSCTL_HANDLER_ARGS)
 }
 
 /*
-** Set link advertisement to 1G:
-** 0 - off
-** 1 - off
-*/
-static int
-ixgbe_set_gigspeed(SYSCTL_HANDLER_ARGS)
-{
-   struct adapter *adapter;
-   struct ixgbe_hw *hw;
-   int error;
-
-   error = sysctl_handle_int(oidp, &ixgbe_force_speed, 0, req);
-
-   if (error)
-   return (error);
-
-   adapter = (struct adapter *) arg1;
-   hw = &adapter->hw;
-   if (ixgbe_force_speed)
-hw->phy.autoneg_advertised = IXGBE_LINK_SPEED_1GB_FULL;
-   else
-hw->phy.autoneg_advertised = IXGBE_LINK_SPEED_10GB_FULL;
-   
-   return error;
-}
-
-
-/*
 ** Set flow control using sysctl:
 ** Flow control values:
 ** 0 - off
@@ -5027,3 +4991,44 @@ ixgbe_add_rx_process_limit(struct adapte
 SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)),
 OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description);
 }
+
+/*
+** Control link advertise speed:
+** 0 - normal
+** 1 - advertise only 1G
+*/
+static int
+ixgbe_set_advertise(SYSCTL_HANDLER_ARGS)
+{
+   int error;
+   struct adapter  *adapter;
+   struct ixgbe_hw *hw;
+   ixgbe_link_speedspeed, last;
+
+   adapter = (struct adapter *) arg1;
+   hw = &adapter->hw;
+   last = hw->phy.autoneg_advertised;
+
+   error = sysctl_handle_int(oidp, &adapter->advertise, 0, req);
+
+   if ((error) || (adapter->advertise == -1))
+   return (error);
+
+   if (!((hw->phy.media_type == ixgbe_media_type_copper) ||
+(hw->phy.multispeed_fiber)))
+   return (error);
+
+   if (adapter->advertise == 1)
+speed = IXGBE_LINK_SPEED_1GB_FULL;
+   else
+speed = IXGBE_LINK_SPEED_1GB_FULL |
+   IXGBE_LINK_SPEED_10GB_FULL;
+
+   if (speed == last) /* no change */
+   return (error);
+
+   hw->mac.autotry_restart = TRUE;
+   hw->mac.ops.setup_link(hw, speed, TRUE, TRUE);
+
+   return (error);
+}
___
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: r209604 - head/lib/libc/gmon

2010-06-29 Thread Marcel Moolenaar
Author: marcel
Date: Wed Jun 30 01:40:25 2010
New Revision: 209604
URL: http://svn.freebsd.org/changeset/base/209604

Log:
  On powerpc, calculate s_scale using the non-FP version previously
  specific to hp300. Since FreeBSD does not support hp300, hp300 has
  been removed from the condition altogether.
  
  The FP version broke profiling on powerpc due to invalid results.
  Casting to double instead of float resolved the issue, but with
  Book-E not having a FP unit, the non-FP version looked preferrable.
  Note that even on AIM hardware the FP version yielded an invalid
  value for s_scale, so the problem is most likely with the compiler
  or with the expression itself.

Modified:
  head/lib/libc/gmon/gmon.c

Modified: head/lib/libc/gmon/gmon.c
==
--- head/lib/libc/gmon/gmon.c   Wed Jun 30 01:10:08 2010(r209603)
+++ head/lib/libc/gmon/gmon.c   Wed Jun 30 01:40:25 2010(r209604)
@@ -111,7 +111,7 @@ monstartup(lowpc, highpc)
 
o = p->highpc - p->lowpc;
if (p->kcountsize < o) {
-#ifndef hp300
+#if !defined(__powerpc__)
s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
 #else /* avoid floating point */
int quot = o / p->kcountsize;
___
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: r209605 - head/sys/kern

2010-06-29 Thread Alan Cox
Author: alc
Date: Wed Jun 30 04:52:42 2010
New Revision: 209605
URL: http://svn.freebsd.org/changeset/base/209605

Log:
  Improve bufdone_finish()'s handling of the bogus page.  Specifically, if
  one or more mappings to the bogus page must be replaced, call pmap_qenter()
  just once.  Previously, pmap_qenter() was called for each mapping to the
  bogus page.
  
  MFC after:3 weeks

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Jun 30 01:40:25 2010(r209604)
+++ head/sys/kern/vfs_bio.c Wed Jun 30 04:52:42 2010(r209605)
@@ -3336,7 +3336,7 @@ bufdone_finish(struct buf *bp)
vm_ooffset_t foff;
vm_page_t m;
vm_object_t obj;
-   int iosize;
+   int bogus, iosize;
struct vnode *vp = bp->b_vp;
 
obj = bp->b_bufobj->bo_object;
@@ -3374,6 +3374,7 @@ bufdone_finish(struct buf *bp)
!(bp->b_ioflags & BIO_ERROR)) {
bp->b_flags |= B_CACHE;
}
+   bogus = 0;
for (i = 0; i < bp->b_npages; i++) {
int bogusflag = 0;
int resid;
@@ -3387,13 +3388,11 @@ bufdone_finish(struct buf *bp)
 */
m = bp->b_pages[i];
if (m == bogus_page) {
-   bogusflag = 1;
+   bogus = bogusflag = 1;
m = vm_page_lookup(obj, OFF_TO_IDX(foff));
if (m == NULL)
panic("biodone: page disappeared!");
bp->b_pages[i] = m;
-   pmap_qenter(trunc_page((vm_offset_t)bp->b_data),
-   bp->b_pages, bp->b_npages);
}
 #if defined(VFS_BIO_DEBUG)
if (OFF_TO_IDX(foff) != m->pindex) {
@@ -3447,6 +3446,9 @@ bufdone_finish(struct buf *bp)
}
vm_object_pip_wakeupn(obj, 0);
VM_OBJECT_UNLOCK(obj);
+   if (bogus)
+   pmap_qenter(trunc_page((vm_offset_t)bp->b_data),
+   bp->b_pages, bp->b_npages);
}
 
/*
___
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"