head	1.11;
access;
symbols
	netbsd-11-0-RC5:1.11
	netbsd-11-0-RC4:1.11
	netbsd-11-0-RC3:1.11
	netbsd-11-0-RC2:1.11
	netbsd-11-0-RC1:1.11
	perseant-exfatfs-base-20250801:1.11
	netbsd-11:1.11.0.126
	netbsd-11-base:1.11
	netbsd-10-1-RELEASE:1.11
	perseant-exfatfs-base-20240630:1.11
	perseant-exfatfs:1.11.0.124
	perseant-exfatfs-base:1.11
	netbsd-8-3-RELEASE:1.11
	netbsd-9-4-RELEASE:1.11
	netbsd-10-0-RELEASE:1.11
	netbsd-10-0-RC6:1.11
	netbsd-10-0-RC5:1.11
	netbsd-10-0-RC4:1.11
	netbsd-10-0-RC3:1.11
	netbsd-10-0-RC2:1.11
	thorpej-ifq:1.11.0.122
	thorpej-ifq-base:1.11
	thorpej-altq-separation:1.11.0.120
	thorpej-altq-separation-base:1.11
	netbsd-10-0-RC1:1.11
	netbsd-10:1.11.0.118
	netbsd-10-base:1.11
	bouyer-sunxi-drm:1.11.0.116
	bouyer-sunxi-drm-base:1.11
	netbsd-9-3-RELEASE:1.11
	thorpej-i2c-spi-conf2:1.11.0.114
	thorpej-i2c-spi-conf2-base:1.11
	thorpej-futex2:1.11.0.112
	thorpej-futex2-base:1.11
	thorpej-cfargs2:1.11.0.110
	thorpej-cfargs2-base:1.11
	cjep_sun2x-base1:1.11
	cjep_sun2x:1.11.0.108
	cjep_sun2x-base:1.11
	cjep_staticlib_x-base1:1.11
	netbsd-9-2-RELEASE:1.11
	cjep_staticlib_x:1.11.0.106
	cjep_staticlib_x-base:1.11
	thorpej-i2c-spi-conf:1.11.0.104
	thorpej-i2c-spi-conf-base:1.11
	thorpej-cfargs:1.11.0.102
	thorpej-cfargs-base:1.11
	thorpej-futex:1.11.0.100
	thorpej-futex-base:1.11
	netbsd-9-1-RELEASE:1.11
	bouyer-xenpvh-base2:1.11
	phil-wifi-20200421:1.11
	bouyer-xenpvh-base1:1.11
	phil-wifi-20200411:1.11
	bouyer-xenpvh:1.11.0.98
	bouyer-xenpvh-base:1.11
	is-mlppp:1.11.0.96
	is-mlppp-base:1.11
	phil-wifi-20200406:1.11
	netbsd-8-2-RELEASE:1.11
	ad-namecache-base3:1.11
	netbsd-9-0-RELEASE:1.11
	netbsd-9-0-RC2:1.11
	ad-namecache-base2:1.11
	ad-namecache-base1:1.11
	ad-namecache:1.11.0.94
	ad-namecache-base:1.11
	netbsd-9-0-RC1:1.11
	phil-wifi-20191119:1.11
	netbsd-9:1.11.0.92
	netbsd-9-base:1.11
	phil-wifi-20190609:1.11
	netbsd-8-1-RELEASE:1.11
	netbsd-8-1-RC1:1.11
	isaki-audio2:1.11.0.90
	isaki-audio2-base:1.11
	pgoyette-compat-merge-20190127:1.11
	pgoyette-compat-20190127:1.11
	pgoyette-compat-20190118:1.11
	pgoyette-compat-1226:1.11
	pgoyette-compat-1126:1.11
	pgoyette-compat-1020:1.11
	pgoyette-compat-0930:1.11
	pgoyette-compat-0906:1.11
	netbsd-7-2-RELEASE:1.11
	pgoyette-compat-0728:1.11
	netbsd-8-0-RELEASE:1.11
	phil-wifi:1.11.0.88
	phil-wifi-base:1.11
	pgoyette-compat-0625:1.11
	netbsd-8-0-RC2:1.11
	pgoyette-compat-0521:1.11
	pgoyette-compat-0502:1.11
	pgoyette-compat-0422:1.11
	netbsd-8-0-RC1:1.11
	pgoyette-compat-0415:1.11
	pgoyette-compat-0407:1.11
	pgoyette-compat-0330:1.11
	pgoyette-compat-0322:1.11
	pgoyette-compat-0315:1.11
	netbsd-7-1-2-RELEASE:1.11
	pgoyette-compat:1.11.0.86
	pgoyette-compat-base:1.11
	netbsd-7-1-1-RELEASE:1.11
	tls-maxphys-base-20171202:1.11
	matt-nb8-mediatek:1.11.0.84
	matt-nb8-mediatek-base:1.11
	nick-nhusb-base-20170825:1.11
	perseant-stdc-iso10646:1.11.0.82
	perseant-stdc-iso10646-base:1.11
	netbsd-8:1.11.0.80
	netbsd-8-base:1.11
	prg-localcount2-base3:1.11
	prg-localcount2-base2:1.11
	prg-localcount2-base1:1.11
	prg-localcount2:1.11.0.78
	prg-localcount2-base:1.11
	pgoyette-localcount-20170426:1.11
	bouyer-socketcan-base1:1.11
	jdolecek-ncq:1.11.0.76
	jdolecek-ncq-base:1.11
	pgoyette-localcount-20170320:1.11
	netbsd-7-1:1.11.0.74
	netbsd-7-1-RELEASE:1.11
	netbsd-7-1-RC2:1.11
	nick-nhusb-base-20170204:1.11
	netbsd-7-nhusb-base-20170116:1.11
	bouyer-socketcan:1.11.0.72
	bouyer-socketcan-base:1.11
	pgoyette-localcount-20170107:1.11
	netbsd-7-1-RC1:1.11
	nick-nhusb-base-20161204:1.11
	pgoyette-localcount-20161104:1.11
	netbsd-7-0-2-RELEASE:1.11
	nick-nhusb-base-20161004:1.11
	localcount-20160914:1.11
	netbsd-7-nhusb:1.11.0.70
	netbsd-7-nhusb-base:1.11
	pgoyette-localcount-20160806:1.11
	pgoyette-localcount-20160726:1.11
	pgoyette-localcount:1.11.0.68
	pgoyette-localcount-base:1.11
	nick-nhusb-base-20160907:1.11
	nick-nhusb-base-20160529:1.11
	netbsd-7-0-1-RELEASE:1.11
	nick-nhusb-base-20160422:1.11
	nick-nhusb-base-20160319:1.11
	nick-nhusb-base-20151226:1.11
	netbsd-7-0:1.11.0.66
	netbsd-7-0-RELEASE:1.11
	nick-nhusb-base-20150921:1.11
	netbsd-7-0-RC3:1.11
	netbsd-7-0-RC2:1.11
	netbsd-7-0-RC1:1.11
	nick-nhusb-base-20150606:1.11
	nick-nhusb-base-20150406:1.11
	nick-nhusb:1.11.0.64
	nick-nhusb-base:1.11
	netbsd-5-2-3-RELEASE:1.11
	netbsd-5-1-5-RELEASE:1.11
	netbsd-6-0-6-RELEASE:1.11
	netbsd-6-1-5-RELEASE:1.11
	netbsd-7:1.11.0.62
	netbsd-7-base:1.11
	yamt-pagecache-base9:1.11
	yamt-pagecache-tag8:1.11
	netbsd-6-1-4-RELEASE:1.11
	netbsd-6-0-5-RELEASE:1.11
	tls-earlyentropy:1.11.0.60
	tls-earlyentropy-base:1.11
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.11
	riastradh-drm2-base3:1.11
	netbsd-6-1-3-RELEASE:1.11
	netbsd-6-0-4-RELEASE:1.11
	netbsd-5-2-2-RELEASE:1.11
	netbsd-5-1-4-RELEASE:1.11
	netbsd-6-1-2-RELEASE:1.11
	netbsd-6-0-3-RELEASE:1.11
	netbsd-5-2-1-RELEASE:1.11
	netbsd-5-1-3-RELEASE:1.11
	rmind-smpnet-nbase:1.11
	netbsd-6-1-1-RELEASE:1.11
	riastradh-drm2-base2:1.11
	riastradh-drm2-base1:1.11
	riastradh-drm2:1.11.0.58
	riastradh-drm2-base:1.11
	rmind-smpnet:1.11.0.50
	rmind-smpnet-base:1.11
	netbsd-6-1:1.11.0.56
	netbsd-6-0-2-RELEASE:1.11
	netbsd-6-1-RELEASE:1.11
	khorben-n900:1.11.0.54
	netbsd-6-1-RC4:1.11
	netbsd-6-1-RC3:1.11
	agc-symver:1.11.0.52
	agc-symver-base:1.11
	netbsd-6-1-RC2:1.11
	netbsd-6-1-RC1:1.11
	yamt-pagecache-base8:1.11
	netbsd-5-2:1.11.0.48
	netbsd-6-0-1-RELEASE:1.11
	yamt-pagecache-base7:1.11
	netbsd-5-2-RELEASE:1.11
	netbsd-5-2-RC1:1.11
	matt-nb6-plus-nbase:1.11
	yamt-pagecache-base6:1.11
	netbsd-6-0:1.11.0.46
	netbsd-6-0-RELEASE:1.11
	netbsd-6-0-RC2:1.11
	tls-maxphys:1.11.0.44
	tls-maxphys-base:1.11
	matt-nb6-plus:1.11.0.42
	matt-nb6-plus-base:1.11
	netbsd-6-0-RC1:1.11
	jmcneill-usbmp-base10:1.11
	yamt-pagecache-base5:1.11
	jmcneill-usbmp-base9:1.11
	yamt-pagecache-base4:1.11
	jmcneill-usbmp-base8:1.11
	jmcneill-usbmp-base7:1.11
	jmcneill-usbmp-base6:1.11
	jmcneill-usbmp-base5:1.11
	jmcneill-usbmp-base4:1.11
	jmcneill-usbmp-base3:1.11
	jmcneill-usbmp-pre-base2:1.11
	jmcneill-usbmp-base2:1.11
	netbsd-6:1.11.0.40
	netbsd-6-base:1.11
	netbsd-5-1-2-RELEASE:1.11
	netbsd-5-1-1-RELEASE:1.11
	jmcneill-usbmp:1.11.0.38
	jmcneill-usbmp-base:1.11
	jmcneill-audiomp3:1.11.0.36
	jmcneill-audiomp3-base:1.11
	yamt-pagecache-base3:1.11
	yamt-pagecache-base2:1.11
	yamt-pagecache:1.11.0.34
	yamt-pagecache-base:1.11
	rmind-uvmplock-nbase:1.11
	cherry-xenmp:1.11.0.32
	cherry-xenmp-base:1.11
	jym-xensuspend-nbase:1.11
	uebayasi-xip-base7:1.11
	bouyer-quota2-nbase:1.11
	bouyer-quota2:1.11.0.30
	bouyer-quota2-base:1.11
	jruoho-x86intr:1.11.0.28
	jruoho-x86intr-base:1.11
	matt-mips64-premerge-20101231:1.11
	matt-nb5-mips64-premerge-20101231:1.11
	matt-nb5-pq3:1.11.0.26
	matt-nb5-pq3-base:1.11
	netbsd-5-1:1.11.0.24
	uebayasi-xip-base6:1.11
	uebayasi-xip-base5:1.11
	netbsd-5-1-RELEASE:1.11
	uebayasi-xip-base4:1.11
	uebayasi-xip-base3:1.11
	yamt-nfs-mp-base11:1.11
	netbsd-5-1-RC4:1.11
	matt-nb5-mips64-k15:1.11
	uebayasi-xip-base2:1.11
	yamt-nfs-mp-base10:1.11
	netbsd-5-1-RC3:1.11
	netbsd-5-1-RC2:1.11
	uebayasi-xip-base1:1.11
	netbsd-5-1-RC1:1.11
	rmind-uvmplock:1.11.0.22
	rmind-uvmplock-base:1.11
	yamt-nfs-mp-base9:1.11
	uebayasi-xip:1.11.0.20
	uebayasi-xip-base:1.11
	netbsd-5-0-2-RELEASE:1.11
	matt-nb5-mips64-premerge-20091211:1.11
	matt-premerge-20091211:1.11
	yamt-nfs-mp-base8:1.11
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.11
	matt-nb4-mips64-k7-u2a-k9b:1.11
	matt-nb5-mips64-u1-k1-k5:1.11
	yamt-nfs-mp-base7:1.11
	matt-nb5-mips64:1.11.0.18
	netbsd-5-0-1-RELEASE:1.11
	jymxensuspend-base:1.11
	yamt-nfs-mp-base6:1.11
	yamt-nfs-mp-base5:1.11
	yamt-nfs-mp-base4:1.11
	yamt-nfs-mp-base3:1.11
	nick-hppapmap-base4:1.11
	nick-hppapmap-base3:1.11
	netbsd-5-0:1.11.0.16
	netbsd-5-0-RELEASE:1.11
	netbsd-5-0-RC4:1.11
	netbsd-5-0-RC3:1.11
	nick-hppapmap-base2:1.11
	netbsd-5-0-RC2:1.11
	jym-xensuspend:1.11.0.14
	jym-xensuspend-base:1.11
	netbsd-5-0-RC1:1.11
	haad-dm-base2:1.11
	haad-nbase2:1.11
	ad-audiomp2:1.11.0.12
	ad-audiomp2-base:1.11
	netbsd-5:1.11.0.10
	netbsd-5-base:1.11
	nick-hppapmap:1.11.0.8
	nick-hppapmap-base:1.11
	matt-mips64-base2:1.11
	haad-dm-base1:1.11
	wrstuden-revivesa-base-4:1.11
	netbsd-4-0-1-RELEASE:1.10
	wrstuden-revivesa-base-3:1.11
	wrstuden-revivesa-base-2:1.11
	wrstuden-fixsa-newbase:1.10
	nick-csl-alignment-base5:1.10
	haad-dm:1.11.0.6
	haad-dm-base:1.11
	wrstuden-revivesa-base-1:1.11
	simonb-wapbl-nbase:1.11
	yamt-pf42-base4:1.11
	simonb-wapbl:1.11.0.4
	simonb-wapbl-base:1.11
	yamt-pf42-base3:1.11
	hpcarm-cleanup-nbase:1.11
	yamt-pf42-baseX:1.10
	yamt-pf42-base2:1.11
	yamt-nfs-mp-base2:1.11
	wrstuden-revivesa:1.11.0.2
	wrstuden-revivesa-base:1.11
	yamt-nfs-mp:1.10.0.78
	yamt-nfs-mp-base:1.10
	yamt-pf42:1.10.0.76
	yamt-pf42-base:1.10
	ad-socklock-base1:1.10
	yamt-lazymbuf-base15:1.10
	yamt-lazymbuf-base14:1.10
	keiichi-mipv6-nbase:1.10
	mjf-devfs2:1.10.0.74
	mjf-devfs2-base:1.11
	nick-net80211-sync:1.10.0.72
	nick-net80211-sync-base:1.10
	keiichi-mipv6:1.10.0.70
	keiichi-mipv6-base:1.10
	bouyer-xeni386-merge1:1.10
	matt-armv6-prevmlocking:1.10
	wrstuden-fixsa-base-1:1.10
	vmlocking2-base3:1.10
	netbsd-4-0:1.10.0.68
	netbsd-4-0-RELEASE:1.10
	bouyer-xeni386-nbase:1.10
	yamt-kmem-base3:1.10
	cube-autoconf:1.10.0.66
	cube-autoconf-base:1.10
	yamt-kmem-base2:1.10
	bouyer-xeni386:1.10.0.64
	bouyer-xeni386-base:1.10
	yamt-kmem:1.10.0.62
	yamt-kmem-base:1.10
	vmlocking2-base2:1.10
	reinoud-bufcleanup-nbase:1.10
	vmlocking2:1.10.0.60
	vmlocking2-base1:1.10
	netbsd-4-0-RC5:1.10
	matt-nb4-arm:1.10.0.58
	matt-nb4-arm-base:1.10
	matt-armv6-nbase:1.10
	jmcneill-base:1.10
	netbsd-4-0-RC4:1.10
	mjf-devfs:1.10.0.56
	mjf-devfs-base:1.10
	bouyer-xenamd64-base2:1.10
	vmlocking-nbase:1.10
	yamt-x86pmap-base4:1.10
	bouyer-xenamd64:1.10.0.54
	bouyer-xenamd64-base:1.10
	netbsd-4-0-RC3:1.10
	yamt-x86pmap-base3:1.10
	yamt-x86pmap-base2:1.10
	netbsd-4-0-RC2:1.10
	yamt-x86pmap:1.10.0.52
	yamt-x86pmap-base:1.10
	netbsd-4-0-RC1:1.10
	matt-armv6:1.10.0.50
	matt-armv6-base:1.10
	jmcneill-pm:1.10.0.48
	jmcneill-pm-base:1.10
	hpcarm-cleanup:1.10.0.46
	hpcarm-cleanup-base:1.10
	nick-csl-alignment:1.10.0.44
	nick-csl-alignment-base:1.10
	matt-mips64:1.10.0.42
	matt-mips64-base:1.10
	netbsd-3-1-1-RELEASE:1.9
	netbsd-3-0-3-RELEASE:1.9
	yamt-idlelwp-base8:1.10
	wrstuden-fixsa:1.10.0.40
	wrstuden-fixsa-base:1.10
	ppcoea-renovation:1.10.0.38
	ppcoea-renovation-base:1.10
	thorpej-atomic:1.10.0.36
	thorpej-atomic-base:1.10
	reinoud-bufcleanup:1.10.0.34
	reinoud-bufcleanup-base:1.10
	mjf-ufs-trans:1.10.0.32
	mjf-ufs-trans-base:1.10
	vmlocking:1.10.0.30
	vmlocking-base:1.10
	ad-audiomp:1.10.0.28
	ad-audiomp-base:1.10
	yamt-idlelwp:1.10.0.26
	post-newlock2-merge:1.10
	newlock2-nbase:1.10
	yamt-splraiseipl-base5:1.10
	yamt-splraiseipl-base4:1.10
	yamt-splraiseipl-base3:1.10
	abandoned-netbsd-4-base:1.10
	abandoned-netbsd-4:1.10.0.18
	netbsd-3-1:1.9.0.22
	netbsd-3-1-RELEASE:1.9
	netbsd-3-0-2-RELEASE:1.9
	yamt-splraiseipl-base2:1.10
	netbsd-3-1-RC4:1.9
	yamt-splraiseipl:1.10.0.22
	yamt-splraiseipl-base:1.10
	netbsd-3-1-RC3:1.9
	yamt-pdpolicy-base9:1.10
	newlock2:1.10.0.20
	newlock2-base:1.10
	yamt-pdpolicy-base8:1.10
	netbsd-3-1-RC2:1.9
	netbsd-3-1-RC1:1.9
	yamt-pdpolicy-base7:1.10
	netbsd-4:1.10.0.24
	netbsd-4-base:1.10
	yamt-pdpolicy-base6:1.10
	chap-midi-nbase:1.10
	netbsd-3-0-1-RELEASE:1.9
	gdamore-uart:1.10.0.16
	gdamore-uart-base:1.10
	simonb-timcounters-final:1.10
	yamt-pdpolicy-base5:1.10
	chap-midi:1.10.0.14
	chap-midi-base:1.10
	yamt-pdpolicy-base4:1.10
	yamt-pdpolicy-base3:1.10
	peter-altq-base:1.10
	peter-altq:1.10.0.12
	yamt-pdpolicy-base2:1.10
	elad-kernelauth-base:1.10
	elad-kernelauth:1.10.0.10
	yamt-pdpolicy:1.10.0.8
	yamt-pdpolicy-base:1.10
	yamt-uio_vmspace-base5:1.10
	simonb-timecounters:1.10.0.6
	simonb-timecounters-base:1.10
	rpaulo-netinet-merge-pcb:1.10.0.4
	rpaulo-netinet-merge-pcb-base:1.10
	yamt-uio_vmspace:1.10.0.2
	netbsd-3-0:1.9.0.20
	netbsd-3-0-RELEASE:1.9
	netbsd-3-0-RC6:1.9
	yamt-readahead-base3:1.9
	netbsd-3-0-RC5:1.9
	netbsd-3-0-RC4:1.9
	netbsd-3-0-RC3:1.9
	yamt-readahead-base2:1.9
	netbsd-3-0-RC2:1.9
	yamt-readahead-pervnode:1.9
	yamt-readahead-perfile:1.9
	yamt-readahead:1.9.0.18
	yamt-readahead-base:1.9
	netbsd-3-0-RC1:1.9
	yamt-vop-base3:1.9
	netbsd-2-0-3-RELEASE:1.8
	netbsd-2-1:1.8.0.20
	yamt-vop-base2:1.9
	thorpej-vnode-attr:1.9.0.16
	thorpej-vnode-attr-base:1.9
	netbsd-2-1-RELEASE:1.8
	yamt-vop:1.9.0.14
	yamt-vop-base:1.9
	netbsd-2-1-RC6:1.8
	netbsd-2-1-RC5:1.8
	netbsd-2-1-RC4:1.8
	netbsd-2-1-RC3:1.8
	netbsd-2-1-RC2:1.8
	netbsd-2-1-RC1:1.8
	yamt-lazymbuf:1.9.0.12
	yamt-km-base4:1.9
	netbsd-2-0-2-RELEASE:1.8
	yamt-km-base3:1.9
	netbsd-3:1.9.0.10
	netbsd-3-base:1.9
	yamt-km-base2:1.9
	yamt-km:1.9.0.6
	yamt-km-base:1.9
	kent-audio2:1.9.0.4
	kent-audio2-base:1.9
	netbsd-2-0-1-RELEASE:1.8
	kent-audio1-beforemerge:1.9
	netbsd-2:1.8.0.18
	netbsd-2-base:1.8
	kent-audio1:1.9.0.2
	kent-audio1-base:1.9
	netbsd-2-0-RELEASE:1.8
	netbsd-2-0-RC5:1.8
	netbsd-2-0-RC4:1.8
	netbsd-2-0-RC3:1.8
	netbsd-2-0-RC2:1.8
	netbsd-2-0-RC1:1.8
	netbsd-2-0:1.8.0.16
	netbsd-2-0-base:1.8
	netbsd-1-6-PATCH002-RELEASE:1.8
	netbsd-1-6-PATCH002:1.8
	netbsd-1-6-PATCH002-RC4:1.8
	netbsd-1-6-PATCH002-RC3:1.8
	netbsd-1-6-PATCH002-RC2:1.8
	netbsd-1-6-PATCH002-RC1:1.8
	ktrace-lwp:1.8.0.14
	ktrace-lwp-base:1.9
	netbsd-1-6-PATCH001:1.8
	netbsd-1-6-PATCH001-RELEASE:1.8
	netbsd-1-6-PATCH001-RC3:1.8
	netbsd-1-6-PATCH001-RC2:1.8
	netbsd-1-6-PATCH001-RC1:1.8
	nathanw_sa_end:1.7.8.2
	nathanw_sa_before_merge:1.8
	fvdl_fs64_base:1.8
	gmcgarry_ctxsw:1.8.0.12
	gmcgarry_ctxsw_base:1.8
	gmcgarry_ucred:1.8.0.10
	gmcgarry_ucred_base:1.8
	nathanw_sa_base:1.8
	kqueue-aftermerge:1.8
	kqueue-beforemerge:1.8
	netbsd-1-6-RELEASE:1.8
	netbsd-1-6-RC3:1.8
	netbsd-1-6-RC2:1.8
	netbsd-1-6-RC1:1.8
	netbsd-1-6:1.8.0.8
	netbsd-1-6-base:1.8
	gehenna-devsw:1.8.0.6
	gehenna-devsw-base:1.8
	eeh-devprop:1.8.0.4
	eeh-devprop-base:1.8
	newlock:1.8.0.2
	newlock-base:1.8
	ifpoll-base:1.7
	nathanw_sa:1.7.0.8
	thorpej-mips-cache:1.7.0.6
	thorpej-mips-cache-base:1.7
	thorpej-devvp-base3:1.7
	thorpej-devvp-base2:1.7
	post-chs-ubcperf:1.7
	pre-chs-ubcperf:1.7
	thorpej-devvp:1.7.0.4
	thorpej-devvp-base:1.7
	kqueue:1.7.0.2
	kqueue-base:1.8
	thorpej_scsipi_beforemerge:1.4
	thorpej_scsipi_base:1.3
	thorpej_scsipi:1.1.0.2
	thorpej_scsipi_nbase:1.3;
locks; strict;
comment	@// @;


1.11
date	2008.04.28.20.23.20;	author martin;	state Exp;
branches;
next	1.10;

1.10
date	2005.12.11.12.17.28;	author christos;	state Exp;
branches
	1.10.74.1
	1.10.76.1
	1.10.78.1;
next	1.9;

1.9
date	2004.08.06.18.33.09;	author uch;	state Exp;
branches;
next	1.8;

1.8
date	2002.03.02.22.01.34;	author uch;	state Exp;
branches
	1.8.14.1;
next	1.7;

1.7
date	2001.06.19.16.48.49;	author uch;	state Exp;
branches
	1.7.2.1
	1.7.8.1;
next	1.6;

1.6
date	2001.05.21.15.54.25;	author uch;	state Exp;
branches;
next	1.5;

1.5
date	2001.05.08.18.51.22;	author uch;	state Exp;
branches;
next	1.4;

1.4
date	2001.04.24.19.27.59;	author uch;	state Exp;
branches;
next	1.3;

1.3
date	2001.03.25.17.13.16;	author uch;	state Exp;
branches;
next	1.2;

1.2
date	2001.03.22.18.19.09;	author uch;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.09.18.34.35;	author uch;	state Exp;
branches
	1.1.2.1
	1.1.4.1;
next	;

1.10.74.1
date	2008.06.02.13.22.08;	author mjf;	state Exp;
branches;
next	;

1.10.76.1
date	2008.05.18.12.31.59;	author yamt;	state Exp;
branches;
next	;

1.10.78.1
date	2008.05.16.02.22.24;	author yamt;	state Exp;
branches;
next	;

1.8.14.1
date	2004.08.12.11.41.05;	author skrll;	state Exp;
branches;
next	1.8.14.2;

1.8.14.2
date	2004.09.18.14.34.39;	author skrll;	state Exp;
branches;
next	1.8.14.3;

1.8.14.3
date	2004.09.21.13.15.48;	author skrll;	state Exp;
branches;
next	;

1.7.2.1
date	2002.03.16.15.57.50;	author jdolecek;	state Exp;
branches;
next	;

1.7.8.1
date	2001.06.19.16.48.49;	author nathanw;	state dead;
branches;
next	1.7.8.2;

1.7.8.2
date	2002.04.01.07.40.13;	author nathanw;	state Exp;
branches;
next	;

1.1.2.1
date	2001.02.09.18.34.35;	author bouyer;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.02.11.19.09.49;	author bouyer;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2001.03.27.15.30.47;	author bouyer;	state Exp;
branches;
next	;

1.1.4.1
date	2001.04.09.01.52.36;	author nathanw;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	2001.06.21.19.22.41;	author nathanw;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Remove clause 3 and 4 from TNF licenses
@
text
@/* -*-C++-*-	$NetBSD: console.cpp,v 1.10 2005/12/11 12:17:28 christos Exp $ */

/*-
 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by UCHIYAMA Yasushi.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <hpcmenu.h>
#include <console.h>

Console *Console::_instance = 0;

//
// Display console
//
Console *
Console::Instance()
{

	if (_instance == 0) {
		_instance = new Console;
	}

	return (_instance);
}

Console::Console()
{
	// set default builtin console. (bicons)
	setBootConsole(BI_CNUSE_BUILTIN);
}

void
Console::Destroy()
{

	if (_instance)
		delete _instance;
	_instance = 0;
}

void
Console::print(const TCHAR *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	wvsprintf(_bufw, fmt, ap);
	va_end(ap);

	// print to `Console Tab Window'
	HPC_MENU.print(_bufw);
}

//
// Serial console.
//
SerialConsole::SerialConsole()
{

	_handle = INVALID_HANDLE_VALUE;
	// set default serial console.
	setBootConsole(BI_CNUSE_SERIAL);
}

BOOL
SerialConsole::init()
{
	// always open COM1 to supply clock and power for the
	// sake of kernel serial driver
	if (_handle == INVALID_HANDLE_VALUE)
		_handle = OpenCOM1();

	if (_handle == INVALID_HANDLE_VALUE) {
		Console::print(TEXT("couldn't open COM1\n"));
		return (FALSE);
	}

	// Print serial console status on LCD.
	DCB dcb;
	GetCommState(_handle, &dcb);
	Console::print(
		TEXT("BaudRate %d, ByteSize %#x, Parity %#x, StopBits %#x\n"),
		dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits);

	return (TRUE);
}

BOOL
SerialConsole::setupMultibyteBuffer()
{
	size_t len = WideCharToMultiByte(CP_ACP, 0, _bufw, wcslen(_bufw),
	    0, 0, 0, 0);

	if (len + 1 > CONSOLE_BUFSIZE)
		return FALSE;
	if (!WideCharToMultiByte(CP_ACP, 0, _bufw, len, _bufm, len, 0, 0))
		return FALSE;
	_bufm[len] = '\0';

	return TRUE;
}

void
SerialConsole::print(const TCHAR *fmt, ...)
{

	SETUP_WIDECHAR_BUFFER();

	if (!setupMultibyteBuffer())
		return;

	genericPrint(_bufm);
}

HANDLE
SerialConsole::OpenCOM1()
{
	static HANDLE COM1handle = INVALID_HANDLE_VALUE;
	const char msg[] = "\r\n--------HPCBOOT--------\r\n";
	unsigned long wrote;
	int speed = HPC_PREFERENCE.serial_speed;
	HANDLE h;

	if (COM1handle != INVALID_HANDLE_VALUE)
		return (COM1handle);

	h = CreateFile(TEXT("COM1:"),
	    GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
	    NULL);
	if (h == INVALID_HANDLE_VALUE)
		return (h);

	DCB dcb;
	if (!GetCommState(h, &dcb))
		goto bad;

	dcb.BaudRate = speed;
	if (!SetCommState(h, &dcb))
		goto bad;

	// Print banner on serial console.
	WriteFile(h, msg, sizeof msg, &wrote, 0);

	COM1handle = h;

	return (h);
 bad:
	CloseHandle(h);
	return (INVALID_HANDLE_VALUE);
}

void
SerialConsole::genericPrint(const char *buf)
{
	unsigned long wrote;
	int i;

	for (i = 0; *buf != '\0'; buf++) {
		char c = *buf;
		if (c == '\n')
			WriteFile(_handle, "\r", 1, &wrote, 0);
		WriteFile(_handle, &c, 1, &wrote, 0);
	}
}
@


1.10
log
@merge ktrace-lwp.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.8.14.3 2004/09/21 13:15:48 skrll Exp $ */
a17 7
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
@


1.10.74.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD$ */
d18 7
@


1.10.76.1
log
@sync with head.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.10 2005/12/11 12:17:28 christos Exp $ */
d18 7
@


1.10.78.1
log
@sync with head.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.10 2005/12/11 12:17:28 christos Exp $ */
d18 7
@


1.9
log
@clean up whitespace.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.8 2002/03/02 22:01:34 uch Exp $ */
@


1.8
log
@always open COM1 for the sake of KGDB.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.7 2001/06/19 16:48:49 uch Exp $ */
d101 1
a101 1
	// sake of kernel serial driver 
d103 1
a103 1
		_handle = OpenCOM1(); 
d159 1
a159 1
	h = CreateFile(TEXT("COM1:"), 
d168 1
a168 1
      
d189 1
a189 1
	
@


1.8.14.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.8 2002/03/02 22:01:34 uch Exp $ */
d101 1
a101 1
	// sake of kernel serial driver
d103 1
a103 1
		_handle = OpenCOM1();
d159 1
a159 1
	h = CreateFile(TEXT("COM1:"),
d168 1
a168 1

d189 1
a189 1

@


1.8.14.2
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.9 2004/08/06 18:33:09 uch Exp $ */
@


1.8.14.3
log
@Fix the sync with head I botched.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.8.14.1 2004/08/12 11:41:05 skrll Exp $ */
@


1.7
log
@set BI_CNUSE_SERIAL flag at SerialConsole constructor. and remove
getBootConsole member from SerialConsole class
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.6 2001/05/21 15:54:25 uch Exp $ */
d4 1
a4 1
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
d50 2
a51 1
	if (_instance == 0)
d53 3
a55 1
	return _instance;
d67 1
d77 1
d91 1
d102 16
a117 1
	return openCOM1();
d125 1
d138 1
d147 2
a148 2
BOOL
SerialConsole::openCOM1()
d150 3
d154 1
d156 12
a167 14
	if (_handle == INVALID_HANDLE_VALUE) {
		_handle = CreateFile(TEXT("COM1:"), 
		    GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
		    NULL);
		if (_handle == INVALID_HANDLE_VALUE) {
			Console::print(TEXT("couldn't open COM1\n"));
			return FALSE;
		}

		DCB dcb;
		if (!GetCommState(_handle, &dcb)) {
			Console::print(TEXT("couldn't get COM port status.\n"));
			goto bad;
		}
d169 8
a176 13
		dcb.BaudRate = speed;
		if (!SetCommState(_handle, &dcb)) {
			Console::print(TEXT("couldn't set baud rate to %s.\n"),
			    speed);
			goto bad;
		}

		Console::print(TEXT("BaudRate %d, ByteSize %#x, Parity %#x, StopBits %#x\n"),
		    dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits);
		const char msg[] = "--------HPCBOOT--------\r\n";
		unsigned long wrote;
		WriteFile(_handle, msg, sizeof msg, &wrote, 0);
	}
d178 1
a178 1
	return TRUE;
d180 2
a181 3
	CloseHandle(_handle);
	_handle = INVALID_HANDLE_VALUE;
	return FALSE;
@


1.7.8.1
log
@file console.cpp was added on branch nathanw_sa on 2002-04-01 07:40:13 +0000
@
text
@d1 177
@


1.7.8.2
log
@Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
@
text
@a0 196
/* -*-C++-*-	$NetBSD: console.cpp,v 1.7.8.1 2002/04/01 07:40:13 nathanw Exp $ */

/*-
 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by UCHIYAMA Yasushi.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <hpcmenu.h>
#include <console.h>

Console *Console::_instance = 0;

//
// Display console
//
Console *
Console::Instance()
{

	if (_instance == 0) {
		_instance = new Console;
	}

	return (_instance);
}

Console::Console()
{
	// set default builtin console. (bicons)
	setBootConsole(BI_CNUSE_BUILTIN);
}

void
Console::Destroy()
{

	if (_instance)
		delete _instance;
	_instance = 0;
}

void
Console::print(const TCHAR *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	wvsprintf(_bufw, fmt, ap);
	va_end(ap);

	// print to `Console Tab Window'
	HPC_MENU.print(_bufw);
}

//
// Serial console.
//
SerialConsole::SerialConsole()
{

	_handle = INVALID_HANDLE_VALUE;
	// set default serial console.
	setBootConsole(BI_CNUSE_SERIAL);
}

BOOL
SerialConsole::init()
{
	// always open COM1 to supply clock and power for the
	// sake of kernel serial driver 
	if (_handle == INVALID_HANDLE_VALUE)
		_handle = OpenCOM1(); 

	if (_handle == INVALID_HANDLE_VALUE) {
		Console::print(TEXT("couldn't open COM1\n"));
		return (FALSE);
	}

	// Print serial console status on LCD.
	DCB dcb;
	GetCommState(_handle, &dcb);
	Console::print(
		TEXT("BaudRate %d, ByteSize %#x, Parity %#x, StopBits %#x\n"),
		dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits);

	return (TRUE);
}

BOOL
SerialConsole::setupMultibyteBuffer()
{
	size_t len = WideCharToMultiByte(CP_ACP, 0, _bufw, wcslen(_bufw),
	    0, 0, 0, 0);

	if (len + 1 > CONSOLE_BUFSIZE)
		return FALSE;
	if (!WideCharToMultiByte(CP_ACP, 0, _bufw, len, _bufm, len, 0, 0))
		return FALSE;
	_bufm[len] = '\0';

	return TRUE;
}

void
SerialConsole::print(const TCHAR *fmt, ...)
{

	SETUP_WIDECHAR_BUFFER();

	if (!setupMultibyteBuffer())
		return;

	genericPrint(_bufm);
}

HANDLE
SerialConsole::OpenCOM1()
{
	static HANDLE COM1handle = INVALID_HANDLE_VALUE;
	const char msg[] = "\r\n--------HPCBOOT--------\r\n";
	unsigned long wrote;
	int speed = HPC_PREFERENCE.serial_speed;
	HANDLE h;

	if (COM1handle != INVALID_HANDLE_VALUE)
		return (COM1handle);

	h = CreateFile(TEXT("COM1:"), 
	    GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
	    NULL);
	if (h == INVALID_HANDLE_VALUE)
		return (h);

	DCB dcb;
	if (!GetCommState(h, &dcb))
		goto bad;
      
	dcb.BaudRate = speed;
	if (!SetCommState(h, &dcb))
		goto bad;

	// Print banner on serial console.
	WriteFile(h, msg, sizeof msg, &wrote, 0);

	COM1handle = h;

	return (h);
 bad:
	CloseHandle(h);
	return (INVALID_HANDLE_VALUE);
}

void
SerialConsole::genericPrint(const char *buf)
{
	unsigned long wrote;
	int i;
	
	for (i = 0; *buf != '\0'; buf++) {
		char c = *buf;
		if (c == '\n')
			WriteFile(_handle, "\r", 1, &wrote, 0);
		WriteFile(_handle, &c, 1, &wrote, 0);
	}
}
@


1.7.2.1
log
@Catch up with -current.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.7 2001/06/19 16:48:49 uch Exp $ */
d4 1
a4 1
 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
d50 1
a50 2

	if (_instance == 0) {
d52 1
a52 3
	}

	return (_instance);
a63 1

a72 1

a85 1

d96 1
a96 16
	if (_handle == INVALID_HANDLE_VALUE)
		_handle = OpenCOM1(); 

	if (_handle == INVALID_HANDLE_VALUE) {
		Console::print(TEXT("couldn't open COM1\n"));
		return (FALSE);
	}

	// Print serial console status on LCD.
	DCB dcb;
	GetCommState(_handle, &dcb);
	Console::print(
		TEXT("BaudRate %d, ByteSize %#x, Parity %#x, StopBits %#x\n"),
		dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits);

	return (TRUE);
a103 1

a115 1

d124 2
a125 2
HANDLE
SerialConsole::OpenCOM1()
a126 3
	static HANDLE COM1handle = INVALID_HANDLE_VALUE;
	const char msg[] = "\r\n--------HPCBOOT--------\r\n";
	unsigned long wrote;
a127 1
	HANDLE h;
d129 14
a142 12
	if (COM1handle != INVALID_HANDLE_VALUE)
		return (COM1handle);

	h = CreateFile(TEXT("COM1:"), 
	    GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
	    NULL);
	if (h == INVALID_HANDLE_VALUE)
		return (h);

	DCB dcb;
	if (!GetCommState(h, &dcb))
		goto bad;
d144 13
a156 3
	dcb.BaudRate = speed;
	if (!SetCommState(h, &dcb))
		goto bad;
d158 1
a158 6
	// Print banner on serial console.
	WriteFile(h, msg, sizeof msg, &wrote, 0);

	COM1handle = h;

	return (h);
d160 3
a162 2
	CloseHandle(h);
	return (INVALID_HANDLE_VALUE);
@


1.6
log
@rework the way to set booted-console flag.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.5 2001/05/08 18:51:22 uch Exp $ */
d84 7
@


1.5
log
@KNF.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.4 2001/04/24 19:27:59 uch Exp $ */
d53 6
@


1.4
log
@code clean up.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.3 2001/03/25 17:13:16 uch Exp $ */
d90 1
a90 1
					 0, 0, 0, 0);
d117 3
a119 3
		_handle = CreateFile(TEXT("COM1:"),
				     GENERIC_READ | GENERIC_WRITE,
				     0, NULL, OPEN_EXISTING, 0, NULL);
d134 1
a134 1
				       speed);
d139 1
a139 2
			       dcb.BaudRate, dcb.ByteSize, dcb.Parity,
			       dcb.StopBits);
@


1.3
log
@selectable serial console speed.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.2 2001/03/22 18:19:09 uch Exp $ */
d44 3
a65 2
	TCHAR tmp[CONSOLE_BUFSIZE];

d68 1
a68 1
	wvsprintf(tmp, fmt, ap);
d70 14
a83 1
	HpcMenuInterface::Instance().print(tmp);
d87 1
a87 1
SerialConsole::setupBuffer()
d100 11
d114 1
a114 2
	HpcMenuInterface &menu = HpcMenuInterface::Instance();
	int speed = menu._pref.serial_speed;
@


1.2
log
@add machine independent serial console method. (use WinCE API)
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.1 2001/02/09 18:34:35 uch Exp $ */
d87 1
a87 1
SerialConsole::openCOM1(void)
d89 3
d107 1
a107 1
		dcb.BaudRate = CBR_19200;
d109 2
a110 1
			Console::print(TEXT("couldn't set baud rate to 19200.\n"));
@


1.1
log
@bootloader for SH3, SA-1100, TX39, VR41 based Windows CE(2.00 or later)
@
text
@d1 1
a1 1
/*	$NetBSD$	*/
d123 14
@


1.1.2.1
log
@file console.cpp was added on branch thorpej_scsipi on 2001-02-11 19:09:49 +0000
@
text
@d1 123
@


1.1.2.2
log
@Sync with HEAD.
@
text
@a0 123
/*	$NetBSD: console.cpp,v 1.1.2.1 2001/02/11 19:09:49 bouyer Exp $	*/

/*-
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by UCHIYAMA Yasushi.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <hpcmenu.h>
#include <console.h>

Console *Console::_instance = 0;

Console *
Console::Instance()
{
	if (_instance == 0)
		_instance = new Console;
	return _instance;
}

void
Console::Destroy()
{
	if (_instance)
		delete _instance;
	_instance = 0;
}

void
Console::print(const TCHAR *fmt, ...)
{
	TCHAR tmp[CONSOLE_BUFSIZE];

	va_list ap;
	va_start(ap, fmt);
	wvsprintf(tmp, fmt, ap);
	va_end(ap);
	HpcMenuInterface::Instance().print(tmp);
}

BOOL
SerialConsole::setupBuffer()
{
	size_t len = WideCharToMultiByte(CP_ACP, 0, _bufw, wcslen(_bufw),
					 0, 0, 0, 0);
	if (len + 1 > CONSOLE_BUFSIZE)
		return FALSE;
	if (!WideCharToMultiByte(CP_ACP, 0, _bufw, len, _bufm, len, 0, 0))
		return FALSE;
	_bufm[len] = '\0';

	return TRUE;
}

BOOL
SerialConsole::openCOM1(void)
{
	if (_handle == INVALID_HANDLE_VALUE) {
		_handle = CreateFile(TEXT("COM1:"),
				     GENERIC_READ | GENERIC_WRITE,
				     0, NULL, OPEN_EXISTING, 0, NULL);
		if (_handle == INVALID_HANDLE_VALUE) {
			Console::print(TEXT("couldn't open COM1\n"));
			return FALSE;
		}

		DCB dcb;
		if (!GetCommState(_handle, &dcb)) {
			Console::print(TEXT("couldn't get COM port status.\n"));
			goto bad;
		}
      
		dcb.BaudRate = CBR_19200;
		if (!SetCommState(_handle, &dcb)) {
			Console::print(TEXT("couldn't set baud rate to 19200.\n"));
			goto bad;
		}

		Console::print(TEXT("BaudRate %d, ByteSize %#x, Parity %#x, StopBits %#x\n"),
			       dcb.BaudRate, dcb.ByteSize, dcb.Parity,
			       dcb.StopBits);
		const char msg[] = "--------HPCBOOT--------\r\n";
		unsigned long wrote;
		WriteFile(_handle, msg, sizeof msg, &wrote, 0);
	}

	return TRUE;
 bad:
	CloseHandle(_handle);
	_handle = INVALID_HANDLE_VALUE;
	return FALSE;
}
@


1.1.2.3
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.1.2.2 2001/03/27 15:30:47 bouyer Exp $ */
d87 1
a87 1
SerialConsole::openCOM1()
a88 3
	HpcMenuInterface &menu = HpcMenuInterface::Instance();
	int speed = menu._pref.serial_speed;

d104 1
a104 1
		dcb.BaudRate = speed;
d106 1
a106 2
			Console::print(TEXT("couldn't set baud rate to %s.\n"),
				       speed);
a123 14

void
SerialConsole::genericPrint(const char *buf)
{
	unsigned long wrote;
	int i;
	
	for (i = 0; *buf != '\0'; buf++) {
		char c = *buf;
		if (c == '\n')
			WriteFile(_handle, "\r", 1, &wrote, 0);
		WriteFile(_handle, &c, 1, &wrote, 0);
	}
}
@


1.1.4.1
log
@Catch up with -current.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.3 2001/03/25 17:13:16 uch Exp $ */
d87 1
a87 1
SerialConsole::openCOM1()
a88 3
	HpcMenuInterface &menu = HpcMenuInterface::Instance();
	int speed = menu._pref.serial_speed;

d104 1
a104 1
		dcb.BaudRate = speed;
d106 1
a106 2
			Console::print(TEXT("couldn't set baud rate to %s.\n"),
				       speed);
a122 14
}

void
SerialConsole::genericPrint(const char *buf)
{
	unsigned long wrote;
	int i;
	
	for (i = 0; *buf != '\0'; buf++) {
		char c = *buf;
		if (c == '\n')
			WriteFile(_handle, "\r", 1, &wrote, 0);
		WriteFile(_handle, &c, 1, &wrote, 0);
	}
@


1.1.4.2
log
@Catch up to -current.
@
text
@d1 1
a1 1
/* -*-C++-*-	$NetBSD: console.cpp,v 1.1.4.1 2001/04/09 01:52:36 nathanw Exp $ */
a43 3
//
// Display console
//
a51 6
Console::Console()
{
	// set default builtin console. (bicons)
	setBootConsole(BI_CNUSE_BUILTIN);
}

d63 2
d67 1
a67 1
	wvsprintf(_bufw, fmt, ap);
d69 1
a69 21

	// print to `Console Tab Window'
	HPC_MENU.print(_bufw);
}

//
// Serial console.
//
SerialConsole::SerialConsole()
{
	_handle = INVALID_HANDLE_VALUE;
	// set default serial console.
	setBootConsole(BI_CNUSE_SERIAL);
}

BOOL
SerialConsole::init()
{
	// always open COM1 to supply clock and power for the
	// sake of kernel serial driver 
	return openCOM1();
d73 1
a73 1
SerialConsole::setupMultibyteBuffer()
d76 1
a76 1
	    0, 0, 0, 0);
a85 11
void
SerialConsole::print(const TCHAR *fmt, ...)
{
	SETUP_WIDECHAR_BUFFER();

	if (!setupMultibyteBuffer())
		return;

	genericPrint(_bufm);
}

d89 2
a90 1
	int speed = HPC_PREFERENCE.serial_speed;
d93 3
a95 3
		_handle = CreateFile(TEXT("COM1:"), 
		    GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
		    NULL);
d110 1
a110 1
			    speed);
d115 2
a116 1
		    dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits);
@
