Re: CVS commit: src/lib/libc/time

2009-12-14 Thread Joerg Sonnenberger
On Mon, Dec 14, 2009 at 06:15:21AM +, David Holland wrote:
 On Mon, Dec 14, 2009 at 05:51:57AM +, Matt Thomas wrote:
   Suppress a warning if time_t is __int64_t
 
 -   } while ((sse * 10 = TIME_MAX) 
 +   } while (((uint64_t)(sse * 10) = TIME_MAX) 
 
 Don't you want ((uint64_t)sse * 10 = TIME_MAX), that is, cast before
 multiplying?

The best approach is to not multiply at all, but divide the constant...

Joerg


Re: CVS commit: src/sys/arch/mips/mips

2009-12-14 Thread Matt Thomas

On Dec 14, 2009, at 8:13 AM, Masao Uebayashi wrote:

 Log Message:
 We don't declare variables in for () statement.
 
 The kernel is a C99 environment which makes that legal.  Limiting the scope
 of variables is always a good thing.
 
 I agree that it's a good thing.  Its build failed in modules.

Then modules were broken.  You fixed the wrong thing.

Are modules being build with -std=gnu99?  If not, that's the problem.

Re: CVS commit: src/sys/arch/mips/mips

2009-12-14 Thread Masao Uebayashi
This solves.  I'm not sure how to deal with other warning options.

Masao

Index: sys/modules/Makefile.inc
===
RCS file: /cvsroot/src/sys/modules/Makefile.inc,v
retrieving revision 1.1
diff -u -r1.1 Makefile.inc
--- sys/modules/Makefile.inc16 Jan 2008 12:34:56 -  1.1
+++ sys/modules/Makefile.inc14 Dec 2009 18:42:52 -
@@ -2,6 +2,7 @@
 
 S!=cd ${.CURDIR}/../..;pwd
 CPPFLAGS+= -I${NETBSDSRCDIR}/common/include
+COPTS+=-std=gnu99
 USE_FORT=  no
 WARNS?=1
 
-- 
Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635


Re: CVS commit: src/sys/arch/mips/mips

2009-12-14 Thread Matt Thomas

On Dec 14, 2009, at 10:44 AM, Masao Uebayashi wrote:

 This solves.  I'm not sure how to deal with other warning options.
 
 Masao

I suppose you should sync that with conf/Makefile.kern.inc

And now you can back out those changes to mips/compat*.c


Re: CVS commit: src/sys/arch/i386/stand/pxeboot

2009-12-14 Thread David Laight
On Sun, Dec 13, 2009 at 11:01:42PM +, Jonathan A. Kollasch wrote:
 Module Name:  src
 Committed By: jakllsch
 Date: Sun Dec 13 23:01:42 UTC 2009
 
 Modified Files:
   src/sys/arch/i386/stand/pxeboot: dev_net.c main.c pxe.c pxe_netif.h
 
 Log Message:
 Shut down the PXE network stack when we are done with it.

I seem to remember some issues where certain bios locked up if/when
that was called. Which is why it was commented out.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/sys/kern

2009-12-14 Thread David Laight
On Mon, Dec 14, 2009 at 06:21:55AM +, David Holland wrote:
 On Sun, Dec 13, 2009 at 08:02:24PM +, David Laight wrote:
   Log Message:
   Another, better, fix for PR/26567.
   Only sleep once within each pipe_read/pipe_write call.
   If there is no data/space available after we wakeup return ERESTART so
   then the 'fd' number is validated again.
   A simple broadcast of the cvs is then enough to evict the correct threads
   when close() is called from an active thread.
 
 Isn't this going to cause a thundering herd problem if there are a lot
 of readers competing for the input? The first one will wake up and
 consume the available data, and then the rest will take a trip all the
 way to userspace and back.
 
 This may or may not be a practical problem for pipes but I'd expect
 the same approach to suck pretty hard for e.g. accept() on sockets. :(

Sockets have other problems - like not always having a syscall interface
for ERESTART to loop on.

I was actually thinking of making the fo_abort() call set a flag on
the socket and only do the ERESTART if that flag is set.
Then you only take the hit on 'file's associated with 'fd' that get
closed with a read/write in progress.

I also need to rename fo_abort() to fo_restart().

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src

2009-12-14 Thread Matt Thomas

On Dec 14, 2009, at 4:43 AM, Masao Uebayashi wrote:

 Module Name:  src
 Committed By: uebayasi
 Date: Mon Dec 14 12:43:48 UTC 2009
 
 Modified Files:
   src/games: Makefile
   src/gnu/lib: Makefile
   src/regress/usr.bin: Makefile
   src/regress/usr.bin/rtld: Makefile
 
 Log Message:
 Conditionalize some build directories by ${MKCXX}.

Please your commits!  This broke the games build.  If you can't test, you 
shouldn't be committing!

re: CVS commit: src

2009-12-14 Thread matthew green

.mrg.

   
   On Dec 14, 2009, at 4:43 AM, Masao Uebayashi wrote:
   
Module Name:   src
Committed By:  uebayasi
Date:  Mon Dec 14 12:43:48 UTC 2009

Modified Files:
   src/games: Makefile
   src/gnu/lib: Makefile
   src/regress/usr.bin: Makefile
   src/regress/usr.bin/rtld: Makefile

Log Message:
Conditionalize some build directories by ${MKCXX}.
   
   Please your commits!  This broke the games build.  If you can't test, you 
shouldn't be committing!
   


Re: CVS commit: src/sys/arch/vax/vax

2009-12-14 Thread Mindaugas Rasiukevicius
Hello,

 Module Name:src
 Committed By:   martin
 Date:   Sat Dec 12 12:23:29 UTC 2009
 
 Modified Files:
 src/sys/arch/vax/vax: vm_machdep.c
 
 Log Message:
 Clear new pcb in cpu_lwp_fork, now that this seems to no longer be
 guaranteed to be zeroed memory after the uarea swap changes.

 XXX shouldn't we zero the new uarea upfront in MI code before calling
 uvm_lwp_fork?

No, MD part manages the contents of uarea.  Also, why do you need to clear
it (as opposed to correctly copying and setting up the PCB et al)?

-- 
Mindaugas


Re: CVS commit: src/sys/kern

2009-12-14 Thread Mindaugas Rasiukevicius
Hello,

 Module Name:src
 Committed By:   dsl
 Date:   Sat Dec 12 17:47:05 UTC 2009
 
 Modified Files:
 src/sys/kern: sys_select.c
 
 Log Message:
 Bounding the 'nfds' arg to poll() at the current process limit for actual
 open files is rather gross - the poll map isn't required to be dense.
 Instead limit to a much larger value (1000 + dt_nfiles) so that user
 programs cannot allocate indefinite sized blocks of kvm.

This does not look right to me.

- Where does the random value 1000 come from?  If you need a limit, POSIX
  allows to limit up to OPEN_MAX (thus did SVR4?).

- How about truncating to fd_lastfile (plus one), instead of dt_nfiles?

-- 
Mindaugas


Re: CVS commit: src/sys/kern

2009-12-14 Thread Matt Thomas

On Dec 14, 2009, at 2:12 PM, Mindaugas Rasiukevicius wrote:

 Hello,
 
 Module Name:src
 Committed By:   dsl
 Date:   Sat Dec 12 17:47:05 UTC 2009
 
 Modified Files:
src/sys/kern: sys_select.c
 
 Log Message:
 Bounding the 'nfds' arg to poll() at the current process limit for actual
 open files is rather gross - the poll map isn't required to be dense.
 Instead limit to a much larger value (1000 + dt_nfiles) so that user
 programs cannot allocate indefinite sized blocks of kvm.
 
 This does not look right to me.
 
 - Where does the random value 1000 come from?  If you need a limit, POSIX
  allows to limit up to OPEN_MAX (thus did SVR4?).
 
 - How about truncating to fd_lastfile (plus one), instead of dt_nfiles?

you could has one each pollfd for IN, OUT, HUP so that's 3 times nfiles.


Re: CVS commit: src/sys/arch/i386/stand/pxeboot

2009-12-14 Thread Daniel Carosone
On Mon, Dec 14, 2009 at 08:05:42PM +, David Laight wrote:
  Shut down the PXE network stack when we are done with it.
 
 I seem to remember some issues where certain bios locked up if/when
 that was called. Which is why it was commented out.

But not, apparently, commented.

--
Dan.

pgpMpxzkkSPAv.pgp
Description: PGP signature


Re: CVS commit: src/sys

2009-12-14 Thread Mindaugas Rasiukevicius
David Young dyo...@pobox.com wrote:
  - Can you tell what relevant code requires alldevs_mtx to be at IPL_HIGH?
  

This question is still standing.

  - You have added config_collect_garbage(), which is mostly called before
config_alldevs_lock().  How about changing it to be used as/with last
unlock?  That is, collect the objects into a list, release the lock and
then destroy all objects.  Apart from avoiding unecessary unlock/relock
dances, it would also be simpler.
 
 Thank you for the suggestion.  To make the change is easy.  I have
 attached a patch.

Generally looks good.

- Is there a reason why config_collect_garbage() is done just after the lock,
  instead of before/with unlock?  If not, those three routines could be a
  single one (think of config_alldevs_enter/exit).

- Are some routines called from interrupt context (thus GC is skipped there)?
  Would be good to add a comment by routine description then.

-- 
Mindaugas


Re: CVS commit: src/tools/gdb

2009-12-14 Thread Masao Uebayashi
 Log Message:
 disable only parallel make.

 @@ -11,7 +11,7 @@
  
  MAKE_ARGS=   MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
  
 -.MAKEFLAGS: -B   # XXX otherwise fails with itable.c / interp.c build
 +.NOTPARALLEL:# XXX otherwise fails with itable.c / interp.c build
  ALL_TARGET=  all-gdb
  INSTALL_TARGET=  install-gdb

Thanks, but .NOTPARALEL doesn't seem to work for me.  See attachment 1.

I made it work using Makefile.gmakehost too.  I don't know what those
NetBSD_DISABLED_* mean.

Masao

-- 
Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635
--- support.o ---
cc: support.c: No such file or directory
--- engine.o ---
cc: engine.c: No such file or directory
--- irun.o ---
cc: irun.c: No such file or directory
--- semantics.o ---
cc: semantics.c: No such file or directory
--- support.o ---
cc: no input files
--- engine.o ---
cc: no input files
--- irun.o ---
cc: no input files
--- semantics.o ---
cc: no input files
--- support.o ---
*** [support.o] Error code 1
--- engine.o ---
*** [engine.o] Error code 1
--- irun.o ---
*** [irun.o] Error code 1
--- semantics.o ---
*** [semantics.o] Error code 1
--- interp.o ---
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c:39:20: 
error: itable.h: No such file or directory
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c: In 
function 'sim_open':
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c:344: error: 
'nr_itable_entries' undeclared (first use in this function)
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c:344: error: 
(Each undeclared identifier is reported only once
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c:344: error: 
for each function it appears in.)
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c: In 
function 'get_insn_name':
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c:731: error: 
'itable' undeclared (first use in this function)
/src/netbsd/src.TNF/tools/gdb/../../gnu/dist/gdb6/sim/mips/interp.c:732: 
warning: control reaches end of non-void function
*** [interp.o] Error code 1
8 errors

nbmake: stopped in 
/src/netbsd/work.TNF/sgimips_mips64eb/obj/tools/gdb/build/sim/mips
*** [all] Error code 1
1 error

nbmake: stopped in /src/netbsd/work.TNF/sgimips_mips64eb/obj/tools/gdb/build/sim
*** [all-sim] Error code 2
1 error

nbmake: stopped in /src/netbsd/work.TNF/sgimips_mips64eb/obj/tools/gdb/build
*** [.build_done] Error code 2
1 error

nbmake: stopped in /src/netbsd/src.TNF/tools/gdb
Index: tools/gdb/Makefile
===
RCS file: /cvsroot/src/tools/gdb/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- tools/gdb/Makefile  14 Dec 2009 14:13:16 -  1.13
+++ tools/gdb/Makefile  15 Dec 2009 01:37:01 -
@@ -11,11 +11,10 @@
 
 MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
 
-.NOTPARALLEL:  # XXX otherwise fails with itable.c / interp.c build
 ALL_TARGET=all-gdb
 INSTALL_TARGET=install-gdb
 
-.include ${.CURDIR}/../Makefile.gnuhost
+.include ${.CURDIR}/../Makefile.gmakehost
 
 CCADDFLAGS= ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include -L${DESTDIR}/lib 
-L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
 
Index: gnu/dist/gdb6/gdb/Makefile.in
===
RCS file: /cvsroot/src/gnu/dist/gdb6/gdb/Makefile.in,v
retrieving revision 1.5
diff -u -r1.5 Makefile.in
--- gnu/dist/gdb6/gdb/Makefile.in   10 Jan 2008 21:43:55 -  1.5
+++ gnu/dist/gdb6/gdb/Makefile.in   15 Dec 2009 01:37:04 -
@@ -1614,8 +1614,8 @@
 
 .SUFFIXES: .y .l
 .y.c: 
-   @echo NOT REBUILDING $@
-NetBSD_DISABLED_y_c:
+#  @echo NOT REBUILDING $@
+#NetBSD_DISABLED_y_c:
$(SHELL) $(YLWRAP) $ y.tab.c $...@.tmp -- $(YACC) $(YFLAGS)
-sed -e '/extern.*malloc/d' \
 -e '/extern.*realloc/d' \
@@ -1628,8 +1628,8 @@
-rm $...@.tmp
mv $...@.new ./$*.c
 .l.c:
-   @echo NOT REBUILDING $@
-NetBSD_DISABLED_l_c:
+#  @echo NOT REBUILDING $@
+#NetBSD_DISABLED_l_c:
if [ $(FLEX) ]  $(FLEX) --version /dev/null 21; then \
$(FLEX) -o$@ $  \
rm -f $...@.new  \


Re: CVS commit: src/tools/gdb

2009-12-14 Thread Masao Uebayashi
 I made it work using Makefile.gmakehost too.  I don't know what those
 NetBSD_DISABLED_* mean.

I found it's clearly mentioned in cvs log:


revision 1.3
date: 2007/01/12 13:24:30;  author: skrll;  state: Exp;  lines: +4 -0
branches:  1.3.4;
Deal with lex and yacc generated files for gdb in the same way as gcc.
That is, use the files supplied with the distribution and never attempt
to rebuild them.

Should fix PR/35271


So problems are:
- why .NOTPARALLEL doesn't work?
- if we use tools/Makefile.gmakehost
  - search path to gnu/dist/gdb6/gdb/f-exp.c is missing

Masao

-- 
Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635


Re: CVS commit: src/external/bsd/ntp

2009-12-14 Thread Joerg Sonnenberger
Could you please add some logical abstraction for this?

Joerg

On Sun, Dec 13, 2009 at 09:09:39PM -0500, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Mon Dec 14 02:09:39 UTC 2009
 
 Modified Files:
   src/external/bsd/ntp: Makefile.inc
 
 Log Message:
 put back -Werror
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/Makefile.inc
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


Re: CVS commit: src/external/bsd/ntp

2009-12-14 Thread Christos Zoulas
On Dec 15,  6:16am, jo...@britannica.bec.de (Joerg Sonnenberger) wrote:
-- Subject: Re: CVS commit: src/external/bsd/ntp

| Could you please add some logical abstraction for this?

I am planning to get rid of it completely and turn WARNS on... Soon after
Frank finishes the build. I just don't want warnings to get through at
this time.

christos


Re: CVS commit: src/tools/gdb

2009-12-14 Thread enami tsugutomo
 So problems are:
 - why .NOTPARALLEL doesn't work?

Since not a parallel make problem.

enami.

Index: gnu/dist/gdb6/sim/mips/Makefile.in
===
RCS file: /cvsroot/src/gnu/dist/gdb6/sim/mips/Makefile.in,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 Makefile.in
--- gnu/dist/gdb6/sim/mips/Makefile.in  2 Jul 2006 20:28:34 -   1.1.1.2
+++ gnu/dist/gdb6/sim/mips/Makefile.in  15 Dec 2009 05:24:08 -
@@ -132,7 +132,7 @@
 $(BUILT_SRC_FROM_IGEN): tmp-igen
 
 tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
-   cd ../igen  $(MAKE)
+   (cd ../igen  $(MAKE))
../igen/igen \
$(IGEN_TRACE) \
-I $(srcdir) \
@@ -213,7 +213,7 @@
 $(BUILT_SRC_FROM_M16): tmp-m16
 
 tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
-   cd ../igen  $(MAKE)
+   (cd ../igen  $(MAKE))
../igen/igen \
$(IGEN_TRACE) \
-I $(srcdir) \


Re: CVS commit: src/tools/gdb

2009-12-14 Thread Masao Uebayashi
 Since not a parallel make problem.
 
 enami.
 
 Index: gnu/dist/gdb6/sim/mips/Makefile.in
 ===
 RCS file: /cvsroot/src/gnu/dist/gdb6/sim/mips/Makefile.in,v
 retrieving revision 1.1.1.2
 diff -u -r1.1.1.2 Makefile.in
 --- gnu/dist/gdb6/sim/mips/Makefile.in2 Jul 2006 20:28:34 -   
 1.1.1.2
 +++ gnu/dist/gdb6/sim/mips/Makefile.in15 Dec 2009 05:24:08 -
 @@ -132,7 +132,7 @@
  $(BUILT_SRC_FROM_IGEN): tmp-igen
  
  tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
 - cd ../igen  $(MAKE)
 + (cd ../igen  $(MAKE))
   ../igen/igen \
   $(IGEN_TRACE) \
   -I $(srcdir) \
 @@ -213,7 +213,7 @@
  $(BUILT_SRC_FROM_M16): tmp-m16
  
  tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
 - cd ../igen  $(MAKE)
 + (cd ../igen  $(MAKE))
   ../igen/igen \
   $(IGEN_TRACE) \
   -I $(srcdir) \

This works!

Masao

-- 
Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635