CVS commit: src/sys/arch/sparc64/sparc64

2013-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 23 12:19:03 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
Sligthly clean up the (by default unused) #ifdef TRAPS_USE_IG


To generate a diff of this commit:
cvs rdiff -u -r1.345 -r1.346 src/sys/arch/sparc64/sparc64/locore.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.345 src/sys/arch/sparc64/sparc64/locore.s:1.346
--- src/sys/arch/sparc64/sparc64/locore.s:1.345	Sat Nov 10 01:47:25 2012
+++ src/sys/arch/sparc64/sparc64/locore.s	Wed Jan 23 12:19:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.345 2012/11/10 01:47:25 nakayama Exp $	*/
+/*	$NetBSD: locore.s,v 1.346 2013/01/23 12:19:02 martin Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -1743,9 +1743,10 @@ winfixfill:
  *
  * The following is duplicated from datafault:
  */
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to AG regs
 #ifdef TRAPS_USE_IG
-	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to interrupt globals
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to alternate globals
 #endif
 	wr	%g0, ASI_DMMU, %asi			! We need to re-load trap info
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
@@ -2106,9 +2107,10 @@ winfixsave:
 	wrpr	%g1, %cwp
 	andn	%g2, CWP, %g2
 	wrpr	%g1, %g2, %tstate
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #ifdef TRAPS_USE_IG
 	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! DEBUG
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #endif
 	mov	%g6, %sp
 	done
@@ -2129,9 +2131,10 @@ winfixsave:
  *
  */
 datafault:
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to AG regs
 #ifdef TRAPS_USE_IG
-	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to interrupt globals
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to alternate globals
 #endif
 	wr	%g0, ASI_DMMU, %asi			! We need to re-load trap info
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
@@ -2374,9 +2377,10 @@ instr_miss:
  */
 
 textfault:
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to AG regs
 #ifdef TRAPS_USE_IG
-	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to interrupt globals
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to alternate globals
 #endif
 	wr	%g0, ASI_IMMU, %asi
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
@@ -3588,9 +3592,10 @@ return_from_trap:
 	ldx	[%sp + CC64FSZ + STKB + TF_G + (6*8)], %g6
 	ldx	[%sp + CC64FSZ + STKB + TF_G + (7*8)], %g7
 	/* Switch to alternate globals and load outs */
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #ifdef TRAPS_USE_IG
 	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! DEBUG
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #endif
 	ldx	[%sp + CC64FSZ + STKB + TF_O + (0*8)], %i0
 	ldx	[%sp + CC64FSZ + STKB + TF_O + (1*8)], %i1



CVS commit: src/share/misc

2013-01-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 23 12:34:45 UTC 2013

Modified Files:
src/share/misc: acronyms

Log Message:
- Added:
AM (in a meaning of ``ante meridiem''),
CEO, CUL, JFGI, JFYI, N/A, S/T.

- Removed:
SNR (also in acronyms.comp),
WYSIWYG (also in acronyms.comp).

- augment / correct entries (more consistent use of ``{}'' and
  ``[]'', capitalization, spelling, typos, fix incorrect acronym
  translations, quoting, punctuation);
- sort entries, as well as the order within ``{}'' parts;
- remove explanations within ``()'' parts where those are unneccesary
  (this is an acronym list, not a dictionary) and, in one case,
  correct such explanation;
- white space fixes.

From Bug Hunting.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/share/misc/acronyms

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.213 src/share/misc/acronyms:1.214
--- src/share/misc/acronyms:1.213	Sun Sep 16 00:02:41 2012
+++ src/share/misc/acronyms	Wed Jan 23 12:34:45 2013
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.213 2012/09/16 00:02:41 dholland Exp $
+$NetBSD: acronyms,v 1.214 2013/01/23 12:34:45 wiz Exp $
 10Q	thank you
 10X	thanks
 1337	elite (leet)
@@ -11,11 +11,11 @@ ADN	any day now
 AEAP	as early as possible
 AFAIAC	as far as I am concerned
 AFAIC	as far as I'm concerned
-AFAICR	as far as I can recall
+AFAICR	as far as I can {recall,remember}
 AFAICS	as far as I can see
 AFAICT	as far as I can tell
 AFAIK	as far as I know
-AFAIR	as far as I {recall, remember}
+AFAIR	as far as I {recall,remember}
 AFAIU	as far as I understand
 AFD	away from desktop
 AFK	away from keyboard
@@ -27,14 +27,15 @@ AISE	as I see it
 AIU	as I understand
 AIUI	as I understand it
 AKA	also known as
+AM	ante meridiem
 AMOL	a mountain of love
 ASAIC	as soon as I can
 ASAP	as soon as possible
 ATEOTD	at the end of the day
 ATM	at the moment
-ATM	automatic teller machine
+ATM	{automated,automatic} teller machine
 ATW	around the world
-AWK	Aho Weinberger Kernighan
+AWK	Aho, Weinberger, [and] Kernighan
 AWOL	absent without official leave
 AYBABTU	all your base are belong to us
 AYF	all your fault
@@ -52,9 +53,9 @@ BBS	be back soon
 BBT	be back tomorrow
 BCNU	be seeing you
 BCNUL8R	be seeing you later
+BCP	best current practice
 BF	best friend
 BF	boyfriend
-BCP	best current practice
 BFD	big fucking deal
 BFF	best friend forever
 BFH	big fucking hammer
@@ -78,6 +79,7 @@ BTFT	been there, fixed that
 BTTH	boot to the head
 BTW	by the way
 CC	credit card
+CEO	chief executive officer
 CFV	call for votes
 CFY	calling for you
 CG	center of gravity
@@ -88,6 +90,7 @@ COTS	commercial off-the-shelf
 CPC	cost per click
 CTN	can't talk now
 CU	see you
+CUL	see you later
 CYA	see you around
 CYE	check your email
 D/L	download
@@ -103,8 +106,8 @@ DRY	don't repeat yourself
 DSTM	don't shoot the messenger
 DTRT	do the right thing
 DTWT	do the wrong thing
-DYK	do you know?
 DWIM	do what I mean
+DYK	do you know?
 ECR	electronic cash register
 EDS	eternal downward spiral
 EFT	electronic funds transfer
@@ -112,31 +115,31 @@ EG	evil grin
 EIE	enough is enough
 EMSG	email message
 EOB	end of business [day]
-EOD	end of {day, discussion}
+EOD	end of {day,discussion}
 EOL	end of life
 EOM	end of message
 EOS	end of story
-ETA	estimated time of arrival
 ETA	edited to add
+ETA	estimated time of arrival
 ETLA	extended three letter acronym
 ETR	early to rise
 EWAG	experienced wild-ass guess
 F9	fine
 FAQ	frequently asked question
 FBOW	for better or worse
+FCFS	first come, first served
 FCOL	for crying out loud
-FCFS	first come first served
 FFS	for fuck's sake
 FFS	free for shipping
 FIGJAM	fuck I'm good, just ask me
-FIIK	fuck[ed] if I know
-FIIR	fuck[ed] if I remember
+FIIK	{fuck,fucked} if I know
+FIIR	{fuck,fucked} if I {recall,remember}
 FITB	fill in the blank
 FM	fucking magic
 FML	fuck my life
-FNO	from now on
 FNO	for nerds only
-FOAD	{fuck off,fall over} and die
+FNO	from now on
+FOAD	{fall over,fuck off} and die
 FOC	free of charge
 FOS	full of shit
 FPS	first person shooter
@@ -154,7 +157,7 @@ FTS	fuck that shit
 FTTT	from time to time
 FTW	for the win
 FUBAR	fucked up beyond all recognition
-FUD	fear, uncertainty, and doubt
+FUD	fear, uncertainty, [and] doubt
 FWIW	for what it's worth
 FYEO	for your eyes only
 FYI	for your information
@@ -167,25 +170,25 @@ GAL	get a life
 GBTW	get back to work
 GF	girlfriend
 GFU	good for you
-GFY	good for you
 GFY	go fuck yourself
+GFY	good for you
 GG	good game
 GGWP	good game, well played
 GIGO	garbage in, garbage out
-GIYF	google is your friend
+GIYF	Google is your friend
 GJ	good job
 GL	good luck
 GLHF	good luck, have fun
 GLWT	good luck with that
 GMTA	great minds think alike
-GOK	god only knows
+GOK	God only knows
 GOWI	get on with it
 GPS	global positioning system
 GR8	great
 GTFO	get the fuck out
 GTG	got to go
 GTH	go to hell
-GTSY	

CVS commit: src/share/misc

2013-01-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 23 12:35:06 UTC 2013

Modified Files:
src/share/misc: acronyms.comp

Log Message:
- Added:
FSF, GPG, NIDS, NIPS, OOO, PHP,
RCS (now being doubled: one capitalized entry for the program name,
   one non capitalized entry for the general term),
SEO,
SFTP (3 times, with 3 different meanings),
SIR (in the meaning of ignal-to-interference ratio),
SPDIF (variant on S/PDIF),
TUI, WOM.

- Removed:
Empty line between the RCS ID and first acronym (not present in
   acronyms either; may cause parsing issues in future though, and
   causes trouble when sorting the file, so remove here instead of
   add in acronyms, also keeping things consistent);
ADP (duplicate),
AWK (also in acronyms),
EOL (in the meaning of ``end of life''; also in acronyms),
FCFS (also in acronyms),
ICE (in the meaning of ``in-circuit emulator''; duplicate),
MP (in the meaning of ``multiprocessor''; combined with the equally
   named entry for ``multiprocessing''),
PERL (not an official acronym),
PIN (also in acronyms).

- augment / correct entries (more consistent use of ``{}'' and
  ``[]'', capitalization, spelling, typos, fix incorrect acronym
  translations, quoting, punctuation);
- sort entries, as well as the order within ``{}'' parts;
- remove explanations within ``()'' parts where those are unneccesary
  (this is an acronym list, not a dictionary) and, in one case,
  correct such explanation;
- white space fixes.

From Bug Hunting.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/share/misc/acronyms.comp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.130 src/share/misc/acronyms.comp:1.131
--- src/share/misc/acronyms.comp:1.130	Thu Oct 11 18:00:25 2012
+++ src/share/misc/acronyms.comp	Wed Jan 23 12:35:06 2013
@@ -1,33 +1,31 @@
-$NetBSD: acronyms.comp,v 1.130 2012/10/11 18:00:25 ginsbach Exp $
-
+$NetBSD: acronyms.comp,v 1.131 2013/01/23 12:35:06 wiz Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
-AAA	authentication, authorization, accounting
+AAA	authentication, authorization, [and] accounting
 AAT	average access time
 ABI	application binary interface
 ABR	available bit rate
 AC	alternating current
 ACI	adjacent channel interferer
 ACID	atomicity, consistency, isolation, durability
-ACK	acknowledgement
 ACK	Amsterdam compiler kit
+ACK	acknowledgement
 ACL	access control list
 ACL	active current loop
-ACP	auxillary control {program, process}
+ACP	auxillary control {process,program}
 ACPI	advanced configuration and power interface
 ACS	access control set
 ACU	automatic calling unit
 ADB	Apple desktop bus
 ADC	analog [to] digital converter
 ADD	acronym driven development
-ADP	automatic data processing
-ADT	abstract data type
 ADO	active data objects
 ADP	automatic data processing
 ADPCM	adaptive differential pulse code modulation
 ADS	alternate data stream
 ADSL	asymmetric digital subscriber line
+ADT	abstract data type
 AES	Advanced Encryption Standard
 AFS	Andrew File System
 AGC	automatic gain control
@@ -40,14 +38,14 @@ ALE	address latch enable
 ALS	ambient light sensor
 ALU	arithmetic and logical unit
 AM	access method
-AM	amplitude modulation
 AM	alignment mask
+AM	amplitude modulation
 AMI	alternate mark inversion
 AMT	active management technology
 AN	Arabic number
 ANSI	American National Standards Institute
 AO	analog output
-AOL	alert on LAN
+AOL	Alert-on-LAN
 AOS	add or subtract
 AP	access point
 AP	application processor
@@ -58,21 +56,21 @@ AQM	active queue management
 ARAT	always running APIC timer
 ARC	adaptive replacement cache
 ARM	Advanced RISC Machines
-ARP	address resolution protocol
+ARP	Address Resolution Protocol
 ARPA	Advanced Research Projects Agency
 ARQ	automatic repeat request
 ARR	address range register
 ARU	audio response unit
 AS	autonomous system
 ASC	advanced smart cache
-ASCII	American standard code for information interchange
+ASCII	American Standard Code for Information Interchange
 ASD	agile software development
 ASE	advanced software environment
 ASIC	application-specific integrated circuit
 ASK	amplitude shif keying
 ASLR	address space layout randomization
-ASPM	active state power management
 ASN	autonomous system number
+ASPM	active state power management
 ASQ	automated software quality
 ASR	address space register
 AST	abstract syntax tree
@@ -87,7 +85,6 @@ ATX	advanced technology extended
 AV	anti virus
 AVL	Adelson-Velsky-Landis
 AVX	advanced vector extensions
-AWK	Aho, Werner, and Kernighan
 BA	byte align
 BAL	basic assembly language
 BAR	base address register
@@ -102,21 +99,21 @@ BDI	bit deinterleave
 BDUF	big design up front
 BEDO	burst extended data output
 BER	basic encoding rules
-BER	bit error {rate, ratio}
-BFD	binary {file, format} descriptor
+BER	bit error {rate,ratio}
+BFD	binary {file,format} 

CVS commit: src/lib/libterminfo

2013-01-23 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Jan 23 13:06:19 UTC 2013

Modified Files:
src/lib/libterminfo: tparm.c

Log Message:
Fix %t logic and don't output any %; or %e parts.
Fixes PR lib/47490 thanks to Julien Oster


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libterminfo/tparm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libterminfo/tparm.c
diff -u src/lib/libterminfo/tparm.c:1.9 src/lib/libterminfo/tparm.c:1.10
--- src/lib/libterminfo/tparm.c:1.9	Fri Nov 30 10:14:18 2012
+++ src/lib/libterminfo/tparm.c	Wed Jan 23 13:06:18 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: tparm.c,v 1.9 2012/11/30 10:14:18 msaitoh Exp $ */
+/* $NetBSD: tparm.c,v 1.10 2013/01/23 13:06:18 roy Exp $ */
 
 /*
  * Copyright (c) 2009, 2011 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: tparm.c,v 1.9 2012/11/30 10:14:18 msaitoh Exp $);
+__RCSID($NetBSD: tparm.c,v 1.10 2013/01/23 13:06:18 roy Exp $);
 #include sys/param.h
 
 #include assert.h
@@ -454,7 +454,7 @@ _ti_tiparm(TERMINAL *term, const char *s
 			break;
 		case 't': /* then */
 			pop(val, NULL, stack);
-			if (val != 0) {
+			if (val == 0) {
 l = 0;
 for (; *str != '\0'; str++) {
 	if (*str != '%')
@@ -465,10 +465,14 @@ _ti_tiparm(TERMINAL *term, const char *s
 	else if (*str == ';') {
 		if (l  0)
 			l--;
-		else
+		else {
+			str++;
 			break;
-	} else if (*str == 'e'  l == 0)
+		}
+	} else if (*str == 'e'  l == 0) {
+		str++;
 		break;
+	}
 }
 			}
 			break;
@@ -483,8 +487,10 @@ _ti_tiparm(TERMINAL *term, const char *s
 else if (*str == ';') {
 	if (l  0)
 		l--;
-	else
+	else {
+		str++;
 		break;
+	}
 }
 			}
 			break;



CVS commit: src/sys/arch/evbarm

2013-01-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan 23 14:24:14 UTC 2013

Modified Files:
src/sys/arch/evbarm/conf: files.iq31244 files.iq80321 files.ixdp425
files.npwr_fc
Removed Files:
src/sys/arch/evbarm/evbarm: initarm_common.c initarmvar.h

Log Message:
Remove old and never used evbarm/initarm_common. Please use
arm32/arm32_boot.c:initarm_common


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/files.iq31244
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/files.iq80321 \
src/sys/arch/evbarm/conf/files.ixdp425
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/files.npwr_fc
cvs rdiff -u -r1.12 -r0 src/sys/arch/evbarm/evbarm/initarm_common.c
cvs rdiff -u -r1.1 -r0 src/sys/arch/evbarm/evbarm/initarmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/files.iq31244
diff -u src/sys/arch/evbarm/conf/files.iq31244:1.7 src/sys/arch/evbarm/conf/files.iq31244:1.8
--- src/sys/arch/evbarm/conf/files.iq31244:1.7	Fri Jan  9 16:23:59 2009
+++ src/sys/arch/evbarm/conf/files.iq31244	Wed Jan 23 14:24:14 2013
@@ -1,12 +1,8 @@
-#	$NetBSD: files.iq31244,v 1.7 2009/01/09 16:23:59 briggs Exp $
+#	$NetBSD: files.iq31244,v 1.8 2013/01/23 14:24:14 skrll Exp $
 #
 # Intel IQ31244 reference board configuration info
 #
 
-# Use the shared initarm_common() code.
-# XXX: Not yet ready for prime-time
-#file	arch/evbarm/evbarm/initarm_common.c
-
 file	arch/evbarm/iq31244/iq31244_7seg.c
 file	arch/evbarm/iq80321/iq80321_machdep.c
 file	arch/evbarm/iq31244/iq31244_machdep.c

Index: src/sys/arch/evbarm/conf/files.iq80321
diff -u src/sys/arch/evbarm/conf/files.iq80321:1.8 src/sys/arch/evbarm/conf/files.iq80321:1.9
--- src/sys/arch/evbarm/conf/files.iq80321:1.8	Mon Dec  3 15:33:31 2007
+++ src/sys/arch/evbarm/conf/files.iq80321	Wed Jan 23 14:24:14 2013
@@ -1,12 +1,8 @@
-#	$NetBSD: files.iq80321,v 1.8 2007/12/03 15:33:31 ad Exp $
+#	$NetBSD: files.iq80321,v 1.9 2013/01/23 14:24:14 skrll Exp $
 #
 # Intel IQ80321 evaluation board configuration info
 #
 
-# Use the shared initarm_common() code.
-# XXX: Not yet ready for prime-time
-#file	arch/evbarm/evbarm/initarm_common.c
-
 file	arch/evbarm/iq80321/iq80321_7seg.c
 file	arch/evbarm/iq80321/iq80321_machdep.c
 file	arch/evbarm/iq80321/iq80321_pci.c
Index: src/sys/arch/evbarm/conf/files.ixdp425
diff -u src/sys/arch/evbarm/conf/files.ixdp425:1.8 src/sys/arch/evbarm/conf/files.ixdp425:1.9
--- src/sys/arch/evbarm/conf/files.ixdp425:1.8	Mon Mar 17 09:30:02 2008
+++ src/sys/arch/evbarm/conf/files.ixdp425	Wed Jan 23 14:24:14 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ixdp425,v 1.8 2008/03/17 09:30:02 kiyohara Exp $
+#	$NetBSD: files.ixdp425,v 1.9 2013/01/23 14:24:14 skrll Exp $
 #
 # Intel IXP425 networkproccesor board configuration info
 #
@@ -6,9 +6,6 @@
 # IXP425 Network Processor CPU support
 include arch/arm/xscale/files.ixp425
 
-# Use the shared initarm_common() code.
-# XXX: Not yet ready for prime-time
-#file	arch/evbarm/evbarm/initarm_common.c
 file	arch/evbarm/ixdp425/ixdp425_machdep.c
 
 file	arch/evbarm/ixdp425/ixdp425_pci.c

Index: src/sys/arch/evbarm/conf/files.npwr_fc
diff -u src/sys/arch/evbarm/conf/files.npwr_fc:1.2 src/sys/arch/evbarm/conf/files.npwr_fc:1.3
--- src/sys/arch/evbarm/conf/files.npwr_fc:1.2	Mon Dec  3 15:33:31 2007
+++ src/sys/arch/evbarm/conf/files.npwr_fc	Wed Jan 23 14:24:14 2013
@@ -1,12 +1,8 @@
-#	$NetBSD: files.npwr_fc,v 1.2 2007/12/03 15:33:31 ad Exp $
+#	$NetBSD: files.npwr_fc,v 1.3 2013/01/23 14:24:14 skrll Exp $
 #
 # Intel IQ80321 evaluation board configuration info
 #
 
-# Use the shared initarm_common() code.
-# XXX: Not yet ready for prime-time
-#file	arch/evbarm/evbarm/initarm_common.c
-
 file	arch/evbarm/npwr_fc/npwr_fc_machdep.c
 file	arch/evbarm/npwr_fc/npwr_fc_pci.c
 



CVS commit: src

2013-01-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Jan 23 15:03:02 UTC 2013

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: ad.powerpc md.amd64 md.i386
src/etc/mtree: NetBSD.dist.base
src/external/bsd/llvm: Makefile.inc
src/external/bsd/llvm/bin: Makefile
src/external/bsd/llvm/bin/bugpoint: Makefile
src/external/bsd/llvm/bin/clang: Makefile
src/external/bsd/llvm/bin/llc: Makefile
src/external/bsd/llvm/bin/lli: Makefile
src/external/bsd/llvm/bin/llvm-ar: Makefile
src/external/bsd/llvm/bin/llvm-as: Makefile
src/external/bsd/llvm/bin/llvm-cov: Makefile
src/external/bsd/llvm/bin/llvm-diff: Makefile
src/external/bsd/llvm/bin/llvm-dis: Makefile
src/external/bsd/llvm/bin/llvm-extract: Makefile
src/external/bsd/llvm/bin/llvm-link: Makefile
src/external/bsd/llvm/bin/llvm-mc: Makefile
src/external/bsd/llvm/bin/llvm-nm: Makefile
src/external/bsd/llvm/bin/llvm-prof: Makefile
src/external/bsd/llvm/bin/llvm-ranlib: Makefile
src/external/bsd/llvm/bin/llvm-readobj: Makefile
src/external/bsd/llvm/bin/macho-dumpx: Makefile
src/external/bsd/llvm/bin/opt: Makefile
src/external/bsd/llvm/bin/tblgen: Makefile
src/external/bsd/llvm/config/clang/Config: config.h
src/external/bsd/llvm/config/llvm/Config: config.h.in
src/external/bsd/llvm/include: Makefile
src/external/bsd/llvm/lib: Makefile
src/external/bsd/llvm/lib/libLLVMARMAsmParser: Makefile
src/external/bsd/llvm/lib/libLLVMARMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMARMMCTargetDesc: Makefile
src/external/bsd/llvm/lib/libLLVMAnalysis: Makefile
src/external/bsd/llvm/lib/libLLVMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMInstrumentation: Makefile
src/external/bsd/llvm/lib/libLLVMMC: Makefile
src/external/bsd/llvm/lib/libLLVMMCDisassembler: Makefile
src/external/bsd/llvm/lib/libLLVMMCJIT: Makefile
src/external/bsd/llvm/lib/libLLVMMipsCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMSupport: Makefile
src/external/bsd/llvm/lib/libLLVMTarget: Makefile
src/external/bsd/llvm/lib/libLLVMTransformsUtils: Makefile
src/external/bsd/llvm/lib/libLLVMX86AsmParser: Makefile
src/external/bsd/llvm/lib/libLLVMX86CodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMipa: Makefile
src/external/bsd/llvm/lib/libclangARCMigrate: Makefile
src/external/bsd/llvm/lib/libclangAST: Makefile
src/external/bsd/llvm/lib/libclangBasic: Makefile
src/external/bsd/llvm/lib/libclangLex: Makefile
Added Files:
src/external/bsd/llvm/bin/llvm-objdump: Makefile
src/external/bsd/llvm/lib/libLLVMIR: Makefile
src/external/bsd/llvm/lib/libLLVMOption: Makefile
src/external/bsd/llvm/lib/libclangFormat: Makefile
src/tools/llvm-lib/libLLVMIR: Makefile
Removed Files:
src/external/bsd/llvm/lib/libLLVMCore: Makefile
src/tools/llvm-lib/libLLVMCore: Makefile

Log Message:
Update LLVM/Clang snapshot to r172366. Catch up with the move past 3.2
release.


To generate a diff of this commit:
cvs rdiff -u -r1.1016 -r1.1017 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.60 -r1.61 src/distrib/sets/lists/comp/ad.powerpc
cvs rdiff -u -r1.188 -r1.189 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.132 -r1.133 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.107 -r1.108 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.43 -r1.44 src/external/bsd/llvm/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/llvm/bin/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/llvm/bin/bugpoint/Makefile
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/llvm/bin/clang/Makefile
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/llvm/bin/llc/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/llvm/bin/lli/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/llvm-ar/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/llvm-as/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/llvm-cov/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/llvm/bin/llvm-diff/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/llvm/bin/llvm-dis/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/llvm/bin/llvm-extract/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/llvm/bin/llvm-link/Makefile
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/llvm/bin/llvm-mc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/llvm-nm/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/llvm/bin/llvm-objdump/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/llvm-prof/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/llvm-ranlib/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/llvm-readobj/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/bin/macho-dumpx/Makefile

CVS commit: src/sbin/newfs_msdos

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 15:29:15 UTC 2013

Modified Files:
src/sbin/newfs_msdos: mkfs_msdos.c mkfs_msdos.h newfs_msdos.c

Log Message:
fix regressions after split.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/newfs_msdos/mkfs_msdos.c \
src/sbin/newfs_msdos/mkfs_msdos.h
cvs rdiff -u -r1.41 -r1.42 src/sbin/newfs_msdos/newfs_msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/newfs_msdos/mkfs_msdos.c
diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.1 src/sbin/newfs_msdos/mkfs_msdos.c:1.2
--- src/sbin/newfs_msdos/mkfs_msdos.c:1.1	Mon Jan 21 15:28:38 2013
+++ src/sbin/newfs_msdos/mkfs_msdos.c	Wed Jan 23 10:29:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.c,v 1.1 2013/01/21 20:28:38 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.c,v 1.2 2013/01/23 15:29:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
 static const char rcsid[] =
   $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $;
 #else
-__RCSID($NetBSD: mkfs_msdos.c,v 1.1 2013/01/21 20:28:38 christos Exp $);
+__RCSID($NetBSD: mkfs_msdos.c,v 1.2 2013/01/23 15:29:15 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -258,7 +258,7 @@ mkfs_msdos(const char *fname, const char
 	warnx(Cannot specify both block size and sectors per cluster);
 	return -1;
 }
-if (strlen(o.OEM_string)  8) {
+if (o.OEM_string  strlen(o.OEM_string)  8) {
 	warnx(%s: bad OEM string, o.OEM_string);
 	return -1;
 }
@@ -280,9 +280,10 @@ mkfs_msdos(const char *fname, const char
 	}
 	pos = lseek(fd, 0, SEEK_SET);
 } else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1 ||
-	fstat(fd, sb))
+	fstat(fd, sb)) {
 	warn(%s, fname);
 	return -1;
+}
 if (!o.no_create)
 	if (check_mounted(fname, sb.st_mode) == -1)
 	return -1;
@@ -333,7 +334,7 @@ mkfs_msdos(const char *fname, const char
 	}
 }
 
-if (!oklabel(o.volume_label)) {
+if (o.volume_label  !oklabel(o.volume_label)) {
 	warnx(%s: bad volume label, o.volume_label);
 	return -1;
 }
@@ -385,12 +386,12 @@ mkfs_msdos(const char *fname, const char
 	}
 	if (o.block_size  bpb.bps) {
 	warnx(block size (%u) is too small; minimum is %u,
-		 o.block_size, bpb.bps);
+		o.block_size, bpb.bps);
 	return -1;
 	}
 	if (o.block_size  bpb.bps * MAXSPC) {
 	warnx(block size (%u) is too large; maximum is %u,
-		 o.block_size, bpb.bps * MAXSPC);
+		o.block_size, bpb.bps * MAXSPC);
 	return -1;
 	}
 	bpb.spc = o.block_size / bpb.bps;
@@ -435,8 +436,10 @@ mkfs_msdos(const char *fname, const char
 	bname = o.bootstrap;
 	if (!strchr(bname, '/')) {
 	snprintf(buf, sizeof(buf), /boot/%s, bname);
-	if (!(bname = strdup(buf)))
-		err(1, NULL);
+	if (!(bname = strdup(buf))) {
+		warn(NULL);
+		return -1;
+	}
 	}
 	if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, sb)) {
 	warn(%s, bname);
Index: src/sbin/newfs_msdos/mkfs_msdos.h
diff -u src/sbin/newfs_msdos/mkfs_msdos.h:1.1 src/sbin/newfs_msdos/mkfs_msdos.h:1.2
--- src/sbin/newfs_msdos/mkfs_msdos.h:1.1	Mon Jan 21 15:28:38 2013
+++ src/sbin/newfs_msdos/mkfs_msdos.h	Wed Jan 23 10:29:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.h,v 1.1 2013/01/21 20:28:38 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.h,v 1.2 2013/01/23 15:29:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,32 +35,32 @@
 #include sys/types.h
 #include stdbool.h
 #define ALLOPTS \
-AOPT('@', off_t, offset, Offset in device) \
-AOPT('B', char *, bootstrap, Bootstrap file) \
-AOPT('C', off_t, create_size, Create file) \
-AOPT('F', uint8_t,  fat_type, FAT type (12, 16, or 32)) \
-AOPT('I', uint32_t, volume_id, Volume ID) \
-AOPT('L', char *, volume_label, Volume Label) \
-AOPT('N', bool, no_create, Don't create filesystem, print params only) \
-AOPT('O', char *, OEM_string, OEM string) \
-AOPT('S', uint16_t, bytes_per_sector, Bytes per sector) \
-AOPT('a', uint32_t, sectors_per_fat, Sectors per FAT) \
-AOPT('b', uint32_t, block_size, Block size) \
-AOPT('c', uint8_t, sectors_per_cluster, Sectors per cluster) \
-AOPT('e', uint16_t, directory_entries, Directory entries) \
-AOPT('f', char *, floppy, Standard format floppies (160,180,320,360,640,720,1200,1232,1440,2880)) \
-AOPT('h', uint16_t, drive_heads, Drive heads) \
-AOPT('i', uint16_t, info_sector, Info sector) \
-AOPT('k', uint16_t, backup_sector, Backup sector) \
-AOPT('m', uint8_t, media_descriptor, Media descriptor) \
-AOPT('n', uint8_t, num_FAT, Number of FATs) \
-AOPT('o', uint32_t, hidden_sectors, Hidden sectors) \
-AOPT('r', uint16_t, reserved_sectors, Reserved sectors) \
-AOPT('s', uint32_t, size, File System size) \
-AOPT('u', uint16_t, sectors_per_track, Sectors per track)
+AOPT('@', off_t, offset, 0, Offset in device) \
+AOPT('B', char *, bootstrap, -1, Bootstrap file) \
+AOPT('C', off_t, create_size, 0, Create 

CVS commit: src/bin/csh

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 16:39:04 UTC 2013

Modified Files:
src/bin/csh: Makefile csh.c csh.h extern.h hist.c lex.c set.c

Log Message:
make history kind of work :-), turn libedit support on.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/bin/csh/Makefile
cvs rdiff -u -r1.44 -r1.45 src/bin/csh/csh.c
cvs rdiff -u -r1.24 -r1.25 src/bin/csh/csh.h
cvs rdiff -u -r1.27 -r1.28 src/bin/csh/extern.h
cvs rdiff -u -r1.18 -r1.19 src/bin/csh/hist.c
cvs rdiff -u -r1.28 -r1.29 src/bin/csh/lex.c
cvs rdiff -u -r1.30 -r1.31 src/bin/csh/set.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/csh/Makefile
diff -u src/bin/csh/Makefile:1.35 src/bin/csh/Makefile:1.36
--- src/bin/csh/Makefile:1.35	Tue Jan 22 17:40:31 2013
+++ src/bin/csh/Makefile	Wed Jan 23 11:39:03 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2013/01/22 22:40:31 christos Exp $
+#	$NetBSD: Makefile,v 1.36 2013/01/23 16:39:03 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 #
 # C Shell with process control; VM/UNIX VAX Makefile
@@ -10,10 +10,11 @@
 
 PROG=	csh
 DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
-# - Not integrated with history
+# - Editor history not always aligned with shell history,
+#   should implement internally
 # - Does not handle escaped prompts.
 # - Does not do completion
-# DFLAGS+=-DEDIT
+DFLAGS+=-DEDIT
 CPPFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
 SRCS=	alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
 	func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
@@ -60,7 +61,7 @@ COPTS.err.c = -Wno-format-nonliteral
 COPTS.printf.c = -Wno-format-nonliteral
 COPTS.proc.c = -Wno-format-nonliteral
 
-.if 0
+.if !empty(DFLAGS:M*EDIT)
 LDADD+=-ledit -lutil
 DPADD+=${LIBEDIT} ${LIBUTIL}
 .else

Index: src/bin/csh/csh.c
diff -u src/bin/csh/csh.c:1.44 src/bin/csh/csh.c:1.45
--- src/bin/csh/csh.c:1.44	Tue Jan 22 15:35:29 2013
+++ src/bin/csh/csh.c	Wed Jan 23 11:39:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: csh.c,v 1.44 2013/01/22 20:35:29 christos Exp $ */
+/* $NetBSD: csh.c,v 1.45 2013/01/23 16:39:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)csh.c	8.2 (Berkeley) 10/12/93;
 #else
-__RCSID($NetBSD: csh.c,v 1.44 2013/01/22 20:35:29 christos Exp $);
+__RCSID($NetBSD: csh.c,v 1.45 2013/01/23 16:39:03 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -78,7 +78,7 @@ __RCSID($NetBSD: csh.c,v 1.44 2013/01/2
  */
 
 Char *dumphist[] = {STRhistory, STRmh, 0, 0};
-Char *loadhist[] = {STRsource, STRmh, STRtildothist, 0};
+Char *tildehist[] = {STRsource, STRmh, STRtildothist, 0};
 
 int nofile = 0;
 int batch = 0;
@@ -542,8 +542,8 @@ notty:
 	 * Source history before .login so that it is available in .login
 	 */
 	if ((cp = value(STRhistfile)) != STRNULL)
-	loadhist[2] = cp;
-	dosource(loadhist, NULL);
+	tildehist[2] = cp;
+	dosource(tildehist, NULL);
 if (loginsh)
 	  (void)srccat(value(STRhome), STRsldotlogin);
 }

Index: src/bin/csh/csh.h
diff -u src/bin/csh/csh.h:1.24 src/bin/csh/csh.h:1.25
--- src/bin/csh/csh.h:1.24	Tue Jan 22 17:40:31 2013
+++ src/bin/csh/csh.h	Wed Jan 23 11:39:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: csh.h,v 1.24 2013/01/22 22:40:31 christos Exp $ */
+/* $NetBSD: csh.h,v 1.25 2013/01/23 16:39:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -552,6 +552,7 @@ Char **STR_environ;
 #ifdef EDIT
 #include histedit.h
 EditLine *el;
+History *hi;
 #endif
 int editing;
 

Index: src/bin/csh/extern.h
diff -u src/bin/csh/extern.h:1.27 src/bin/csh/extern.h:1.28
--- src/bin/csh/extern.h:1.27	Tue Jan 22 15:35:29 2013
+++ src/bin/csh/extern.h	Wed Jan 23 11:39:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.27 2013/01/22 20:35:29 christos Exp $ */
+/* $NetBSD: extern.h,v 1.28 2013/01/23 16:39:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -175,6 +175,9 @@ int sortscmp(const ptr_t, const ptr_t);
  */
 void dohist(Char **, struct command *);
 struct Hist *enthist(int, struct wordent *, int);
+#ifdef EDIT
+void loadhist(struct Hist *);
+#endif
 void savehist(struct wordent *);
 
 /*
@@ -189,6 +192,9 @@ Char *domod(Char *, int);
 void freelex(struct wordent *);
 int lex(struct wordent *);
 void prlex(FILE *, struct wordent *);
+#ifdef EDIT
+int sprlex(char **, struct wordent *);
+#endif
 int readc(int);
 void settell(void);
 void unreadc(int);

Index: src/bin/csh/hist.c
diff -u src/bin/csh/hist.c:1.18 src/bin/csh/hist.c:1.19
--- src/bin/csh/hist.c:1.18	Mon Jul 16 14:26:10 2007
+++ src/bin/csh/hist.c	Wed Jan 23 11:39:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: hist.c,v 1.18 2007/07/16 18:26:10 christos Exp $ */
+/* $NetBSD: hist.c,v 1.19 2013/01/23 16:39:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)hist.c	8.1 (Berkeley) 5/31/93;
 #else

CVS commit: src/sys/arch/arm/broadcom

2013-01-23 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jan 23 16:51:15 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_space.c

Log Message:
support BUS_SPACE_MAP_PREFETCHABLE in bcm2835_bs_mmap()


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_space.c
diff -u src/sys/arch/arm/broadcom/bcm2835_space.c:1.3 src/sys/arch/arm/broadcom/bcm2835_space.c:1.4
--- src/sys/arch/arm/broadcom/bcm2835_space.c:1.3	Sun Jan 13 06:10:25 2013
+++ src/sys/arch/arm/broadcom/bcm2835_space.c	Wed Jan 23 16:51:14 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_space.c,v 1.3 2013/01/13 06:10:25 skrll Exp $	*/
+/*	$NetBSD: bcm2835_space.c,v 1.4 2013/01/23 16:51:14 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_space.c,v 1.3 2013/01/13 06:10:25 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_space.c,v 1.4 2013/01/23 16:51:14 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -370,8 +370,12 @@ bcm2835_bs_vaddr(void *t, bus_space_hand
 paddr_t
 bcm2835_bs_mmap(void *t, bus_addr_t paddr, off_t offset, int prot, int flags)
 {
+	paddr_t bus_flags = 0;
 
-	return (arm_btop((paddr + offset)));
+	if (flags  BUS_SPACE_MAP_PREFETCHABLE)
+		bus_flags |= ARM32_MMAP_WRITECOMBINE;
+
+	return (arm_btop(paddr + offset) | bus_flags);
 }
 
 int



CVS commit: src/include/rpcsvc

2013-01-23 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Wed Jan 23 17:27:35 UTC 2013

Modified Files:
src/include/rpcsvc: yp_prot.h

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/include/rpcsvc/yp_prot.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/rpcsvc/yp_prot.h
diff -u src/include/rpcsvc/yp_prot.h:1.17 src/include/rpcsvc/yp_prot.h:1.18
--- src/include/rpcsvc/yp_prot.h:1.17	Sat Oct  6 16:17:34 2007
+++ src/include/rpcsvc/yp_prot.h	Wed Jan 23 17:27:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: yp_prot.h,v 1.17 2007/10/06 16:17:34 yamt Exp $	*/
+/*	$NetBSD: yp_prot.h,v 1.18 2013/01/23 17:27:35 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993 Theo de Raadt dera...@fsa.ca
@@ -287,7 +287,7 @@ struct yppushresp_xfr {
 #define YPPUSH_AGE	((unsigned int)2)	/* Master's version not newer */
 #define YPPUSH_NOMAP 	((unsigned int)-1)	/* Can't find server for map */
 #define YPPUSH_NODOM 	((unsigned int)-2)	/* Domain not supported */
-#define YPPUSH_RSRC 	((unsigned int)-3)	/* Local resouce alloc failure */
+#define YPPUSH_RSRC 	((unsigned int)-3)	/* Local resource alloc failure */
 #define YPPUSH_RPC 	((unsigned int)-4)	/* RPC failure talking to server */
 #define YPPUSH_MADDR	((unsigned int)-5)	/* Can't get master address */
 #define YPPUSH_YPERR 	((unsigned int)-6)	/* YP server/map db error */



CVS commit: src/sys/dev/sysmon

2013-01-23 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Wed Jan 23 18:04:34 UTC 2013

Modified Files:
src/sys/dev/sysmon: sysmon_envsys_events.c

Log Message:
Fix spelling, grammar, typos.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/sysmon/sysmon_envsys_events.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.108 src/sys/dev/sysmon/sysmon_envsys_events.c:1.109
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.108	Fri Dec 14 15:33:19 2012
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Wed Jan 23 18:04:33 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.108 2012/12/14 15:33:19 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.109 2013/01/23 18:04:33 mbalmer Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.108 2012/12/14 15:33:19 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.109 2013/01/23 18:04:33 mbalmer Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -409,8 +409,8 @@ sme_event_unregister(struct sysmon_envsy
 	}
 
 	/*
-	 * Wait for the event to finish its work, remove from the list
-	 * and release resouces.
+	 * Wait for the event to finish its work, remove it from the list
+	 * and release resources.
 	 */
 	while (see-see_flags  SEE_EVENT_WORKING)
 		cv_wait(sme-sme_condvar, sme-sme_mtx);
@@ -447,8 +447,8 @@ sme_event_unregister_sensor(struct sysmo
 		return EINVAL;
 
 	/*
-	 * Wait for the event to finish its work, remove from the list
-	 * and release resouces.
+	 * Wait for the event to finish its work, remove it from the list
+	 * and release resources.
 	 */
 	while (see-see_flags  SEE_EVENT_WORKING)
 		cv_wait(sme-sme_condvar, sme-sme_mtx);



CVS commit: src/dist/nvi/common

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 18:51:51 UTC 2013

Modified Files:
src/dist/nvi/common: conv.c

Log Message:
It is ridiculous to truncate files on character conversions without
warning and a chance for recovery. This patch sets the handler to
copy the character, clear the error and proceed instead of bailing
out.

To replicate:
- unset LANG
- Create a file that has ~1000 lines. Put a single bad character
- '\344' in it, around 2/3rds of the file down. Save it.
- export LANG=en_US.UTF-8
- edit the file. Notice there is no error for input conversion,
  since nvi reads the file opportunistically.
- :w Boom, the file is truncated.

Alternatively, you can put that character in the first line of the file,
and watch the fireworks. If you like to restore the previous behavior
compile with -DERROR_ON_CONVERT

XXX: Pullup to 6, 5 etc.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/common/conv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/nvi/common/conv.c
diff -u src/dist/nvi/common/conv.c:1.6 src/dist/nvi/common/conv.c:1.7
--- src/dist/nvi/common/conv.c:1.6	Sat Jan 17 22:45:50 2009
+++ src/dist/nvi/common/conv.c	Wed Jan 23 13:51:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: conv.c,v 1.6 2009/01/18 03:45:50 lukem Exp $ */
+/*	$NetBSD: conv.c,v 1.7 2013/01/23 18:51:51 christos Exp $ */
 
 /*-
  * Copyright (c) 1993, 1994
@@ -62,6 +62,21 @@ raw2int(SCR *sp, const char * str, ssize
 return 0;
 }
 
+#ifndef ERROR_ON_CONVERT
+#define HANDLE_ICONV_ERROR(o, i, ol, il) do {\
+		*o++ = *i++;		\
+		ol--; il--;		\
+	} while (/*CONSTCOND*/0)
+#define HANDLE_MBR_ERROR(n, mbs, d, s) do {\
+		d = s;			\
+		MEMSET(mbs, 0, 1); 	\
+		n = 1; 			\
+	} while (/*CONSTCOND*/0)
+#else
+#define HANDLE_ICONV_ERROR goto err
+#define	HANDLE_MBR_ERROR goto err
+#endif
+
 #define CONV_BUFFER_SIZE512
 /* fill the buffer with codeset encoding of string pointed to by str
  * left has the number of bytes left in str and is adjusted
@@ -74,9 +89,9 @@ raw2int(SCR *sp, const char * str, ssize
 	char *bp = buffer;		\
 	outleft = CONV_BUFFER_SIZE;	\
 	errno = 0;			\
-	if (iconv(id, (const char **)str, left, bp, outleft) == (size_t)-1 \
-		/*  errno != E2BIG */)\
-	goto err;			\
+	if (iconv(id, (const char **)str, left, bp, outleft) 	\
+	== (size_t)-1 /*  errno != E2BIG */)			\
+		HANDLE_ICONV_ERROR(bp, str, outleft, left);		\
 	if ((len = CONV_BUFFER_SIZE - outleft) == 0) {			\
 	error = -left;		\
 	goto err;			\
@@ -120,7 +135,8 @@ default_char2int(SCR *sp, const char * s
 	n = mbrtowc((*tostr)+i, src+j, len-j, mbs);
 	/* NULL character converted */
 	if (n == (size_t)-2) error = -(len-j);
-	if (n == (size_t)-1 || n == (size_t)-2) goto err;
+	if (n == (size_t)-1 || n == (size_t)-2)
+	HANDLE_MBR_ERROR(n, mbs, (*tostr)[i], src[j]); 
 	if (n == 0) n = 1;
 	j += n;
 	if (++i = *blen) {
@@ -243,8 +259,8 @@ default_int2char(SCR *sp, const CHAR_T *
 	}				\
 	errno = 0;			\
 	if (iconv(id, bp, len, obp, outleft) == (size_t)-1 	\
-		errno != E2BIG)	\
-		goto err;		\
+		errno != E2BIG) 	\
+		HANDLE_ICONV_ERROR(obp, bp, outleft, len);		\
 	offset = cw-blen1 - outleft;			\
 	}			\
 } while (0)
@@ -268,7 +284,8 @@ default_int2char(SCR *sp, const CHAR_T *
 
 for (i = 0, j = 0; i  (size_t)len; ++i) {
 	n = wcrtomb(dst+j, str[i], mbs);
-	if (n == (size_t)-1) goto err;
+	if (n == (size_t)-1) 
+	   HANDLE_MBR_ERROR(n, mbs, dst[j], str[i]);
 	j += n;
 	if (buflen  j + MB_CUR_MAX) {
 	if (id != (iconv_t)-1) {



CVS commit: src/lib/libpuffs

2013-01-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jan 23 20:22:34 UTC 2013

Modified Files:
src/lib/libpuffs: requests.c

Log Message:
Assert equality, not assignment, in puffs__fsframe_cmp.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libpuffs/requests.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpuffs/requests.c
diff -u src/lib/libpuffs/requests.c:1.23 src/lib/libpuffs/requests.c:1.24
--- src/lib/libpuffs/requests.c:1.23	Tue Jan 29 14:54:08 2008
+++ src/lib/libpuffs/requests.c	Wed Jan 23 20:22:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: requests.c,v 1.23 2008/01/29 14:54:08 pooka Exp $	*/
+/*	$NetBSD: requests.c,v 1.24 2013/01/23 20:22:34 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
 
 #include sys/cdefs.h
 #if !defined(lint)
-__RCSID($NetBSD: requests.c,v 1.23 2008/01/29 14:54:08 pooka Exp $);
+__RCSID($NetBSD: requests.c,v 1.24 2013/01/23 20:22:34 riastradh Exp $);
 #endif /* !lint */
 
 #include sys/types.h
@@ -209,7 +209,7 @@ puffs__fsframe_cmp(struct puffs_usermoun
 	winlen = sizeof(struct puffs_req);
 	rv = puffs_framebuf_getwindow(pb1, 0, (void *)preq1, winlen);
 	assert(rv == 0); /* frames are always at least puffs_req in size */
-	assert(winlen = sizeof(struct puffs_req));
+	assert(winlen == sizeof(struct puffs_req));
 
 	/*
 	 * Check if this is not a response in this slot.  That's the
@@ -224,7 +224,7 @@ puffs__fsframe_cmp(struct puffs_usermoun
 	winlen = sizeof(struct puffs_req);
 	rv = puffs_framebuf_getwindow(pb2, 0, (void *)preq2, winlen);
 	assert(rv == 0); /* frames are always at least puffs_req in size */
-	assert(winlen = sizeof(struct puffs_req));
+	assert(winlen == sizeof(struct puffs_req));
 
 	/* then compare: resid equal? */
 	return preq1-preq_id != preq2-preq_id;



CVS commit: src/usr.bin/cap_mkdb

2013-01-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jan 23 20:27:01 UTC 2013

Modified Files:
src/usr.bin/cap_mkdb: cap_mkdb.c

Log Message:
Move assignment out of assertion in cap_mkdb.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/cap_mkdb/cap_mkdb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/cap_mkdb/cap_mkdb.c
diff -u src/usr.bin/cap_mkdb/cap_mkdb.c:1.27 src/usr.bin/cap_mkdb/cap_mkdb.c:1.28
--- src/usr.bin/cap_mkdb/cap_mkdb.c:1.27	Mon Aug 29 13:56:17 2011
+++ src/usr.bin/cap_mkdb/cap_mkdb.c	Wed Jan 23 20:27:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cap_mkdb.c,v 1.27 2011/08/29 13:56:17 joerg Exp $	*/
+/*	$NetBSD: cap_mkdb.c,v 1.28 2013/01/23 20:27:01 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1992, 19
 #if 0
 static char sccsid[] = @(#)cap_mkdb.c	8.2 (Berkeley) 4/27/95;
 #endif
-__RCSID($NetBSD: cap_mkdb.c,v 1.27 2011/08/29 13:56:17 joerg Exp $);
+__RCSID($NetBSD: cap_mkdb.c,v 1.28 2013/01/23 20:27:01 riastradh Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -141,7 +141,8 @@ main(int argc, char *argv[])
 
 	if (capdbp-close(capdbp)  0)
 		err(1, %s, capname);
-	assert((p = strrchr(buf, '.')) != NULL);
+	p = strrchr(buf, '.');
+	assert(p != NULL);
 	*p = '\0';
 	if (rename(capname, buf) == -1)
 		err(1, rename);



CVS commit: src/sys/lib/libkern/arch/arm

2013-01-23 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jan 23 20:38:28 UTC 2013

Modified Files:
src/sys/lib/libkern/arch/arm: Makefile.inc

Log Message:
pull in strnlen.S


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/lib/libkern/arch/arm/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/arch/arm/Makefile.inc
diff -u src/sys/lib/libkern/arch/arm/Makefile.inc:1.12 src/sys/lib/libkern/arch/arm/Makefile.inc:1.13
--- src/sys/lib/libkern/arch/arm/Makefile.inc:1.12	Tue Oct 30 16:36:03 2012
+++ src/sys/lib/libkern/arch/arm/Makefile.inc	Wed Jan 23 20:38:27 2013
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.12 2012/10/30 16:36:03 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2013/01/23 20:38:27 macallan Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S
 SRCS+=	ffs.S
 SRCS+=	divsi3.S udivsi3.S divide.S clzsi2.S modsi3.S umodsi3.S
-SRCS+=	memcmp.S memcpy.S memset.S memmove.S strcmp.S strncmp.S
+SRCS+=	memcmp.S memcpy.S memset.S memmove.S strcmp.S strncmp.S strnlen.S
 
 .if ${MACHINE_ARCH} == earm || ${MACHINE_ARCH} == earmeb
 SRCS+=	__aeabi_ldivmod.S __aeabi_uldivmod.S __aeabi_lcmp.c __aeabi_ulcmp.c



CVS commit: src/usr.bin/fsplit

2013-01-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jan 23 20:39:46 UTC 2013

Modified Files:
src/usr.bin/fsplit: fsplit.c

Log Message:
Assert equality, not assignment, in fsplit, and say who guarantees it.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/fsplit/fsplit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/fsplit/fsplit.c
diff -u src/usr.bin/fsplit/fsplit.c:1.28 src/usr.bin/fsplit/fsplit.c:1.29
--- src/usr.bin/fsplit/fsplit.c:1.28	Fri Sep 16 15:39:26 2011
+++ src/usr.bin/fsplit/fsplit.c	Wed Jan 23 20:39:46 2013
@@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = from: @(#)fsplit.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: fsplit.c,v 1.28 2011/09/16 15:39:26 joerg Exp $);
+__RCSID($NetBSD: fsplit.c,v 1.29 2013/01/23 20:39:46 riastradh Exp $);
 #endif
 #endif /* not lint */
 
@@ -235,9 +235,10 @@ saveit(const char *name)
 	}
 	strlcpy(fname, name, sizeof(fname));
 	fnamelen = strlen(fname);
+/* Guaranteed by scan_name.  */
 	assert(fnamelen  2);
-	assert(fname[fnamelen-2] = '.');
-	assert(fname[fnamelen-1] = 'f');
+	assert(fname[fnamelen-2] == '.');
+	assert(fname[fnamelen-1] == 'f');
 	fname[fnamelen-2] = '\0';
 
 	for (i = 0; i  numextonly; i++) {



CVS commit: src/usr.sbin/makefs

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 20:46:40 UTC 2013

Modified Files:
src/usr.sbin/makefs: Makefile cd9660.c chfs.c ffs.c makefs.c makefs.h
v7fs.c
Added Files:
src/usr.sbin/makefs: msdos.c
src/usr.sbin/makefs/msdos: Makefile.inc

Log Message:
- add support for parsing different types; not just int.
- add beginning of msdos support.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/makefs/Makefile
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/makefs/cd9660.c \
src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/chfs.c \
src/usr.sbin/makefs/v7fs.c
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/makefs/makefs.h
cvs rdiff -u -r0 -r1.1 src/usr.sbin/makefs/msdos.c
cvs rdiff -u -r0 -r1.1 src/usr.sbin/makefs/msdos/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/Makefile
diff -u src/usr.sbin/makefs/Makefile:1.31 src/usr.sbin/makefs/Makefile:1.32
--- src/usr.sbin/makefs/Makefile:1.31	Thu Apr 19 13:28:25 2012
+++ src/usr.sbin/makefs/Makefile	Wed Jan 23 15:46:39 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.31 2012/04/19 17:28:25 christos Exp $
+#	$NetBSD: Makefile,v 1.32 2013/01/23 20:46:39 christos Exp $
 #
 
 WARNS?=	5
@@ -6,7 +6,7 @@ WARNS?=	5
 .include bsd.own.mk
 
 PROG=	makefs
-SRCS=	cd9660.c chfs.c ffs.c v7fs.c \
+SRCS=	cd9660.c chfs.c ffs.c v7fs.c msdos.c \
 	getid.c \
 	makefs.c misc.c \
 	pack_dev.c \
@@ -24,6 +24,7 @@ CPPFLAGS+=	-I${.CURDIR} -I${MKNODSRC} -I
 .include ${.CURDIR}/chfs/Makefile.inc
 .include ${.CURDIR}/ffs/Makefile.inc
 .include ${.CURDIR}/v7fs/Makefile.inc
+.include ${.CURDIR}/msdos/Makefile.inc
 
 .if !defined(HOSTPROG)
 DPADD+= ${LIBUTIL}

Index: src/usr.sbin/makefs/cd9660.c
diff -u src/usr.sbin/makefs/cd9660.c:1.35 src/usr.sbin/makefs/cd9660.c:1.36
--- src/usr.sbin/makefs/cd9660.c:1.35	Fri Jan 27 21:35:46 2012
+++ src/usr.sbin/makefs/cd9660.c	Wed Jan 23 15:46:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660.c,v 1.35 2012/01/28 02:35:46 christos Exp $	*/
+/*	$NetBSD: cd9660.c,v 1.36 2013/01/23 20:46:39 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -103,7 +103,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: cd9660.c,v 1.35 2012/01/28 02:35:46 christos Exp $);
+__RCSID($NetBSD: cd9660.c,v 1.36 2013/01/23 20:46:39 christos Exp $);
 #endif  /* !__lint */
 
 #include string.h
@@ -304,29 +304,20 @@ cd9660_parse_opts(const char *option, fs
 	int	rv;
 	/* Set up allowed options - integer options ONLY */
 	option_t cd9660_options[] = {
-		{ l, diskStructure.isoLevel, 1, 3, ISO Level },
-		{ isolevel, diskStructure.isoLevel, 1, 3, ISO Level },
-		{ verbose,  diskStructure.verbose_level, 0, 2,
-		  Turns on verbose output },
-		{ v, diskStructure.verbose_level, 0 , 2,
-		  Turns on verbose output},
+		{ 'l', isolevel, diskStructure.isoLevel,
+		  OPT_INT32, 1, 3, ISO Level },
+		{ 'v', verbose,  diskStructure.verbose_level,
+		  OPT_INT32, 0, 2, Turns on verbose output },
+		{ 'L', Label, diskStructure.primaryDescriptor.volume_id, 
+		  OPT_STRARRAY, 1,
+		  sizeof(diskStructure.primaryDescriptor.volume_id),
+		  Disk Label },
 		{ .name = NULL }
 	};
 
 	if (cd9660_defaults_set == 0)
 		cd9660_set_defaults();
 
-	/*
-	 * Todo : finish implementing this, and make a function that
-	 * parses them
-	 */
-	/*
-	string_option_t cd9660_string_options[] = {
-		{ L, Label, diskStructure.primaryDescriptor.volume_id, 1, 32, Disk Label, ISO_STRING_FILTER_DCHARS },
-		{ NULL }
-	}
-	*/
-
 	assert(option != NULL);
 
 	if (debug  DEBUG_FS_PARSE_OPTS)
Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.35 src/usr.sbin/makefs/makefs.c:1.36
--- src/usr.sbin/makefs/makefs.c:1.35	Fri Jun 22 02:15:18 2012
+++ src/usr.sbin/makefs/makefs.c	Wed Jan 23 15:46:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.35 2012/06/22 06:15:18 sjg Exp $	*/
+/*	$NetBSD: makefs.c,v 1.36 2013/01/23 20:46:39 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: makefs.c,v 1.35 2012/06/22 06:15:18 sjg Exp $);
+__RCSID($NetBSD: makefs.c,v 1.36 2013/01/23 20:46:39 christos Exp $);
 #endif	/* !__lint */
 
 #include assert.h
@@ -52,6 +52,7 @@ __RCSID($NetBSD: makefs.c,v 1.35 2012/0
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include stdbool.h
 
 #include makefs.h
 #include mtree.h
@@ -70,13 +71,15 @@ typedef struct {
 } fstype_t;
 
 static fstype_t fstypes[] = {
-	{ ffs, ffs_prep_opts,	ffs_parse_opts,	ffs_cleanup_opts, ffs_makefs },
-	{ cd9660, cd9660_prep_opts, cd9660_parse_opts, cd9660_cleanup_opts,
-	  cd9660_makefs},
-	{ chfs, chfs_prep_opts, chfs_parse_opts, chfs_cleanup_opts,
-	  chfs_makefs },
-	{ v7fs, 

CVS commit: src/usr.sbin/makefs

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 21:03:16 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: Makefile.inc
src/usr.sbin/makefs/v7fs: Makefile.inc

Log Message:
don't reuse the same variables


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/makefs/msdos/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/v7fs/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/msdos/Makefile.inc
diff -u src/usr.sbin/makefs/msdos/Makefile.inc:1.1 src/usr.sbin/makefs/msdos/Makefile.inc:1.2
--- src/usr.sbin/makefs/msdos/Makefile.inc:1.1	Wed Jan 23 15:46:39 2013
+++ src/usr.sbin/makefs/msdos/Makefile.inc	Wed Jan 23 16:03:15 2013
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.1 2013/01/23 20:46:39 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2013/01/23 21:03:15 christos Exp $
 #
 
 MSDOS=	${NETBSDSRCDIR}/sys/fs/msdosfs
-NEWFS=	${NETBSDSRCDIR}/sbin/newfs_msdos
+MSDOS_NEWFS=	${NETBSDSRCDIR}/sbin/newfs_msdos
 
-.PATH:	${.CURDIR}/v7fs ${MSDOS} ${NEWFS}
+.PATH:	${.CURDIR}/v7fs ${MSDOS} ${MSDOS_NEWFS}
 
-CPPFLAGS+= -DMSDOS_EI -I${MSDOS} -I${NEWFS}
+CPPFLAGS+= -DMSDOS_EI -I${MSDOS} -I${MSDOS_NEWFS}

Index: src/usr.sbin/makefs/v7fs/Makefile.inc
diff -u src/usr.sbin/makefs/v7fs/Makefile.inc:1.4 src/usr.sbin/makefs/v7fs/Makefile.inc:1.5
--- src/usr.sbin/makefs/v7fs/Makefile.inc:1.4	Tue Jul 19 14:29:41 2011
+++ src/usr.sbin/makefs/v7fs/Makefile.inc	Wed Jan 23 16:03:15 2013
@@ -1,13 +1,13 @@
-#	$NetBSD: Makefile.inc,v 1.4 2011/07/19 18:29:41 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2013/01/23 21:03:15 christos Exp $
 #
 
 V7FS=	${NETBSDSRCDIR}/sys/fs/v7fs
-NEWFS=	${NETBSDSRCDIR}/sbin/newfs_v7fs
+V7FS_NEWFS=	${NETBSDSRCDIR}/sbin/newfs_v7fs
 FSCK=	${NETBSDSRCDIR}/sbin/fsck	# use progress meter.
 
-.PATH:	${.CURDIR}/v7fs ${V7FS} ${NEWFS} ${FSCK}
+.PATH:	${.CURDIR}/v7fs ${V7FS} ${V7FS_NEWFS} ${FSCK}
 
-CPPFLAGS+= -DV7FS_EI -I${V7FS} -I${NEWFS} -I${FSCK}
+CPPFLAGS+= -DV7FS_EI -I${V7FS} -I${V7FS_NEWFS} -I${FSCK}
 
 SRCS += v7fs_endian.c v7fs_superblock.c v7fs_superblock_util.c v7fs_inode.c \
 v7fs_inode_util.c v7fs_datablock.c v7fs_dirent.c v7fs_io.c v7fs_file.c \
@@ -17,4 +17,4 @@ SRCS += main.c		# newfs
 SRCS += progress.c	# progress bar (fsck)
 .endif
 
-SRCS += v7fs_estimate.c v7fs_populate.c
\ No newline at end of file
+SRCS += v7fs_estimate.c v7fs_populate.c



CVS commit: src/sys/arch/sparc64/sparc64

2013-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 23 21:03:25 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s mp_subr.S

Log Message:
Fix sparc64_ipi_ccall by adding proper trap setup.
Fixes xcall(9) problems, as exposed by pserialize(9). Noticed by
J. Hannken-Illjes, cause pointed out by Takeshi Nakayama.


To generate a diff of this commit:
cvs rdiff -u -r1.346 -r1.347 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/sparc64/mp_subr.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.346 src/sys/arch/sparc64/sparc64/locore.s:1.347
--- src/sys/arch/sparc64/sparc64/locore.s:1.346	Wed Jan 23 12:19:02 2013
+++ src/sys/arch/sparc64/sparc64/locore.s	Wed Jan 23 21:03:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.346 2013/01/23 12:19:02 martin Exp $	*/
+/*	$NetBSD: locore.s,v 1.347 2013/01/23 21:03:25 martin Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -6283,6 +6283,67 @@ ENTRY(OF_val2sym32)
 #endif /* _LP64 */
 #endif /* DDB */
 
+
+#if defined(MULTIPROCESSOR)
+/*
+ * IPI target function to setup a C compatible environment and call a MI function.
+ *
+ * On entry:
+ *	We are on one of the alternate set of globals
+ *	%g2 = function to call
+ *	%g3 = single argument to called function
+ */
+ENTRY(sparc64_ipi_ccall)
+#ifdef TRAPS_USE_IG
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! DEBUG
+#endif
+	TRAP_SETUP(-CC64FSZ-TF_SIZE)
+
+#ifdef DEBUG
+	rdpr	%tt, %o1	! debug
+	sth	%o1, [%sp + CC64FSZ + STKB + TF_TT]! debug
+#endif
+	mov	%g3, %o0			! save argument of function to call
+	mov	%g2, %o5			! save function pointer
+
+	wrpr	%g0, PSTATE_KERN, %pstate	! Get back to normal globals
+	stx	%g1, [%sp + CC64FSZ + STKB + TF_G + ( 1*8)]
+	mov	%g1, %o1			! code
+	rdpr	%tpc, %o2			! (pc)
+	stx	%g2, [%sp + CC64FSZ + STKB + TF_G + ( 2*8)]
+	rdpr	%tstate, %g1
+	stx	%g3, [%sp + CC64FSZ + STKB + TF_G + ( 3*8)]
+	rdpr	%tnpc, %o3
+	stx	%g4, [%sp + CC64FSZ + STKB + TF_G + ( 4*8)]
+	rd	%y, %o4
+	stx	%g5, [%sp + CC64FSZ + STKB + TF_G + ( 5*8)]
+	stx	%g6, [%sp + CC64FSZ + STKB + TF_G + ( 6*8)]
+	wrpr	%g0, 0, %tl			! return to tl=0
+	stx	%g7, [%sp + CC64FSZ + STKB + TF_G + ( 7*8)]
+
+	stx	%g1, [%sp + CC64FSZ + STKB + TF_TSTATE]
+	stx	%o2, [%sp + CC64FSZ + STKB + TF_PC]
+	stx	%o3, [%sp + CC64FSZ + STKB + TF_NPC]
+	st	%o4, [%sp + CC64FSZ + STKB + TF_Y]
+
+	rdpr	%pil, %g5
+	stb	%g5, [%sp + CC64FSZ + STKB + TF_PIL]
+	stb	%g5, [%sp + CC64FSZ + STKB + TF_OLDPIL]
+
+	!! In the EMBEDANY memory model %g4 points to the start of the data segment.
+	!! In our case we need to clear it before calling any C-code
+	clr	%g4
+	wr	%g0, ASI_NUCLEUS, %asi			! default kernel ASI
+
+	call %o5	! call function
+	 nop
+
+	ba,a	return_from_trap			! and return from IPI
+	 nop
+
+#endif
+
+
 	.data
 	_ALIGN
 #if NKSYMS || defined(DDB) || defined(LKM)

Index: src/sys/arch/sparc64/sparc64/mp_subr.S
diff -u src/sys/arch/sparc64/sparc64/mp_subr.S:1.3 src/sys/arch/sparc64/sparc64/mp_subr.S:1.4
--- src/sys/arch/sparc64/sparc64/mp_subr.S:1.3	Tue Jul 12 07:51:34 2011
+++ src/sys/arch/sparc64/sparc64/mp_subr.S	Wed Jan 23 21:03:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mp_subr.S,v 1.3 2011/07/12 07:51:34 mrg Exp $	*/
+/*	$NetBSD: mp_subr.S,v 1.4 2013/01/23 21:03:25 martin Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -410,22 +410,4 @@ ENTRY(sparc64_ipi_dcache_flush_page_us)
 	ba,a	ret_from_intr_vector
 	 nop
 
-/*
- * Setup a C compatible environment and call a MI function.
- *
- * On entry:
- *	%g2 = function to call
- *	%g3 = single argument to called function
- */
-ENTRY(sparc64_ipi_ccall)
-	save %sp, -CC64FSZ-16, %sp			! create a stack frame
-	stx %g2, [%fp + BIAS -16 + 0]			! save function pointer
-	stx %g3, [%fp + BIAS -16 + 8]			! and argument
-	wrpr%g0, PSTATE_KERN, %pstate		! switch globals
-	ldx [%fp + BIAS -16 + 0], %l0			! reload function
-	call %l0	! call function
-	 ldx [%fp + BIAS -16 + 8], %o0			! reload argument 
-	restore		! pop stack frame
-	ba,a	ret_from_intr_vector			! and return from IPI
-	 nop
 #endif



CVS commit: src/usr.sbin/makefs

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 21:32:32 UTC 2013

Modified Files:
src/usr.sbin/makefs: cd9660.c chfs.c ffs.c makefs.c makefs.h msdos.c
v7fs.c

Log Message:
remove duplicated code, and try to cleanup parsing by using the shared code.
cd9660 needs a lot of work.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/makefs/cd9660.c \
src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/chfs.c \
src/usr.sbin/makefs/v7fs.c
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/makefs/makefs.h
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/makefs/msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/cd9660.c
diff -u src/usr.sbin/makefs/cd9660.c:1.36 src/usr.sbin/makefs/cd9660.c:1.37
--- src/usr.sbin/makefs/cd9660.c:1.36	Wed Jan 23 15:46:39 2013
+++ src/usr.sbin/makefs/cd9660.c	Wed Jan 23 16:32:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660.c,v 1.36 2013/01/23 20:46:39 christos Exp $	*/
+/*	$NetBSD: cd9660.c,v 1.37 2013/01/23 21:32:32 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -103,7 +103,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: cd9660.c,v 1.36 2013/01/23 20:46:39 christos Exp $);
+__RCSID($NetBSD: cd9660.c,v 1.37 2013/01/23 21:32:32 christos Exp $);
 #endif  /* !__lint */
 
 #include string.h
@@ -424,7 +424,7 @@ cd9660_parse_opts(const char *option, fs
 			warnx(Option `%s' doesn't contain a value, var);
 			rv = 0;
 		} else
-			rv = set_option(cd9660_options, var, val);
+			rv = set_option_var(cd9660_options, var, val);
 	}
 
 	if (var)
Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.36 src/usr.sbin/makefs/makefs.c:1.37
--- src/usr.sbin/makefs/makefs.c:1.36	Wed Jan 23 15:46:39 2013
+++ src/usr.sbin/makefs/makefs.c	Wed Jan 23 16:32:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.36 2013/01/23 20:46:39 christos Exp $	*/
+/*	$NetBSD: makefs.c,v 1.37 2013/01/23 21:32:32 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: makefs.c,v 1.36 2013/01/23 20:46:39 christos Exp $);
+__RCSID($NetBSD: makefs.c,v 1.37 2013/01/23 21:32:32 christos Exp $);
 #endif	/* !__lint */
 
 #include assert.h
@@ -300,9 +300,33 @@ main(int argc, char *argv[])
 	/* NOTREACHED */
 }
 
+int
+set_option(const option_t *options, const char *option)
+{
+	char *var, *val;
+	int retval;
+
+	assert(option != NULL);
+
+	if ((var = strdup(option)) == NULL) {
+		err(EXIT_FAILURE, Allocating memory for copy of option string);
+	}
+	retval = 0;
+	if ((val = strchr(var, '=')) == NULL) {
+		warnx(Option `%s' doesn't contain a value, var);
+		goto out;
+	}
+	*val++ = '\0';
+
+	retval = set_option_var(options, var, val);
+	
+out:
+	free(var);
+	return retval;
+}
 
 int
-set_option(const option_t *options, const char *var, const char *val)
+set_option_var(const option_t *options, const char *var, const char *val)
 {
 	char *s;
 	size_t i;

Index: src/usr.sbin/makefs/chfs.c
diff -u src/usr.sbin/makefs/chfs.c:1.4 src/usr.sbin/makefs/chfs.c:1.5
--- src/usr.sbin/makefs/chfs.c:1.4	Wed Jan 23 15:46:39 2013
+++ src/usr.sbin/makefs/chfs.c	Wed Jan 23 16:32:32 2013
@@ -83,28 +83,10 @@ chfs_parse_opts(const char *option, fsin
 		{ .name = NULL }
 	};
 
-	char *var, *val;
-	int retval;
-
 	assert(option != NULL);
 	assert(fsopts != NULL);
 
-	if ((var = strdup(option)) == NULL) {
-		err(EXIT_FAILURE, Allocating memory for copy of option string);
-	}
-	retval = 0;
-
-	if ((val = strchr(var, '=')) == NULL) {
-		warnx(Option `%s' doesn't contain a value, var);
-		goto leave_chfs_parse_opts;
-	}
-	*val++ = '\0';
-
-	retval = set_option(chfs_options, var, val);
-	
-leave_chfs_parse_opts:
-	free(var);
-	return retval;
+	return set_option(chfs_options, option);
 }
 
 void
Index: src/usr.sbin/makefs/v7fs.c
diff -u src/usr.sbin/makefs/v7fs.c:1.4 src/usr.sbin/makefs/v7fs.c:1.5
--- src/usr.sbin/makefs/v7fs.c:1.4	Wed Jan 23 15:46:39 2013
+++ src/usr.sbin/makefs/v7fs.c	Wed Jan 23 16:32:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: v7fs.c,v 1.4 2013/01/23 20:46:39 christos Exp $	*/
+/*	$NetBSD: v7fs.c,v 1.5 2013/01/23 21:32:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: v7fs.c,v 1.4 2013/01/23 20:46:39 christos Exp $);
+__RCSID($NetBSD: v7fs.c,v 1.5 2013/01/23 21:32:32 christos Exp $);
 #endif	/* !__lint */
 
 #include stdio.h
@@ -82,7 +82,7 @@ v7fs_parse_opts(const char *option, fsin
 		{ .name = NULL }
 	};
 
-	set_option(v7fs_options, option, 1);
+	set_option_var(v7fs_options, option, 1);
 
 	return 1;
 }

Index: src/usr.sbin/makefs/ffs.c
diff -u 

CVS commit: src/usr.sbin/makefs

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 21:42:23 UTC 2013

Modified Files:
src/usr.sbin/makefs: ffs.c makefs.c msdos.c

Log Message:
return the bit of the option set, so that others can act on it.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.51 src/usr.sbin/makefs/ffs.c:1.52
--- src/usr.sbin/makefs/ffs.c:1.51	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/ffs.c	Wed Jan 23 16:42:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.51 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: ffs.c,v 1.52 2013/01/23 21:42:22 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: ffs.c,v 1.51 2013/01/23 21:32:32 christos Exp $);
+__RCSID($NetBSD: ffs.c,v 1.52 2013/01/23 21:42:22 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -232,6 +232,9 @@ ffs_parse_opts(const char *option, fsinf
 	for (i = 0; ffs_options[i].name  (1  i) != rv; i++)
 		continue;
 
+	if (ffs_options[i].name == NULL)
+		abort();
+
 	if (strcmp(ffs_options[i].name, optimization) == 0) {
 		if (strcmp(optimization, time) == 0) {
 			ffs_opts-optimization = FS_OPTTIME;

Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.37 src/usr.sbin/makefs/makefs.c:1.38
--- src/usr.sbin/makefs/makefs.c:1.37	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/makefs.c	Wed Jan 23 16:42:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.37 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: makefs.c,v 1.38 2013/01/23 21:42:22 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: makefs.c,v 1.37 2013/01/23 21:32:32 christos Exp $);
+__RCSID($NetBSD: makefs.c,v 1.38 2013/01/23 21:42:22 christos Exp $);
 #endif	/* !__lint */
 
 #include assert.h
@@ -367,7 +367,7 @@ set_option_var(const option_t *options, 
 			val);
 			return 0;
 		}
-		return 1;
+		return 1  i;
 	}
 	warnx(Unknown option `%s', var);
 	return (0);

Index: src/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.2 src/usr.sbin/makefs/msdos.c:1.3
--- src/usr.sbin/makefs/msdos.c:1.2	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/msdos.c	Wed Jan 23 16:42:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.2 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.3 2013/01/23 21:42:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: msdos.c,v 1.2 2013/01/23 21:32:32 christos Exp $);
+__RCSID($NetBSD: msdos.c,v 1.3 2013/01/23 21:42:22 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -101,6 +101,7 @@ ALLOPTS
 #undef AOPT	
 		{ .name = NULL }
 	};
+	int i, rv;
 
 	assert(option != NULL);
 	assert(fsopts != NULL);
@@ -109,7 +110,22 @@ ALLOPTS
 	if (debug  DEBUG_FS_PARSE_OPTS)
 		printf(msdos_parse_opts: got `%s'\n, option);
 
-	return set_option(msdos_options, option);
+	rv = set_option(msdos_options, option);
+	if (rv == 0)
+		return rv;
+
+	for (i = 0; msdos_options[i].name != NULL  (1  i) != rv; i++)
+		break;
+	if (msdos_options[i].name == NULL)
+		abort();
+
+	if (strcmp(msdos_options[i].name, volume_id) == 0)
+		msdos_opt-volume_id_set = 1;
+	else if (strcmp(msdos_options[i].name, media_descriptor) == 0)
+		msdos_opt-media_descriptor_set = 1;
+	else if (strcmp(msdos_options[i].name, hidden_sectors) == 0)
+		msdos_opt-hidden_sectors_set = 1;
+	return rv;
 }
 
 



CVS commit: src/distrib/utils/embedded/conf

2013-01-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan 23 21:59:37 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Size for 512 byte sectors and base ffs partition size on totalsize minus
others.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/evbarm.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.2 src/distrib/utils/embedded/conf/evbarm.conf:1.3
--- src/distrib/utils/embedded/conf/evbarm.conf:1.2	Mon Jan 21 16:59:23 2013
+++ src/distrib/utils/embedded/conf/evbarm.conf	Wed Jan 23 21:59:37 2013
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.2 2013/01/21 16:59:23 skrll Exp $
+# $NetBSD: evbarm.conf,v 1.3 2013/01/23 21:59:37 skrll Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -19,15 +19,16 @@ tmp=/tmp/${board}.disklabel.$$
 
 make_filesystems_evbarm() {
 
-	local asize=$(( ${newsize} * 1024 ))
+	local totalsize=$(( ${newsize} * 1024 * 2 ))
 	local swapsize=$(( ${swap} * 1024 ))
 	local bootsize=$(( ${boot} * 1024 ))
 
-	local bootoffset=$((${init} * 1024 ))
+	local bootoffset=$(( ${init} * 1024 ))
 	local swapoffset=$(( ${bootoffset} + ${bootsize} ))
+
+	local asize=$(( ${totalsize} - ${swapsize} - ${bootsize} - ${bootoffset} ))
 	local aoffset=$(( ${swapoffset} + ${swapsize} ))
 
-	local totalsize=$(( ${asize} + ${swapsize} + ${bootsize} + ${bootoffset} ))
 	local bps=512
 	local spt=32
 	local tpc=64



CVS commit: src/distrib/utils/embedded/conf

2013-01-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan 23 22:20:06 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
cmdline needs to be a line! hi jak.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/utils/embedded/conf/rpi.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.11 src/distrib/utils/embedded/conf/rpi.conf:1.12
--- src/distrib/utils/embedded/conf/rpi.conf:1.11	Mon Jan 21 17:14:23 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Wed Jan 23 22:20:06 2013
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.11 2013/01/21 17:14:23 jakllsch Exp $
+# $NetBSD: rpi.conf,v 1.12 2013/01/23 22:20:06 skrll Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -26,8 +26,7 @@ wscons=YES
 EOF
 
 	${sudo} cat  ${mnt}/boot/cmdline.txt  EOF
-root=ld0a
-console=fb
+root=ld0a console=fb
 #fb=1280x1024		# to select a mode, otherwise try EDID 
 #fb=disable		# to disable fb completely
 EOF



CVS commit: src/sys/lib/libkern

2013-01-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 23 22:34:37 UTC 2013

Modified Files:
src/sys/lib/libkern: Makefile.libkern
src/sys/lib/libkern/arch/arm: Makefile.inc

Log Message:
Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/lib/libkern/Makefile.libkern
cvs rdiff -u -r1.13 -r1.14 src/sys/lib/libkern/arch/arm/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/Makefile.libkern
diff -u src/sys/lib/libkern/Makefile.libkern:1.18 src/sys/lib/libkern/Makefile.libkern:1.19
--- src/sys/lib/libkern/Makefile.libkern:1.18	Thu Aug 30 12:16:49 2012
+++ src/sys/lib/libkern/Makefile.libkern	Wed Jan 23 22:34:37 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libkern,v 1.18 2012/08/30 12:16:49 drochner Exp $
+#	$NetBSD: Makefile.libkern,v 1.19 2013/01/23 22:34:37 matt Exp $
 
 # 
 # Variable definitions for libkern.  
@@ -84,7 +84,7 @@ SRCS+=	random.c
 SRCS+=	rngtest.c
 
 SRCS+=	memchr.c
-SRCS+=	strcat.c strcmp.c strcpy.c strlen.c
+SRCS+=	strcat.c strcmp.c strcpy.c strlen.c strnlen.c
 SRCS+=	strncmp.c strncpy.c
 SRCS+=	strcasecmp.c strncasecmp.c
 

Index: src/sys/lib/libkern/arch/arm/Makefile.inc
diff -u src/sys/lib/libkern/arch/arm/Makefile.inc:1.13 src/sys/lib/libkern/arch/arm/Makefile.inc:1.14
--- src/sys/lib/libkern/arch/arm/Makefile.inc:1.13	Wed Jan 23 20:38:27 2013
+++ src/sys/lib/libkern/arch/arm/Makefile.inc	Wed Jan 23 22:34:37 2013
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.13 2013/01/23 20:38:27 macallan Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2013/01/23 22:34:37 matt Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S
 SRCS+=	ffs.S
 SRCS+=	divsi3.S udivsi3.S divide.S clzsi2.S modsi3.S umodsi3.S
-SRCS+=	memcmp.S memcpy.S memset.S memmove.S strcmp.S strncmp.S strnlen.S
+SRCS+=	memcmp.S memcpy.S memset.S memmove.S strcmp.S strncmp.S
 
 .if ${MACHINE_ARCH} == earm || ${MACHINE_ARCH} == earmeb
 SRCS+=	__aeabi_ldivmod.S __aeabi_uldivmod.S __aeabi_lcmp.c __aeabi_ulcmp.c



CVS commit: src/usr.sbin/makefs

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 22:47:18 UTC 2013

Modified Files:
src/usr.sbin/makefs: Makefile msdos.c
src/usr.sbin/makefs/msdos: Makefile.inc

Log Message:
ok, we can create the filesystem now.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/makefs/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/msdos.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/msdos/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/Makefile
diff -u src/usr.sbin/makefs/Makefile:1.32 src/usr.sbin/makefs/Makefile:1.33
--- src/usr.sbin/makefs/Makefile:1.32	Wed Jan 23 15:46:39 2013
+++ src/usr.sbin/makefs/Makefile	Wed Jan 23 17:47:18 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2013/01/23 20:46:39 christos Exp $
+#	$NetBSD: Makefile,v 1.33 2013/01/23 22:47:18 christos Exp $
 #
 
 WARNS?=	5
@@ -17,7 +17,7 @@ MAN=	makefs.8
 MKNODSRC=	${NETBSDSRCDIR}/sbin/mknod
 MTREESRC=	${NETBSDSRCDIR}/usr.sbin/mtree
 
-CPPFLAGS+=	-I${.CURDIR} -I${MKNODSRC} -I${MTREESRC}
+CPPFLAGS+=	-I${.CURDIR} -I${MKNODSRC} -I${MTREESRC} -DMAKEFS
 .PATH:		${MKNODSRC} ${MTREESRC}
 
 .include ${.CURDIR}/cd9660/Makefile.inc

Index: src/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.3 src/usr.sbin/makefs/msdos.c:1.4
--- src/usr.sbin/makefs/msdos.c:1.3	Wed Jan 23 16:42:22 2013
+++ src/usr.sbin/makefs/msdos.c	Wed Jan 23 17:47:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.3 2013/01/23 21:42:22 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.4 2013/01/23 22:47:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: msdos.c,v 1.3 2013/01/23 21:42:22 christos Exp $);
+__RCSID($NetBSD: msdos.c,v 1.4 2013/01/23 22:47:18 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -132,6 +132,16 @@ ALLOPTS
 void
 msdos_makefs(const char *image, const char *dir, fsnode *root, fsinfo_t *fsopts)
 {
+	struct msdos_options *msdos_opt = fsopts-fs_specific;
+
+	/*
+	 * XXX: pick up other options from the msdos specific ones?
+	 * Is minsize right here?
+	 */
+	msdos_opt-create_size = MAX(msdos_opt-create_size, fsopts-minsize);
+
+	if (mkfs_msdos(image, NULL, msdos_opt) == -1)
+		return;
 #ifdef notyet
 	struct fs	*superblock;
 	struct timeval	start;

Index: src/usr.sbin/makefs/msdos/Makefile.inc
diff -u src/usr.sbin/makefs/msdos/Makefile.inc:1.2 src/usr.sbin/makefs/msdos/Makefile.inc:1.3
--- src/usr.sbin/makefs/msdos/Makefile.inc:1.2	Wed Jan 23 16:03:15 2013
+++ src/usr.sbin/makefs/msdos/Makefile.inc	Wed Jan 23 17:47:18 2013
@@ -1,9 +1,11 @@
-#	$NetBSD: Makefile.inc,v 1.2 2013/01/23 21:03:15 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2013/01/23 22:47:18 christos Exp $
 #
 
 MSDOS=	${NETBSDSRCDIR}/sys/fs/msdosfs
 MSDOS_NEWFS=	${NETBSDSRCDIR}/sbin/newfs_msdos
 
-.PATH:	${.CURDIR}/v7fs ${MSDOS} ${MSDOS_NEWFS}
+.PATH:	${.CURDIR}/msdos ${MSDOS} ${MSDOS_NEWFS}
 
 CPPFLAGS+= -DMSDOS_EI -I${MSDOS} -I${MSDOS_NEWFS}
+
+SRCS+= mkfs_msdos.c



CVS commit: src/sbin/newfs_msdos

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 23 22:48:18 UTC 2013

Modified Files:
src/sbin/newfs_msdos: mkfs_msdos.c

Log Message:
We don't need getdiskinfo() for makefs() since we always deal with an image.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/newfs_msdos/mkfs_msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/newfs_msdos/mkfs_msdos.c
diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.2 src/sbin/newfs_msdos/mkfs_msdos.c:1.3
--- src/sbin/newfs_msdos/mkfs_msdos.c:1.2	Wed Jan 23 10:29:15 2013
+++ src/sbin/newfs_msdos/mkfs_msdos.c	Wed Jan 23 17:48:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.c,v 1.2 2013/01/23 15:29:15 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.c,v 1.3 2013/01/23 22:48:18 christos Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
 static const char rcsid[] =
   $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $;
 #else
-__RCSID($NetBSD: mkfs_msdos.c,v 1.2 2013/01/23 15:29:15 christos Exp $);
+__RCSID($NetBSD: mkfs_msdos.c,v 1.3 2013/01/23 22:48:18 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -804,12 +804,17 @@ getbpbinfo(int fd, const char *fname, co
 
 maxpartitions = getmaxpartitions();
 
+// XXX: Does not work with wedges
 if (s2  *s2 = 'a'  *s2 = 'a' + maxpartitions - 1) {
 	part = *s2++ - 'a';
 }
 if (((part != -1)  ((!iflag  part != -1) || !bpb-bsec)) ||
 	!bpb-bps || !bpb-spt || !bpb-hds) {
-	if (create || getdiskinfo(fname, fd, NULL, geo, dkw) == -1) {
+	if (create
+#ifndef MAKEFS
+	|| getdiskinfo(fname, fd, NULL, geo, dkw) == -1
+#endif
+	) {
 	struct stat st;
 
 	if (fstat(fd, st) == -1) {



CVS commit: src/sys/dev/pci/cxgb

2013-01-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Jan 23 23:31:27 UTC 2013

Modified Files:
src/sys/dev/pci/cxgb: cxgb_common.h cxgb_l2t.c cxgb_main.c cxgb_osdep.h

Log Message:
Make cxgb at least compilable. Fix _rt_key usage.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/cxgb/cxgb_common.h \
src/sys/dev/pci/cxgb/cxgb_l2t.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/cxgb/cxgb_main.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/cxgb/cxgb_osdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/cxgb/cxgb_common.h
diff -u src/sys/dev/pci/cxgb/cxgb_common.h:1.1 src/sys/dev/pci/cxgb/cxgb_common.h:1.2
--- src/sys/dev/pci/cxgb/cxgb_common.h:1.1	Sun Mar 21 21:11:13 2010
+++ src/sys/dev/pci/cxgb/cxgb_common.h	Wed Jan 23 23:31:26 2013
@@ -668,7 +668,7 @@ int t3_read_flash(adapter_t *adapter, un
 int t3_get_tp_version(adapter_t *adapter, u32 *vers);
 int t3_check_tpsram_version(adapter_t *adapter);
 int t3_check_tpsram(adapter_t *adapter, const u8 *tp_ram, unsigned int size);
-int t3_load_fw(adapter_t *adapter, const const u8 *fw_data, unsigned int size);
+int t3_load_fw(adapter_t *adapter, const u8 *fw_data, unsigned int size);
 int t3_get_fw_version(adapter_t *adapter, u32 *vers);
 int t3_check_fw_version(adapter_t *adapter);
 int t3_init_hw(adapter_t *adapter, u32 fw_params);
Index: src/sys/dev/pci/cxgb/cxgb_l2t.c
diff -u src/sys/dev/pci/cxgb/cxgb_l2t.c:1.1 src/sys/dev/pci/cxgb/cxgb_l2t.c:1.2
--- src/sys/dev/pci/cxgb/cxgb_l2t.c:1.1	Sun Mar 21 21:11:13 2010
+++ src/sys/dev/pci/cxgb/cxgb_l2t.c	Wed Jan 23 23:31:26 2013
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
 ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cxgb_l2t.c,v 1.1 2010/03/21 21:11:13 jklos Exp $);
+__KERNEL_RCSID(0, $NetBSD: cxgb_l2t.c,v 1.2 2013/01/23 23:31:26 joerg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -346,7 +346,7 @@ t3_l2t_get(struct toedev *dev, struct rt
 {
 struct l2t_entry *e;
 struct l2t_data *d = L2DATA(dev);
-u32 addr = *(u32 *)neigh-_rt_key;
+u32 addr = ((struct sockaddr_in *)rt_getkey(neigh))-sin_addr.s_addr;
 int ifidx = neigh-rt_ifp-if_index;
 int hash = arp_hash(addr, ifidx, d);
 
@@ -427,7 +427,7 @@ t3_l2t_update(struct toedev *dev, struct
 struct l2t_entry *e;
 struct mbuf *arpq = NULL;
 struct l2t_data *d = L2DATA(dev);
-u32 addr = *(u32 *)neigh-_rt_key;
+u32 addr = ((struct sockaddr_in *)rt_getkey(neigh))-sin_addr.s_addr;
 int ifidx = neigh-rt_ifp-if_index;
 int hash = arp_hash(addr, ifidx, d);
 struct llinfo_arp *la;

Index: src/sys/dev/pci/cxgb/cxgb_main.c
diff -u src/sys/dev/pci/cxgb/cxgb_main.c:1.3 src/sys/dev/pci/cxgb/cxgb_main.c:1.4
--- src/sys/dev/pci/cxgb/cxgb_main.c:1.3	Sat Oct 27 17:18:36 2012
+++ src/sys/dev/pci/cxgb/cxgb_main.c	Wed Jan 23 23:31:26 2013
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
 ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cxgb_main.c,v 1.3 2012/10/27 17:18:36 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: cxgb_main.c,v 1.4 2013/01/23 23:31:26 joerg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1123,7 +1123,7 @@ cxgb_up(struct adapter *sc)
 err = EINVAL;
 goto out;
 }
-device_printf(sc-dev, allocated intr_handle=%p\n, sc-intr_handle);
+device_printf(sc-dev, allocated intr_handle=%d\n, sc-intr_handle);
 sc-intr_cookie = pci_intr_establish(sc-pa.pa_pc,
 sc-intr_handle, IPL_NET,
 sc-cxgb_intr, sc);

Index: src/sys/dev/pci/cxgb/cxgb_osdep.h
diff -u src/sys/dev/pci/cxgb/cxgb_osdep.h:1.2 src/sys/dev/pci/cxgb/cxgb_osdep.h:1.3
--- src/sys/dev/pci/cxgb/cxgb_osdep.h:1.2	Wed May 18 01:01:59 2011
+++ src/sys/dev/pci/cxgb/cxgb_osdep.h	Wed Jan 23 23:31:27 2013
@@ -116,10 +116,6 @@ static inline void critical_exit(void)
 {
 }
 
-static inline void device_printf(device_t d, ...)
-{
-}
-
 int atomic_fetchadd_int(volatile int *p, int v);
 #if 0
 int atomic_add_int(volatile int *p, int v);
@@ -174,26 +170,6 @@ struct cxgb_attach_args
 
 #define INT3 __asm(int $3)
 
-static inline struct mbuf *
-m_defrag(struct mbuf *m0, int flags)
-{
-struct mbuf *m;
-MGETHDR(m, flags, MT_DATA);
-if (m == NULL)
-return NULL;
-
-M_COPY_PKTHDR(m, m0);
-MCLGET(m, flags);
-if ((m-m_flags  M_EXT) == 0) {
-m_free(m);
-return NULL;
-}
-m_copydata(m0, 0, m0-m_pkthdr.len, mtod(m, void *));
-m-m_len = m-m_pkthdr.len;
-return m;
-}
-
-
 typedef struct adapter adapter_t;
 struct sge_rspq;
 
@@ -215,8 +191,6 @@ struct t3_mbuf_hdr {
 #define if_name(ifp) (ifp)-if_xname
 #define M_SANITY(m, n)
 
-#define __read_mostly 

CVS commit: src/sys/dev/usb

2013-01-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 23 23:44:30 UTC 2013

Modified Files:
src/sys/dev/usb: usb_mem.c usb_mem.h


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/usb/usb_mem.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/usb/usb_mem.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usb_mem.c
diff -u src/sys/dev/usb/usb_mem.c:1.58 src/sys/dev/usb/usb_mem.c:1.59
--- src/sys/dev/usb/usb_mem.c:1.58	Sat Jan 19 20:49:33 2013
+++ src/sys/dev/usb/usb_mem.c	Wed Jan 23 23:44:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_mem.c,v 1.58 2013/01/19 20:49:33 christos Exp $	*/
+/*	$NetBSD: usb_mem.c,v 1.59 2013/01/23 23:44:30 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb_mem.c,v 1.58 2013/01/19 20:49:33 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb_mem.c,v 1.59 2013/01/23 23:44:30 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -178,6 +178,7 @@ usb_block_allocmem(bus_dma_tag_t tag, si
 		kmem_free(b, sizeof *b);
 		return USBD_NOMEM;
 	}
+	b-nsegs_alloc = b-nsegs;
 
 	error = bus_dmamem_alloc(tag, b-size, align, 0,
  b-segs, b-nsegs,
@@ -214,7 +215,7 @@ usb_block_allocmem(bus_dma_tag_t tag, si
  free1:
 	bus_dmamem_free(tag, b-segs, b-nsegs);
  free0:
-	kmem_free(b-segs, b-nsegs * sizeof(*b-segs));
+	kmem_free(b-segs, b-nsegs_alloc * sizeof(*b-segs));
 	kmem_free(b, sizeof *b);
 	return (USBD_NOMEM);
 }
@@ -233,7 +234,7 @@ usb_block_real_freemem(usb_dma_block_t *
 	bus_dmamap_destroy(b-tag, b-map);
 	bus_dmamem_unmap(b-tag, b-kaddr, b-size);
 	bus_dmamem_free(b-tag, b-segs, b-nsegs);
-	kmem_free(b-segs, b-nsegs * sizeof(*b-segs));
+	kmem_free(b-segs, b-nsegs_alloc * sizeof(*b-segs));
 	kmem_free(b, sizeof *b);
 }
 #endif

Index: src/sys/dev/usb/usb_mem.h
diff -u src/sys/dev/usb/usb_mem.h:1.29 src/sys/dev/usb/usb_mem.h:1.30
--- src/sys/dev/usb/usb_mem.h:1.29	Mon Jan  7 15:07:41 2013
+++ src/sys/dev/usb/usb_mem.h	Wed Jan 23 23:44:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_mem.h,v 1.29 2013/01/07 15:07:41 prlw1 Exp $	*/
+/*	$NetBSD: usb_mem.h,v 1.30 2013/01/23 23:44:30 jmcneill Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_mem.h,v 1.9 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -37,6 +37,7 @@ typedef struct usb_dma_block {
 void *kaddr;
 bus_dma_segment_t *segs;
 int nsegs;
+int nsegs_alloc;
 size_t size;
 size_t align;
 	int flags;



CVS commit: src/sbin/newfs_msdos

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 24 00:10:09 UTC 2013

Modified Files:
src/sbin/newfs_msdos: mkfs_msdos.c

Log Message:
don't do the partition dance for makefs; we have no real diskdon't do the 
partition dance for makefs; we have no real diskdon't do the partition dance 
for makefs; we have no real disk


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_msdos/mkfs_msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/newfs_msdos/mkfs_msdos.c
diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.3 src/sbin/newfs_msdos/mkfs_msdos.c:1.4
--- src/sbin/newfs_msdos/mkfs_msdos.c:1.3	Wed Jan 23 17:48:18 2013
+++ src/sbin/newfs_msdos/mkfs_msdos.c	Wed Jan 23 19:10:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.c,v 1.3 2013/01/23 22:48:18 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.c,v 1.4 2013/01/24 00:10:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
 static const char rcsid[] =
   $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $;
 #else
-__RCSID($NetBSD: mkfs_msdos.c,v 1.3 2013/01/23 22:48:18 christos Exp $);
+__RCSID($NetBSD: mkfs_msdos.c,v 1.4 2013/01/24 00:10:09 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -789,7 +789,6 @@ getbpbinfo(int fd, const char *fname, co
 struct dkwedge_info dkw;
 const char *s1, *s2;
 int part;
-int maxpartitions;
 
 part = -1;
 s1 = fname;
@@ -802,12 +801,14 @@ getbpbinfo(int fd, const char *fname, co
 	while (isdigit((unsigned char)*++s2));
 s1 = s2;
 
-maxpartitions = getmaxpartitions();
+#ifndef MAKEFS
+int maxpartitions = getmaxpartitions();
 
 // XXX: Does not work with wedges
 if (s2  *s2 = 'a'  *s2 = 'a' + maxpartitions - 1) {
 	part = *s2++ - 'a';
 }
+#endif
 if (((part != -1)  ((!iflag  part != -1) || !bpb-bsec)) ||
 	!bpb-bps || !bpb-spt || !bpb-hds) {
 	if (create



CVS commit: src/usr.sbin/makefs

2013-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 24 01:10:48 UTC 2013

Modified Files:
src/usr.sbin/makefs: cd9660.c chfs.c ffs.c makefs.c msdos.c v7fs.c

Log Message:
- Fix single letter option parsing.
- Instead of returning 1  index and 0 on error,
  return just index and -1 on error for the set_option*() routines.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makefs/cd9660.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/chfs.c \
src/usr.sbin/makefs/v7fs.c
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/cd9660.c
diff -u src/usr.sbin/makefs/cd9660.c:1.37 src/usr.sbin/makefs/cd9660.c:1.38
--- src/usr.sbin/makefs/cd9660.c:1.37	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/cd9660.c	Wed Jan 23 20:10:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660.c,v 1.37 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: cd9660.c,v 1.38 2013/01/24 01:10:47 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -103,7 +103,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: cd9660.c,v 1.37 2013/01/23 21:32:32 christos Exp $);
+__RCSID($NetBSD: cd9660.c,v 1.38 2013/01/24 01:10:47 christos Exp $);
 #endif  /* !__lint */
 
 #include string.h
@@ -424,7 +424,7 @@ cd9660_parse_opts(const char *option, fs
 			warnx(Option `%s' doesn't contain a value, var);
 			rv = 0;
 		} else
-			rv = set_option_var(cd9660_options, var, val);
+			rv = set_option_var(cd9660_options, var, val) != -1;
 	}
 
 	if (var)

Index: src/usr.sbin/makefs/chfs.c
diff -u src/usr.sbin/makefs/chfs.c:1.5 src/usr.sbin/makefs/chfs.c:1.6
--- src/usr.sbin/makefs/chfs.c:1.5	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/chfs.c	Wed Jan 23 20:10:47 2013
@@ -86,7 +86,7 @@ chfs_parse_opts(const char *option, fsin
 	assert(option != NULL);
 	assert(fsopts != NULL);
 
-	return set_option(chfs_options, option);
+	return set_option(chfs_options, option) != -1;
 }
 
 void
Index: src/usr.sbin/makefs/v7fs.c
diff -u src/usr.sbin/makefs/v7fs.c:1.5 src/usr.sbin/makefs/v7fs.c:1.6
--- src/usr.sbin/makefs/v7fs.c:1.5	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/v7fs.c	Wed Jan 23 20:10:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: v7fs.c,v 1.5 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: v7fs.c,v 1.6 2013/01/24 01:10:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: v7fs.c,v 1.5 2013/01/23 21:32:32 christos Exp $);
+__RCSID($NetBSD: v7fs.c,v 1.6 2013/01/24 01:10:47 christos Exp $);
 #endif	/* !__lint */
 
 #include stdio.h
@@ -82,9 +82,7 @@ v7fs_parse_opts(const char *option, fsin
 		{ .name = NULL }
 	};
 
-	set_option_var(v7fs_options, option, 1);
-
-	return 1;
+	return set_option_var(v7fs_options, option, 1) != -1;
 }
 
 void

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.52 src/usr.sbin/makefs/ffs.c:1.53
--- src/usr.sbin/makefs/ffs.c:1.52	Wed Jan 23 16:42:22 2013
+++ src/usr.sbin/makefs/ffs.c	Wed Jan 23 20:10:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.52 2013/01/23 21:42:22 christos Exp $	*/
+/*	$NetBSD: ffs.c,v 1.53 2013/01/24 01:10:47 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: ffs.c,v 1.52 2013/01/23 21:42:22 christos Exp $);
+__RCSID($NetBSD: ffs.c,v 1.53 2013/01/24 01:10:47 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -216,7 +216,7 @@ ffs_parse_opts(const char *option, fsinf
 	{ .name = NULL }
 	};
 
-	int	rv, i;
+	int	rv;
 
 	assert(option != NULL);
 	assert(fsopts != NULL);
@@ -226,16 +226,13 @@ ffs_parse_opts(const char *option, fsinf
 		printf(ffs_parse_opts: got `%s'\n, option);
 
 	rv = set_option(ffs_options, option);
-	if (rv == 0)
+	if (rv == -1)
 		return 0;
 
-	for (i = 0; ffs_options[i].name  (1  i) != rv; i++)
-		continue;
-
-	if (ffs_options[i].name == NULL)
+	if (ffs_options[rv].name == NULL)
 		abort();
 
-	if (strcmp(ffs_options[i].name, optimization) == 0) {
+	if (strcmp(ffs_options[rv].name, optimization) == 0) {
 		if (strcmp(optimization, time) == 0) {
 			ffs_opts-optimization = FS_OPTTIME;
 		} else if (strcmp(optimization, space) == 0) {
@@ -245,7 +242,7 @@ ffs_parse_opts(const char *option, fsinf
 			return 0;
 		}
 	}
-	return rv;
+	return 1;
 }
 
 

Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.38 src/usr.sbin/makefs/makefs.c:1.39
--- src/usr.sbin/makefs/makefs.c:1.38	Wed Jan 23 16:42:22 2013
+++ src/usr.sbin/makefs/makefs.c	Wed Jan 23 20:10:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.38 2013/01/23 21:42:22 

CVS commit: src/sys/arch/evbarm/conf

2013-01-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan 24 02:04:15 UTC 2013

Modified Files:
src/sys/arch/evbarm/conf: BEAGLEBOARD

Log Message:
bump SYMTAB_SPACE


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/conf/BEAGLEBOARD

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/BEAGLEBOARD
diff -u src/sys/arch/evbarm/conf/BEAGLEBOARD:1.43 src/sys/arch/evbarm/conf/BEAGLEBOARD:1.44
--- src/sys/arch/evbarm/conf/BEAGLEBOARD:1.43	Tue Jan 22 14:03:43 2013
+++ src/sys/arch/evbarm/conf/BEAGLEBOARD	Thu Jan 24 02:04:15 2013
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBOARD,v 1.43 2013/01/22 14:03:43 jmcneill Exp $
+#	$NetBSD: BEAGLEBOARD,v 1.44 2013/01/24 02:04:15 jmcneill Exp $
 #
 #	BEAGLEBOARD -- TI OMAP 3530 Eval Board Kernel
 #
@@ -141,7 +141,7 @@ options		DDB_ONPANIC=1
 options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
 #options 	KGDB
 makeoptions	DEBUG=-g	# compile full symbol table
-options 	SYMTAB_SPACE=60
+options 	SYMTAB_SPACE=80
 
 ## USB Debugging options
 options USB_DEBUG



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2013-01-23 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Thu Jan 24 06:47:51 UTC 2013

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: isakmp_inf.c

Log Message:
Fix handling of deletion notification.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 \
src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.48 src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.49
--- src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.48	Wed Aug 29 12:01:30 2012
+++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c	Thu Jan 24 06:47:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: isakmp_inf.c,v 1.48 2012/08/29 12:01:30 tteras Exp $	*/
+/*	$NetBSD: isakmp_inf.c,v 1.49 2013/01/24 06:47:50 tteras Exp $	*/
 
 /* Id: isakmp_inf.c,v 1.44 2006/05/06 20:45:52 manubsd Exp */
 
@@ -492,7 +492,7 @@ isakmp_info_recv_d(iph1, delete, msgid, 
 		delete payload for protocol %s\n,
 		s_ipsecdoi_proto(delete-proto_id));
 
-	if(!iph1-rmconf-weak_phase1_check  !encrypted) {
+	if((iph1 == NULL || !iph1-rmconf-weak_phase1_check)  !encrypted) {
 		plog(LLV_WARNING, LOCATION, iph1-remote,
 			Ignoring unencrypted delete payload 
 			(check the weak_phase1_check option)\n);



CVS commit: [ipsec-tools-0_8-branch] src/crypto/dist/ipsec-tools/src/racoon

2013-01-23 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Thu Jan 24 06:48:27 UTC 2013

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon [ipsec-tools-0_8-branch]:
isakmp_inf.c

Log Message:
Fix handling of deletion notification.


To generate a diff of this commit:
cvs rdiff -u -r1.47.2.1 -r1.47.2.2 \
src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.47.2.1 src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.47.2.2
--- src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.47.2.1	Wed Aug 29 12:01:56 2012
+++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c	Thu Jan 24 06:48:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: isakmp_inf.c,v 1.47.2.1 2012/08/29 12:01:56 tteras Exp $	*/
+/*	$NetBSD: isakmp_inf.c,v 1.47.2.2 2013/01/24 06:48:27 tteras Exp $	*/
 
 /* Id: isakmp_inf.c,v 1.44 2006/05/06 20:45:52 manubsd Exp */
 
@@ -492,7 +492,7 @@ isakmp_info_recv_d(iph1, delete, msgid, 
 		delete payload for protocol %s\n,
 		s_ipsecdoi_proto(delete-proto_id));
 
-	if(!iph1-rmconf-weak_phase1_check  !encrypted) {
+	if((iph1 == NULL || !iph1-rmconf-weak_phase1_check)  !encrypted) {
 		plog(LLV_WARNING, LOCATION, iph1-remote,
 			Ignoring unencrypted delete payload 
 			(check the weak_phase1_check option)\n);