head	1.15;
access;
symbols
	netbsd-11-0-RC4:1.15
	netbsd-11-0-RC3:1.15
	netbsd-11-0-RC2:1.15
	netbsd-11-0-RC1:1.15
	perseant-exfatfs-base-20250801:1.15
	netbsd-11:1.15.0.126
	netbsd-11-base:1.15
	netbsd-10-1-RELEASE:1.15
	perseant-exfatfs-base-20240630:1.15
	perseant-exfatfs:1.15.0.124
	perseant-exfatfs-base:1.15
	netbsd-8-3-RELEASE:1.15
	netbsd-9-4-RELEASE:1.15
	netbsd-10-0-RELEASE:1.15
	netbsd-10-0-RC6:1.15
	netbsd-10-0-RC5:1.15
	netbsd-10-0-RC4:1.15
	netbsd-10-0-RC3:1.15
	netbsd-10-0-RC2:1.15
	thorpej-ifq:1.15.0.122
	thorpej-ifq-base:1.15
	thorpej-altq-separation:1.15.0.120
	thorpej-altq-separation-base:1.15
	netbsd-10-0-RC1:1.15
	netbsd-10:1.15.0.118
	netbsd-10-base:1.15
	bouyer-sunxi-drm:1.15.0.116
	bouyer-sunxi-drm-base:1.15
	netbsd-9-3-RELEASE:1.15
	thorpej-i2c-spi-conf2:1.15.0.114
	thorpej-i2c-spi-conf2-base:1.15
	thorpej-futex2:1.15.0.112
	thorpej-futex2-base:1.15
	thorpej-cfargs2:1.15.0.110
	thorpej-cfargs2-base:1.15
	cjep_sun2x-base1:1.15
	cjep_sun2x:1.15.0.108
	cjep_sun2x-base:1.15
	cjep_staticlib_x-base1:1.15
	netbsd-9-2-RELEASE:1.15
	cjep_staticlib_x:1.15.0.106
	cjep_staticlib_x-base:1.15
	thorpej-i2c-spi-conf:1.15.0.104
	thorpej-i2c-spi-conf-base:1.15
	thorpej-cfargs:1.15.0.102
	thorpej-cfargs-base:1.15
	thorpej-futex:1.15.0.100
	thorpej-futex-base:1.15
	netbsd-9-1-RELEASE:1.15
	bouyer-xenpvh-base2:1.15
	phil-wifi-20200421:1.15
	bouyer-xenpvh-base1:1.15
	phil-wifi-20200411:1.15
	bouyer-xenpvh:1.15.0.98
	bouyer-xenpvh-base:1.15
	is-mlppp:1.15.0.96
	is-mlppp-base:1.15
	phil-wifi-20200406:1.15
	netbsd-8-2-RELEASE:1.15
	ad-namecache-base3:1.15
	netbsd-9-0-RELEASE:1.15
	netbsd-9-0-RC2:1.15
	ad-namecache-base2:1.15
	ad-namecache-base1:1.15
	ad-namecache:1.15.0.94
	ad-namecache-base:1.15
	netbsd-9-0-RC1:1.15
	phil-wifi-20191119:1.15
	netbsd-9:1.15.0.92
	netbsd-9-base:1.15
	phil-wifi-20190609:1.15
	netbsd-8-1-RELEASE:1.15
	netbsd-8-1-RC1:1.15
	isaki-audio2:1.15.0.90
	isaki-audio2-base:1.15
	pgoyette-compat-merge-20190127:1.15
	pgoyette-compat-20190127:1.15
	pgoyette-compat-20190118:1.15
	pgoyette-compat-1226:1.15
	pgoyette-compat-1126:1.15
	pgoyette-compat-1020:1.15
	pgoyette-compat-0930:1.15
	pgoyette-compat-0906:1.15
	netbsd-7-2-RELEASE:1.15
	pgoyette-compat-0728:1.15
	netbsd-8-0-RELEASE:1.15
	phil-wifi:1.15.0.88
	phil-wifi-base:1.15
	pgoyette-compat-0625:1.15
	netbsd-8-0-RC2:1.15
	pgoyette-compat-0521:1.15
	pgoyette-compat-0502:1.15
	pgoyette-compat-0422:1.15
	netbsd-8-0-RC1:1.15
	pgoyette-compat-0415:1.15
	pgoyette-compat-0407:1.15
	pgoyette-compat-0330:1.15
	pgoyette-compat-0322:1.15
	pgoyette-compat-0315:1.15
	netbsd-7-1-2-RELEASE:1.15
	pgoyette-compat:1.15.0.86
	pgoyette-compat-base:1.15
	netbsd-7-1-1-RELEASE:1.15
	tls-maxphys-base-20171202:1.15
	matt-nb8-mediatek:1.15.0.84
	matt-nb8-mediatek-base:1.15
	nick-nhusb-base-20170825:1.15
	perseant-stdc-iso10646:1.15.0.82
	perseant-stdc-iso10646-base:1.15
	netbsd-8:1.15.0.80
	netbsd-8-base:1.15
	prg-localcount2-base3:1.15
	prg-localcount2-base2:1.15
	prg-localcount2-base1:1.15
	prg-localcount2:1.15.0.78
	prg-localcount2-base:1.15
	pgoyette-localcount-20170426:1.15
	bouyer-socketcan-base1:1.15
	jdolecek-ncq:1.15.0.76
	jdolecek-ncq-base:1.15
	pgoyette-localcount-20170320:1.15
	netbsd-7-1:1.15.0.74
	netbsd-7-1-RELEASE:1.15
	netbsd-7-1-RC2:1.15
	nick-nhusb-base-20170204:1.15
	netbsd-7-nhusb-base-20170116:1.15
	bouyer-socketcan:1.15.0.72
	bouyer-socketcan-base:1.15
	pgoyette-localcount-20170107:1.15
	netbsd-7-1-RC1:1.15
	nick-nhusb-base-20161204:1.15
	pgoyette-localcount-20161104:1.15
	netbsd-7-0-2-RELEASE:1.15
	nick-nhusb-base-20161004:1.15
	localcount-20160914:1.15
	netbsd-7-nhusb:1.15.0.70
	netbsd-7-nhusb-base:1.15
	pgoyette-localcount-20160806:1.15
	pgoyette-localcount-20160726:1.15
	pgoyette-localcount:1.15.0.68
	pgoyette-localcount-base:1.15
	nick-nhusb-base-20160907:1.15
	nick-nhusb-base-20160529:1.15
	netbsd-7-0-1-RELEASE:1.15
	nick-nhusb-base-20160422:1.15
	nick-nhusb-base-20160319:1.15
	nick-nhusb-base-20151226:1.15
	netbsd-7-0:1.15.0.66
	netbsd-7-0-RELEASE:1.15
	nick-nhusb-base-20150921:1.15
	netbsd-7-0-RC3:1.15
	netbsd-7-0-RC2:1.15
	netbsd-7-0-RC1:1.15
	nick-nhusb-base-20150606:1.15
	nick-nhusb-base-20150406:1.15
	nick-nhusb:1.15.0.64
	nick-nhusb-base:1.15
	netbsd-5-2-3-RELEASE:1.15
	netbsd-5-1-5-RELEASE:1.15
	netbsd-6-0-6-RELEASE:1.15
	netbsd-6-1-5-RELEASE:1.15
	netbsd-7:1.15.0.62
	netbsd-7-base:1.15
	yamt-pagecache-base9:1.15
	yamt-pagecache-tag8:1.15
	netbsd-6-1-4-RELEASE:1.15
	netbsd-6-0-5-RELEASE:1.15
	tls-earlyentropy:1.15.0.60
	tls-earlyentropy-base:1.15
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.15
	riastradh-drm2-base3:1.15
	netbsd-6-1-3-RELEASE:1.15
	netbsd-6-0-4-RELEASE:1.15
	netbsd-5-2-2-RELEASE:1.15
	netbsd-5-1-4-RELEASE:1.15
	netbsd-6-1-2-RELEASE:1.15
	netbsd-6-0-3-RELEASE:1.15
	netbsd-5-2-1-RELEASE:1.15
	netbsd-5-1-3-RELEASE:1.15
	rmind-smpnet-nbase:1.15
	netbsd-6-1-1-RELEASE:1.15
	riastradh-drm2-base2:1.15
	riastradh-drm2-base1:1.15
	riastradh-drm2:1.15.0.58
	riastradh-drm2-base:1.15
	rmind-smpnet:1.15.0.50
	rmind-smpnet-base:1.15
	netbsd-6-1:1.15.0.56
	netbsd-6-0-2-RELEASE:1.15
	netbsd-6-1-RELEASE:1.15
	khorben-n900:1.15.0.54
	netbsd-6-1-RC4:1.15
	netbsd-6-1-RC3:1.15
	agc-symver:1.15.0.52
	agc-symver-base:1.15
	netbsd-6-1-RC2:1.15
	netbsd-6-1-RC1:1.15
	yamt-pagecache-base8:1.15
	netbsd-5-2:1.15.0.48
	netbsd-6-0-1-RELEASE:1.15
	yamt-pagecache-base7:1.15
	netbsd-5-2-RELEASE:1.15
	netbsd-5-2-RC1:1.15
	matt-nb6-plus-nbase:1.15
	yamt-pagecache-base6:1.15
	netbsd-6-0:1.15.0.46
	netbsd-6-0-RELEASE:1.15
	netbsd-6-0-RC2:1.15
	tls-maxphys:1.15.0.44
	tls-maxphys-base:1.15
	matt-nb6-plus:1.15.0.42
	matt-nb6-plus-base:1.15
	netbsd-6-0-RC1:1.15
	jmcneill-usbmp-base10:1.15
	yamt-pagecache-base5:1.15
	jmcneill-usbmp-base9:1.15
	yamt-pagecache-base4:1.15
	jmcneill-usbmp-base8:1.15
	jmcneill-usbmp-base7:1.15
	jmcneill-usbmp-base6:1.15
	jmcneill-usbmp-base5:1.15
	jmcneill-usbmp-base4:1.15
	jmcneill-usbmp-base3:1.15
	jmcneill-usbmp-pre-base2:1.15
	jmcneill-usbmp-base2:1.15
	netbsd-6:1.15.0.40
	netbsd-6-base:1.15
	netbsd-5-1-2-RELEASE:1.15
	netbsd-5-1-1-RELEASE:1.15
	jmcneill-usbmp:1.15.0.38
	jmcneill-usbmp-base:1.15
	jmcneill-audiomp3:1.15.0.36
	jmcneill-audiomp3-base:1.15
	yamt-pagecache-base3:1.15
	yamt-pagecache-base2:1.15
	yamt-pagecache:1.15.0.34
	yamt-pagecache-base:1.15
	rmind-uvmplock-nbase:1.15
	cherry-xenmp:1.15.0.32
	cherry-xenmp-base:1.15
	jym-xensuspend-nbase:1.15
	uebayasi-xip-base7:1.15
	bouyer-quota2-nbase:1.15
	bouyer-quota2:1.15.0.30
	bouyer-quota2-base:1.15
	jruoho-x86intr:1.15.0.28
	jruoho-x86intr-base:1.15
	matt-mips64-premerge-20101231:1.15
	matt-nb5-mips64-premerge-20101231:1.15
	matt-nb5-pq3:1.15.0.26
	matt-nb5-pq3-base:1.15
	netbsd-5-1:1.15.0.24
	uebayasi-xip-base6:1.15
	uebayasi-xip-base5:1.15
	netbsd-5-1-RELEASE:1.15
	uebayasi-xip-base4:1.15
	uebayasi-xip-base3:1.15
	yamt-nfs-mp-base11:1.15
	netbsd-5-1-RC4:1.15
	matt-nb5-mips64-k15:1.15
	uebayasi-xip-base2:1.15
	yamt-nfs-mp-base10:1.15
	netbsd-5-1-RC3:1.15
	netbsd-5-1-RC2:1.15
	uebayasi-xip-base1:1.15
	netbsd-5-1-RC1:1.15
	rmind-uvmplock:1.15.0.22
	rmind-uvmplock-base:1.15
	yamt-nfs-mp-base9:1.15
	uebayasi-xip:1.15.0.20
	uebayasi-xip-base:1.15
	netbsd-5-0-2-RELEASE:1.15
	matt-nb5-mips64-premerge-20091211:1.15
	matt-premerge-20091211:1.15
	yamt-nfs-mp-base8:1.15
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.15
	matt-nb4-mips64-k7-u2a-k9b:1.15
	matt-nb5-mips64-u1-k1-k5:1.15
	yamt-nfs-mp-base7:1.15
	matt-nb5-mips64:1.15.0.18
	netbsd-5-0-1-RELEASE:1.15
	jymxensuspend-base:1.15
	yamt-nfs-mp-base6:1.15
	yamt-nfs-mp-base5:1.15
	yamt-nfs-mp-base4:1.15
	yamt-nfs-mp-base3:1.15
	nick-hppapmap-base4:1.15
	nick-hppapmap-base3:1.15
	netbsd-5-0:1.15.0.16
	netbsd-5-0-RELEASE:1.15
	netbsd-5-0-RC4:1.15
	netbsd-5-0-RC3:1.15
	nick-hppapmap-base2:1.15
	netbsd-5-0-RC2:1.15
	jym-xensuspend:1.15.0.14
	jym-xensuspend-base:1.15
	netbsd-5-0-RC1:1.15
	haad-dm-base2:1.15
	haad-nbase2:1.15
	ad-audiomp2:1.15.0.12
	ad-audiomp2-base:1.15
	netbsd-5:1.15.0.10
	netbsd-5-base:1.15
	nick-hppapmap:1.15.0.8
	nick-hppapmap-base:1.15
	matt-mips64-base2:1.15
	haad-dm-base1:1.15
	wrstuden-revivesa-base-4:1.15
	netbsd-4-0-1-RELEASE:1.13
	wrstuden-revivesa-base-3:1.15
	wrstuden-revivesa-base-2:1.15
	wrstuden-fixsa-newbase:1.13
	nick-csl-alignment-base5:1.13
	haad-dm:1.15.0.6
	haad-dm-base:1.15
	wrstuden-revivesa-base-1:1.15
	simonb-wapbl-nbase:1.15
	yamt-pf42-base4:1.15
	simonb-wapbl:1.15.0.4
	simonb-wapbl-base:1.15
	yamt-pf42-base3:1.15
	hpcarm-cleanup-nbase:1.15
	yamt-pf42-baseX:1.14
	yamt-pf42-base2:1.15
	yamt-nfs-mp-base2:1.15
	wrstuden-revivesa:1.15.0.2
	wrstuden-revivesa-base:1.15
	yamt-nfs-mp:1.14.0.4
	yamt-nfs-mp-base:1.14
	yamt-pf42:1.14.0.2
	yamt-pf42-base:1.14
	ad-socklock-base1:1.14
	yamt-lazymbuf-base15:1.14
	yamt-lazymbuf-base14:1.14
	keiichi-mipv6-nbase:1.14
	mjf-devfs2:1.13.0.68
	mjf-devfs2-base:1.15
	nick-net80211-sync:1.13.0.66
	nick-net80211-sync-base:1.13
	keiichi-mipv6:1.13.0.64
	keiichi-mipv6-base:1.14
	bouyer-xeni386-merge1:1.13
	matt-armv6-prevmlocking:1.13
	wrstuden-fixsa-base-1:1.13
	vmlocking2-base3:1.13
	netbsd-4-0:1.13.0.62
	netbsd-4-0-RELEASE:1.13
	bouyer-xeni386-nbase:1.13
	yamt-kmem-base3:1.13
	cube-autoconf:1.13.0.60
	cube-autoconf-base:1.13
	yamt-kmem-base2:1.13
	bouyer-xeni386:1.13.0.58
	bouyer-xeni386-base:1.13
	yamt-kmem:1.13.0.56
	yamt-kmem-base:1.13
	vmlocking2-base2:1.13
	reinoud-bufcleanup-nbase:1.13
	vmlocking2:1.13.0.54
	vmlocking2-base1:1.13
	netbsd-4-0-RC5:1.13
	matt-nb4-arm:1.13.0.52
	matt-nb4-arm-base:1.13
	matt-armv6-nbase:1.14
	jmcneill-base:1.13
	netbsd-4-0-RC4:1.13
	mjf-devfs:1.13.0.50
	mjf-devfs-base:1.13
	bouyer-xenamd64-base2:1.13
	vmlocking-nbase:1.13
	yamt-x86pmap-base4:1.13
	bouyer-xenamd64:1.13.0.48
	bouyer-xenamd64-base:1.13
	netbsd-4-0-RC3:1.13
	yamt-x86pmap-base3:1.13
	yamt-x86pmap-base2:1.13
	netbsd-4-0-RC2:1.13
	yamt-x86pmap:1.13.0.46
	yamt-x86pmap-base:1.13
	netbsd-4-0-RC1:1.13
	matt-armv6:1.13.0.44
	matt-armv6-base:1.13
	jmcneill-pm:1.13.0.42
	jmcneill-pm-base:1.13
	hpcarm-cleanup:1.13.0.40
	hpcarm-cleanup-base:1.13
	nick-csl-alignment:1.13.0.38
	nick-csl-alignment-base:1.13
	matt-mips64:1.13.0.36
	matt-mips64-base:1.13
	netbsd-3-1-1-RELEASE:1.7
	netbsd-3-0-3-RELEASE:1.7
	yamt-idlelwp-base8:1.13
	wrstuden-fixsa:1.13.0.34
	wrstuden-fixsa-base:1.13
	ppcoea-renovation:1.13.0.32
	ppcoea-renovation-base:1.13
	thorpej-atomic:1.13.0.30
	thorpej-atomic-base:1.13
	reinoud-bufcleanup:1.13.0.28
	reinoud-bufcleanup-base:1.13
	mjf-ufs-trans:1.13.0.26
	mjf-ufs-trans-base:1.13
	vmlocking:1.13.0.24
	vmlocking-base:1.13
	ad-audiomp:1.13.0.22
	ad-audiomp-base:1.13
	yamt-idlelwp:1.13.0.20
	post-newlock2-merge:1.13
	newlock2-nbase:1.13
	yamt-splraiseipl-base5:1.13
	yamt-splraiseipl-base4:1.13
	yamt-splraiseipl-base3:1.13
	abandoned-netbsd-4-base:1.13
	abandoned-netbsd-4:1.13.0.12
	netbsd-3-1:1.7.0.22
	netbsd-3-1-RELEASE:1.7
	netbsd-3-0-2-RELEASE:1.7
	yamt-splraiseipl-base2:1.13
	netbsd-3-1-RC4:1.7
	yamt-splraiseipl:1.13.0.16
	yamt-splraiseipl-base:1.13
	netbsd-3-1-RC3:1.7
	yamt-pdpolicy-base9:1.13
	newlock2:1.13.0.14
	newlock2-base:1.13
	yamt-pdpolicy-base8:1.13
	netbsd-3-1-RC2:1.7
	netbsd-3-1-RC1:1.7
	yamt-pdpolicy-base7:1.13
	netbsd-4:1.13.0.18
	netbsd-4-base:1.13
	yamt-pdpolicy-base6:1.13
	chap-midi-nbase:1.13
	netbsd-3-0-1-RELEASE:1.7
	gdamore-uart:1.13.0.10
	gdamore-uart-base:1.13
	simonb-timcounters-final:1.12.4.1
	yamt-pdpolicy-base5:1.13
	chap-midi:1.13.0.8
	chap-midi-base:1.13
	yamt-pdpolicy-base4:1.13
	yamt-pdpolicy-base3:1.13
	peter-altq-base:1.13
	peter-altq:1.13.0.6
	yamt-pdpolicy-base2:1.13
	elad-kernelauth-base:1.13
	elad-kernelauth:1.13.0.4
	yamt-pdpolicy:1.13.0.2
	yamt-pdpolicy-base:1.13
	yamt-uio_vmspace-base5:1.13
	simonb-timecounters:1.12.0.4
	simonb-timecounters-base:1.13
	rpaulo-netinet-merge-pcb:1.12.0.2
	rpaulo-netinet-merge-pcb-base:1.13
	yamt-uio_vmspace:1.8.0.2
	netbsd-3-0:1.7.0.20
	netbsd-3-0-RELEASE:1.7
	netbsd-3-0-RC6:1.7
	yamt-readahead-base3:1.7
	netbsd-3-0-RC5:1.7
	netbsd-3-0-RC4:1.7
	netbsd-3-0-RC3:1.7
	yamt-readahead-base2:1.7
	netbsd-3-0-RC2:1.7
	yamt-readahead-pervnode:1.7
	yamt-readahead-perfile:1.7
	yamt-readahead:1.7.0.18
	yamt-readahead-base:1.7
	netbsd-3-0-RC1:1.7
	yamt-vop-base3:1.7
	netbsd-2-0-3-RELEASE:1.6
	netbsd-2-1:1.6.0.6
	yamt-vop-base2:1.7
	thorpej-vnode-attr:1.7.0.16
	thorpej-vnode-attr-base:1.7
	netbsd-2-1-RELEASE:1.6
	yamt-vop:1.7.0.14
	yamt-vop-base:1.7
	netbsd-2-1-RC6:1.6
	netbsd-2-1-RC5:1.6
	netbsd-2-1-RC4:1.6
	netbsd-2-1-RC3:1.6
	netbsd-2-1-RC2:1.6
	netbsd-2-1-RC1:1.6
	yamt-lazymbuf:1.7.0.12
	yamt-km-base4:1.7
	netbsd-2-0-2-RELEASE:1.6
	yamt-km-base3:1.7
	netbsd-3:1.7.0.10
	netbsd-3-base:1.7
	yamt-km-base2:1.7
	yamt-km:1.7.0.6
	yamt-km-base:1.7
	kent-audio2:1.7.0.4
	kent-audio2-base:1.7
	netbsd-2-0-1-RELEASE:1.6
	kent-audio1-beforemerge:1.7
	netbsd-2:1.6.0.4
	netbsd-2-base:1.6
	kent-audio1:1.7.0.2
	kent-audio1-base:1.7
	netbsd-2-0-RELEASE:1.6
	netbsd-2-0-RC5:1.6
	netbsd-2-0-RC4:1.6
	netbsd-2-0-RC3:1.6
	netbsd-2-0-RC2:1.6
	netbsd-2-0-RC1:1.6
	netbsd-2-0:1.6.0.2
	netbsd-2-0-base:1.6
	netbsd-1-6-PATCH002-RELEASE:1.5
	netbsd-1-6-PATCH002:1.5
	netbsd-1-6-PATCH002-RC4:1.5
	netbsd-1-6-PATCH002-RC3:1.5
	netbsd-1-6-PATCH002-RC2:1.5
	netbsd-1-6-PATCH002-RC1:1.5
	ktrace-lwp:1.5.0.16
	ktrace-lwp-base:1.7
	netbsd-1-6-PATCH001:1.5
	netbsd-1-6-PATCH001-RELEASE:1.5
	netbsd-1-6-PATCH001-RC3:1.5
	netbsd-1-6-PATCH001-RC2:1.5
	netbsd-1-6-PATCH001-RC1:1.5
	nathanw_sa_end:1.4.8.2
	nathanw_sa_before_merge:1.5
	fvdl_fs64_base:1.5
	gmcgarry_ctxsw:1.5.0.14
	gmcgarry_ctxsw_base:1.5
	gmcgarry_ucred:1.5.0.12
	gmcgarry_ucred_base:1.5
	nathanw_sa_base:1.5
	kqueue-aftermerge:1.5
	kqueue-beforemerge:1.5
	netbsd-1-6-RELEASE:1.5
	netbsd-1-6-RC3:1.5
	netbsd-1-6-RC2:1.5
	netbsd-1-6-RC1:1.5
	netbsd-1-6:1.5.0.10
	netbsd-1-6-base:1.5
	gehenna-devsw:1.5.0.8
	gehenna-devsw-base:1.5
	eeh-devprop:1.5.0.6
	eeh-devprop-base:1.5
	newlock:1.5.0.4
	newlock-base:1.5
	ifpoll-base:1.5
	nathanw_sa:1.4.0.8
	thorpej-mips-cache:1.4.0.6
	thorpej-mips-cache-base:1.4
	thorpej-devvp-base3:1.4
	thorpej-devvp-base2:1.4
	post-chs-ubcperf:1.4
	pre-chs-ubcperf:1.4
	thorpej-devvp:1.4.0.4
	thorpej-devvp-base:1.4
	kqueue:1.4.0.2
	kqueue-base:1.5
	thorpej_scsipi_beforemerge:1.3
	thorpej_scsipi_base:1.3
	thorpej_scsipi:1.1.0.2
	thorpej_scsipi_nbase:1.3;
locks; strict;
comment	@// @;


1.15
date	2008.04.28.20.23.20;	author martin;	state Exp;
branches;
next	1.14;

1.14
date	2008.03.08.02.17.48;	author rafal;	state Exp;
branches
	1.14.2.1
	1.14.4.1;
next	1.13;

1.13
date	2006.02.20.03.09.05;	author uwe;	state Exp;
branches
	1.13.44.1
	1.13.64.1
	1.13.68.1;
next	1.12;

1.12
date	2006.01.15.02.20.35;	author uwe;	state Exp;
branches
	1.12.2.1
	1.12.4.1;
next	1.11;

1.11
date	2006.01.15.00.07.49;	author uwe;	state Exp;
branches;
next	1.10;

1.10
date	2006.01.15.00.06.39;	author uwe;	state Exp;
branches;
next	1.9;

1.9
date	2006.01.14.23.22.53;	author uwe;	state Exp;
branches;
next	1.8;

1.8
date	2005.12.11.12.17.28;	author christos;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2004.08.06.18.33.09;	author uch;	state Exp;
branches
	1.7.12.1;
next	1.6;

1.6
date	2004.02.27.02.02.16;	author uwe;	state Exp;
branches;
next	1.5;

1.5
date	2002.02.11.17.05.45;	author uch;	state Exp;
branches
	1.5.16.1;
next	1.4;

1.4
date	2001.05.08.18.51.22;	author uch;	state Exp;
branches
	1.4.2.1
	1.4.8.1;
next	1.3;

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

1.2
date	2001.03.21.14.06.25;	author toshii;	state Exp;
branches;
next	1.1;

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

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

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

1.13.44.1
date	2008.03.23.02.04.03;	author matt;	state Exp;
branches;
next	;

1.13.64.1
date	2008.03.24.07.14.57;	author keiichi;	state Exp;
branches;
next	;

1.13.68.1
date	2008.04.03.12.42.16;	author mjf;	state Exp;
branches;
next	1.13.68.2;

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

1.12.2.1
date	2006.09.09.02.39.27;	author rpaulo;	state Exp;
branches;
next	;

1.12.4.1
date	2006.04.22.11.37.28;	author simonb;	state Exp;
branches;
next	;

1.8.2.1
date	2006.01.15.10.02.37;	author yamt;	state Exp;
branches;
next	1.8.2.2;

1.8.2.2
date	2006.03.01.09.27.54;	author yamt;	state Exp;
branches;
next	;

1.7.12.1
date	2006.06.21.14.51.38;	author yamt;	state Exp;
branches;
next	1.7.12.2;

1.7.12.2
date	2008.03.17.09.14.17;	author yamt;	state Exp;
branches;
next	;

1.5.16.1
date	2004.08.03.10.34.59;	author skrll;	state Exp;
branches;
next	1.5.16.2;

1.5.16.2
date	2004.08.12.11.41.05;	author skrll;	state Exp;
branches;
next	1.5.16.3;

1.5.16.3
date	2004.09.18.14.34.39;	author skrll;	state Exp;
branches;
next	1.5.16.4;

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

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

1.4.8.1
date	2001.05.08.18.51.22;	author nathanw;	state dead;
branches;
next	1.4.8.2;

1.4.8.2
date	2002.02.28.04.09.45;	author nathanw;	state Exp;
branches;
next	;

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

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

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

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

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


desc
@@


1.15
log
@Remove clause 3 and 4 from TNF licenses
@
text
@/*	$NetBSD: load.cpp,v 1.14 2008/03/08 02:17:48 rafal 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.
 *
 * 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 <load.h>
#include <exec_coff.h>
#undef DPRINTF // trash coff_machdep.h 's define.

#include <console.h>
#include <memory.h>
#include <file.h>

#include <exec_elf.h>

Loader::Loader(Console *&cons, MemoryManager *&mem)
	: _mem(mem), _cons(cons)
{
	_file = 0;
	_page_tag_start = 0;
}

LoaderOps
Loader::objectFormat(File &file)
{
	union {
		Elf_Ehdr elf;
		coff_exechdr coff;
	} header;
	file.read(reinterpret_cast<void *>(&header), sizeof(header), 0);

	if (header.elf.e_ident[EI_MAG0] == ELFMAG0 &&
	    header.elf.e_ident[EI_MAG1] == ELFMAG1 &&
	    header.elf.e_ident[EI_MAG2] == ELFMAG2 &&
	    header.elf.e_ident[EI_MAG3] == ELFMAG3)
		return LOADER_ELF;
#ifdef COFF_BADMAG
	if (!COFF_BADMAG(&header.coff.f))
		return LOADER_COFF;
#endif // COFF_BADMAG

	return LOADER_UNKNOWN;
}

BOOL
Loader::loadExtData(void)
{
	size_t sz;
	vaddr_t kv;

	sz = _file->realsize();
	kv = ROUND(_kernend, static_cast <vsize_t>(KERNEL_PAGE_SIZE));

	DPRINTF((TEXT("[file system image]\n")));
	_load_segment(kv, sz, 0, sz);

	return _load_success();
}

void
Loader::loadEnd(void)
{
	/* tag chain end */
	_load_segment_end();
}

void
Loader::tagDump(int n)
{
#ifdef PAGE_LINK_DUMP
	struct PageTag *p, *op;
	int i = 0;

	DPRINTF((TEXT("page tag start physical address: 0x%08x\n"),
	    _page_tag_start));
	p = reinterpret_cast <struct PageTag *>(_page_tag_start);
	do  {
		if (i < n || p->src == ~0)
			DPRINTF((TEXT("[%d] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
			    i, p->next, p->src, p->dst, p->sz));
		else if (i == n)
			DPRINTF((TEXT("[...]\n")));
		op = p;
		i++;
	} while ((p = reinterpret_cast <struct PageTag *>(p->next)) != ~0);

	DPRINTF((TEXT("[%d(last)] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
	    i - 1, op->next, op->src, op->dst, op->sz));
#endif // PAGE_LINK_DUMP
}

paddr_t
Loader::tagStart(void)
{
	return _page_tag_start;
}

void
Loader::_load_segment_start(void)
{
	vaddr_t v;
	paddr_t p;

	_error = FALSE;
	_nload_link = _n0clr_link = 0;
	_tpsz = _mem->getTaggedPageSize();

	// start of chain.
	if (!_mem->getTaggedPage(v, p, &_pvec_clr, _pvec_clr_paddr))
		_error = TRUE;
#ifdef PAGE_LINK_DUMP
	_page_tag_start = (uint32_t)_pvec_clr;
#else
	_page_tag_start = _pvec_clr_paddr;
#endif
	_pvec_prev = _pvec_clr++;
	_pvec_clr_paddr += sizeof(struct PageTag);
}

void
Loader::_load_segment_end(void)
{
	_opvec_prev->next = ~0; // terminate
	DPRINTF((TEXT("load link %d, zero clear link %d\n"),
	    _nload_link, _n0clr_link));
}

void
Loader::_load_segment(vaddr_t kv, vsize_t memsz, off_t fileofs, size_t filesz)
{
	int j, n;
	vaddr_t kv_start = kv;

	DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x ofs=0x%08x+0x%x\n"),
	    kv, memsz, kv + memsz, fileofs, filesz));
	_kernend = kv + memsz;

	if (filesz) {
		n = filesz / _tpsz;
		for (j = 0; j < n; j++) {
			_opvec_prev = _pvec_prev;
			_pvec_prev = _load_page(kv, fileofs,
			    _tpsz, _pvec_prev);
			kv += _tpsz;
			fileofs += _tpsz;
			++_nload_link;
		}
		size_t rest = filesz % _tpsz;
		if (rest) {
			_opvec_prev = _pvec_prev;
			_pvec_prev = _load_page(kv, fileofs, rest, _pvec_prev);
			++_nload_link;
		}
	}

	// zero clear tag
	if (filesz < memsz) {
		_pvec_prev->src = ~0;
		_pvec_prev->dst = kv_start + filesz;
		_pvec_prev->sz = memsz - filesz;
#ifdef PAGE_LINK_DUMP
		_pvec_prev->next = (uint32_t)_pvec_clr;
#else
		_pvec_prev->next = ptokv(_pvec_clr_paddr);
#endif
		DPRINTF((TEXT("\t->zero 0x%08x+0x%08x=0x%08x\n"),
		    _pvec_prev->dst, _pvec_prev->sz,
		    _pvec_prev->dst + _pvec_prev->sz));
		_opvec_prev = _pvec_prev;
		_pvec_prev = _pvec_clr++;
		_pvec_clr_paddr += sizeof(struct PageTag);
		++_n0clr_link;
	}
}

void
Loader::_load_memory(vaddr_t kv, vsize_t memsz, void *data)
{
	struct PageTag *pvec;
	paddr_t p, pvec_paddr;
	vaddr_t v;
	vaddr_t dst;
	vsize_t remsz;

	DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x\n"),
	    kv, memsz, kv + memsz));

	dst = kv;
	remsz = memsz;
	while (remsz > 0) {
		_opvec_prev = _pvec_prev;
		if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
			_error = TRUE;

		vsize_t tocopy = (remsz < _tpsz) ? remsz : _tpsz;
		memcpy((void *)v, data, tocopy);
		_pvec_prev->src = ptokv(p);
		_pvec_prev->dst = dst;
		_pvec_prev->sz = tocopy;
#ifdef PAGE_LINK_DUMP
		_pvec_prev->next = (uint32_t)pvec;
#else
		_pvec_prev->next = ptokv(pvec_paddr);
#endif
		data = (char *)data + tocopy;
		dst += tocopy;
		remsz -= tocopy;

		_pvec_prev = pvec;
		++_nload_link;
	}

	_kernend = kv + memsz;
}

struct PageTag *
Loader::_load_page(vaddr_t kv, off_t ofs, size_t sz, struct PageTag *prev)
{
	struct PageTag *pvec;
	paddr_t p, pvec_paddr;
	vaddr_t v;

	if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
		_error = TRUE;
	_file->read((void *)v, sz, ofs);
	prev->src = ptokv(p);
	prev->dst = kv;
	prev->sz = sz;
#ifdef PAGE_LINK_DUMP
	prev->next = (uint32_t)pvec;
#else
	prev->next = ptokv(pvec_paddr);
#endif

	return pvec;
}
@


1.14
log
@Increment the load-link counter in the right place (once for each link in
the tag chain added vs. just once each time load_memory() is called).
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.13 2006/02/20 03:09:05 uwe 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.14.2.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.14 2008/03/08 02:17:48 rafal Exp $	*/
d18 7
@


1.14.4.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.14 2008/03/08 02:17:48 rafal Exp $	*/
d18 7
@


1.13
log
@Use comma in debug message in _load_segment_end to make it more readable.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.12 2006/01/15 02:20:35 uwe Exp $	*/
d243 1
a246 1
	++_nload_link;
@


1.13.68.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD$	*/
a242 1
		++_nload_link;
d246 1
@


1.13.68.2
log
@Sync with HEAD.
@
text
@d18 7
@


1.13.64.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.14 2008/03/08 02:17:48 rafal Exp $	*/
a242 1
		++_nload_link;
d246 1
@


1.13.44.1
log
@sync with HEAD
@
text
@d1 1
a1 1
/*	load.cpp,v 1.13 2006/02/20 03:09:05 uwe Exp	*/
a242 1
		++_nload_link;
d246 1
@


1.12
log
@Loader::_load_memory - don't give up so easily if memsz > tagged page
size.  This makes ksyms work, constructed ELF header was too big to
fit into one tagged page.

As a side effect it makes detached miniroot work too, as to locate the
miniroot the symbol table must be correctly skipped.  We probably
should just pass that information in bootinfo.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.11 2006/01/15 00:07:49 uwe Exp $	*/
d157 1
a157 1
	DPRINTF((TEXT("load link %d zero clear link %d.\n"),
@


1.12.2.1
log
@sync with head
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.13 2006/02/20 03:09:05 uwe Exp $	*/
d157 1
a157 1
	DPRINTF((TEXT("load link %d, zero clear link %d\n"),
@


1.12.4.1
log
@Sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.13 2006/02/20 03:09:05 uwe Exp $	*/
d157 1
a157 1
	DPRINTF((TEXT("load link %d, zero clear link %d\n"),
@


1.11
log
@Add missing \n in a debug printf.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.10 2006/01/15 00:06:39 uwe Exp $	*/
d215 2
a219 4
	if (memsz > _tpsz) {
		/* XXX failure */
		return;
	}
d221 12
a232 7
	_opvec_prev = _pvec_prev;
	if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
		_error = TRUE;
	memcpy((void *)v, data, memsz);
	_pvec_prev->src = ptokv(p);
	_pvec_prev->dst = kv;
	_pvec_prev->sz = memsz;
d234 1
a234 1
	_pvec_prev->next = (uint32_t)pvec;
d236 1
a236 1
	_pvec_prev->next = ptokv(pvec_paddr);
d238 6
a243 1
	_pvec_prev = pvec;
@


1.10
log
@Get rid of an unused variable in Loader::_load_memory.
Add whitespace between = sign and casts, while there use uint32_t in
those casts.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.9 2006/01/14 23:22:53 uwe Exp $	*/
d87 1
a87 1
	DPRINTF((TEXT("[file system image]")));
@


1.9
log
@Make debug message about zeroed areas look like the one for loaded areas.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.8 2005/12/11 12:17:28 christos Exp $	*/
d145 1
a145 1
	_page_tag_start =(u_int32_t)_pvec_clr;
d195 1
a195 1
		_pvec_prev->next =(u_int32_t)_pvec_clr;
a212 1
	vaddr_t kv_start = kv, v;
d214 1
d231 1
a231 1
	_pvec_prev->next =(u_int32_t)pvec;
d255 1
a255 1
	prev->next =(u_int32_t)pvec;
@


1.8
log
@merge ktrace-lwp.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.5.16.4 2004/09/21 13:15:48 skrll Exp $	*/
d199 1
a199 1
		DPRINTF((TEXT("[zero clear] ->0x%08x+0x%08x=0x%08x\n"),
@


1.8.2.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.8 2005/12/11 12:17:28 christos Exp $	*/
d87 1
a87 1
	DPRINTF((TEXT("[file system image]\n")));
d145 1
a145 1
	_page_tag_start = (uint32_t)_pvec_clr;
d195 1
a195 1
		_pvec_prev->next = (uint32_t)_pvec_clr;
d199 1
a199 1
		DPRINTF((TEXT("\t->zero 0x%08x+0x%08x=0x%08x\n"),
d213 1
a214 3
	vaddr_t v;
	vaddr_t dst;
	vsize_t remsz;
d218 4
d223 7
a229 12
	dst = kv;
	remsz = memsz;
	while (remsz > 0) {
		_opvec_prev = _pvec_prev;
		if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
			_error = TRUE;

		vsize_t tocopy = (remsz < _tpsz) ? remsz : _tpsz;
		memcpy((void *)v, data, tocopy);
		_pvec_prev->src = ptokv(p);
		_pvec_prev->dst = dst;
		_pvec_prev->sz = tocopy;
d231 1
a231 1
		_pvec_prev->next = (uint32_t)pvec;
d233 1
a233 1
		_pvec_prev->next = ptokv(pvec_paddr);
d235 1
a235 6
		data = (char *)data + tocopy;
		dst += tocopy;
		remsz -= tocopy;

		_pvec_prev = pvec;
	}
d255 1
a255 1
	prev->next = (uint32_t)pvec;
@


1.8.2.2
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.8.2.1 2006/01/15 10:02:37 yamt Exp $	*/
d157 1
a157 1
	DPRINTF((TEXT("load link %d, zero clear link %d\n"),
@


1.7
log
@clean up whitespace.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.6 2004/02/27 02:02:16 uwe Exp $	*/
@


1.7.12.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.7 2004/08/06 18:33:09 uch Exp $	*/
d87 1
a87 1
	DPRINTF((TEXT("[file system image]\n")));
d145 1
a145 1
	_page_tag_start = (uint32_t)_pvec_clr;
d157 1
a157 1
	DPRINTF((TEXT("load link %d, zero clear link %d\n"),
d195 1
a195 1
		_pvec_prev->next = (uint32_t)_pvec_clr;
d199 1
a199 1
		DPRINTF((TEXT("\t->zero 0x%08x+0x%08x=0x%08x\n"),
d213 1
a214 3
	vaddr_t v;
	vaddr_t dst;
	vsize_t remsz;
d218 4
d223 7
a229 12
	dst = kv;
	remsz = memsz;
	while (remsz > 0) {
		_opvec_prev = _pvec_prev;
		if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
			_error = TRUE;

		vsize_t tocopy = (remsz < _tpsz) ? remsz : _tpsz;
		memcpy((void *)v, data, tocopy);
		_pvec_prev->src = ptokv(p);
		_pvec_prev->dst = dst;
		_pvec_prev->sz = tocopy;
d231 1
a231 1
		_pvec_prev->next = (uint32_t)pvec;
d233 1
a233 1
		_pvec_prev->next = ptokv(pvec_paddr);
d235 1
a235 6
		data = (char *)data + tocopy;
		dst += tocopy;
		remsz -= tocopy;

		_pvec_prev = pvec;
	}
d255 1
a255 1
	prev->next = (uint32_t)pvec;
@


1.7.12.2
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.7.12.1 2006/06/21 14:51:38 yamt Exp $	*/
a242 1
		++_nload_link;
d246 1
@


1.6
log
@Use realsize() to determine the size of the miniroot image.
It's now possible to boot from gzipped miniroots.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.5 2002/02/11 17:05:45 uch Exp $	*/
d95 1
a95 1
{ 
d106 1
a106 1
  
d119 1
a119 1
  
d127 1
a127 1
{ 
d199 1
a199 1
		DPRINTF((TEXT("[zero clear] ->0x%08x+0x%08x=0x%08x\n"), 
@


1.5
log
@fix memory size estimation. add error check code.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.4 2001/05/08 18:51:22 uch Exp $	*/
d84 1
a84 1
	sz = _file->size();
@


1.5.16.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.6 2004/02/27 02:02:16 uwe Exp $	*/
d84 1
a84 1
	sz = _file->realsize();
@


1.5.16.2
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.5.16.1 2004/08/03 10:34:59 skrll Exp $	*/
d95 1
a95 1
{
d106 1
a106 1

d119 1
a119 1

d127 1
a127 1
{
d199 1
a199 1
		DPRINTF((TEXT("[zero clear] ->0x%08x+0x%08x=0x%08x\n"),
@


1.5.16.3
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.7 2004/08/06 18:33:09 uch Exp $	*/
@


1.5.16.4
log
@Fix the sync with head I botched.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.5.16.2 2004/08/12 11:41:05 skrll Exp $	*/
@


1.4
log
@KNF.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.3 2001/03/22 18:23:08 uch Exp $	*/
d78 1
a78 1
void
d89 2
d137 1
d142 2
a143 1
	_mem->getTaggedPage(v, p, &_pvec_clr, _pvec_clr_paddr);
d224 2
a225 1
	_mem->getTaggedPage(v, p, &pvec, pvec_paddr);      
d248 2
a249 1
	_mem->getTaggedPage(v, p, &pvec, pvec_paddr);      
@


1.4.8.1
log
@file load.cpp was added on branch nathanw_sa on 2002-02-28 04:09:45 +0000
@
text
@d1 255
@


1.4.8.2
log
@Catch up to -current.
@
text
@a0 261
/*	$NetBSD: load.cpp,v 1.4.8.1 2002/02/28 04:09:45 nathanw 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 <load.h>
#include <exec_coff.h>
#undef DPRINTF // trash coff_machdep.h 's define.

#include <console.h>
#include <memory.h>
#include <file.h>

#include <exec_elf.h>

Loader::Loader(Console *&cons, MemoryManager *&mem)
	: _mem(mem), _cons(cons)
{
	_file = 0;
	_page_tag_start = 0;
}

LoaderOps
Loader::objectFormat(File &file)
{
	union {
		Elf_Ehdr elf;
		coff_exechdr coff;
	} header;
	file.read(reinterpret_cast<void *>(&header), sizeof(header), 0);

	if (header.elf.e_ident[EI_MAG0] == ELFMAG0 &&
	    header.elf.e_ident[EI_MAG1] == ELFMAG1 &&
	    header.elf.e_ident[EI_MAG2] == ELFMAG2 &&
	    header.elf.e_ident[EI_MAG3] == ELFMAG3)
		return LOADER_ELF;
#ifdef COFF_BADMAG
	if (!COFF_BADMAG(&header.coff.f))
		return LOADER_COFF;
#endif // COFF_BADMAG

	return LOADER_UNKNOWN;
}

BOOL
Loader::loadExtData(void)
{
	size_t sz;
	vaddr_t kv;

	sz = _file->size();
	kv = ROUND(_kernend, static_cast <vsize_t>(KERNEL_PAGE_SIZE));

	DPRINTF((TEXT("[file system image]")));
	_load_segment(kv, sz, 0, sz);

	return _load_success();
}

void
Loader::loadEnd(void)
{ 
	/* tag chain end */
	_load_segment_end();
}

void
Loader::tagDump(int n)
{
#ifdef PAGE_LINK_DUMP
	struct PageTag *p, *op;
	int i = 0;
  
	DPRINTF((TEXT("page tag start physical address: 0x%08x\n"),
	    _page_tag_start));
	p = reinterpret_cast <struct PageTag *>(_page_tag_start);
	do  {
		if (i < n || p->src == ~0)
			DPRINTF((TEXT("[%d] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
			    i, p->next, p->src, p->dst, p->sz));
		else if (i == n)
			DPRINTF((TEXT("[...]\n")));
		op = p;
		i++;
	} while ((p = reinterpret_cast <struct PageTag *>(p->next)) != ~0);
  
	DPRINTF((TEXT("[%d(last)] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
	    i - 1, op->next, op->src, op->dst, op->sz));
#endif // PAGE_LINK_DUMP
}

paddr_t
Loader::tagStart(void)
{ 
	return _page_tag_start;
}

void
Loader::_load_segment_start(void)
{
	vaddr_t v;
	paddr_t p;

	_error = FALSE;
	_nload_link = _n0clr_link = 0;
	_tpsz = _mem->getTaggedPageSize();

	// start of chain.
	if (!_mem->getTaggedPage(v, p, &_pvec_clr, _pvec_clr_paddr))
		_error = TRUE;
#ifdef PAGE_LINK_DUMP
	_page_tag_start =(u_int32_t)_pvec_clr;
#else
	_page_tag_start = _pvec_clr_paddr;
#endif
	_pvec_prev = _pvec_clr++;
	_pvec_clr_paddr += sizeof(struct PageTag);
}

void
Loader::_load_segment_end(void)
{
	_opvec_prev->next = ~0; // terminate
	DPRINTF((TEXT("load link %d zero clear link %d.\n"),
	    _nload_link, _n0clr_link));
}

void
Loader::_load_segment(vaddr_t kv, vsize_t memsz, off_t fileofs, size_t filesz)
{
	int j, n;
	vaddr_t kv_start = kv;

	DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x ofs=0x%08x+0x%x\n"),
	    kv, memsz, kv + memsz, fileofs, filesz));
	_kernend = kv + memsz;

	if (filesz) {
		n = filesz / _tpsz;
		for (j = 0; j < n; j++) {
			_opvec_prev = _pvec_prev;
			_pvec_prev = _load_page(kv, fileofs,
			    _tpsz, _pvec_prev);
			kv += _tpsz;
			fileofs += _tpsz;
			++_nload_link;
		}
		size_t rest = filesz % _tpsz;
		if (rest) {
			_opvec_prev = _pvec_prev;
			_pvec_prev = _load_page(kv, fileofs, rest, _pvec_prev);
			++_nload_link;
		}
	}

	// zero clear tag
	if (filesz < memsz) {
		_pvec_prev->src = ~0;
		_pvec_prev->dst = kv_start + filesz;
		_pvec_prev->sz = memsz - filesz;
#ifdef PAGE_LINK_DUMP
		_pvec_prev->next =(u_int32_t)_pvec_clr;
#else
		_pvec_prev->next = ptokv(_pvec_clr_paddr);
#endif
		DPRINTF((TEXT("[zero clear] ->0x%08x+0x%08x=0x%08x\n"), 
		    _pvec_prev->dst, _pvec_prev->sz,
		    _pvec_prev->dst + _pvec_prev->sz));
		_opvec_prev = _pvec_prev;
		_pvec_prev = _pvec_clr++;
		_pvec_clr_paddr += sizeof(struct PageTag);
		++_n0clr_link;
	}
}

void
Loader::_load_memory(vaddr_t kv, vsize_t memsz, void *data)
{
	struct PageTag *pvec;
	vaddr_t kv_start = kv, v;
	paddr_t p, pvec_paddr;

	DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x\n"),
	    kv, memsz, kv + memsz));
	if (memsz > _tpsz) {
		/* XXX failure */
		return;
	}

	_opvec_prev = _pvec_prev;
	if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
		_error = TRUE;
	memcpy((void *)v, data, memsz);
	_pvec_prev->src = ptokv(p);
	_pvec_prev->dst = kv;
	_pvec_prev->sz = memsz;
#ifdef PAGE_LINK_DUMP
	_pvec_prev->next =(u_int32_t)pvec;
#else
	_pvec_prev->next = ptokv(pvec_paddr);
#endif
	_pvec_prev = pvec;

	_kernend = kv + memsz;
	++_nload_link;
}

struct PageTag *
Loader::_load_page(vaddr_t kv, off_t ofs, size_t sz, struct PageTag *prev)
{
	struct PageTag *pvec;
	paddr_t p, pvec_paddr;
	vaddr_t v;

	if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
		_error = TRUE;
	_file->read((void *)v, sz, ofs);
	prev->src = ptokv(p);
	prev->dst = kv;
	prev->sz = sz;
#ifdef PAGE_LINK_DUMP
	prev->next =(u_int32_t)pvec;
#else
	prev->next = ptokv(pvec_paddr);
#endif

	return pvec;
}
@


1.4.2.1
log
@Catch up with -current.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.4 2001/05/08 18:51:22 uch Exp $	*/
d78 1
a78 1
BOOL
a88 2

	return _load_success();
a134 1
	_error = FALSE;
d139 1
a139 2
	if (!_mem->getTaggedPage(v, p, &_pvec_clr, _pvec_clr_paddr))
		_error = TRUE;
d220 1
a220 2
	if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
		_error = TRUE;
d243 1
a243 2
	if (!_mem->getTaggedPage(v, p, &pvec, pvec_paddr))
		_error = TRUE;
@


1.3
log
@fix calcurating kernend bug.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.2 2001/03/21 14:06:25 toshii Exp $	*/
d106 1
a106 1
		 _page_tag_start));
d111 1
a111 1
				 i, p->next, p->src, p->dst, p->sz));
d119 1
a119 1
		 i - 1, op->next, op->src, op->dst, op->sz));
d154 1
a154 1
		 _nload_link, _n0clr_link));
d164 1
a164 1
		 kv, memsz, kv + memsz, fileofs, filesz));
d172 1
a172 1
						_tpsz, _pvec_prev);
d196 2
a197 2
			 _pvec_prev->dst, _pvec_prev->sz,
			 _pvec_prev->dst + _pvec_prev->sz));
d213 1
a213 1
		 kv, memsz, kv + memsz));
@


1.2
log
@Load ELF symbol table for DDB.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.1 2001/02/09 18:34:44 uch Exp $	*/
d165 2
a202 1
	_kernend = kv + memsz;
@


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


1.1.2.1
log
@file load.cpp was added on branch thorpej_scsipi on 2001-02-11 19:09:54 +0000
@
text
@d1 223
@


1.1.2.2
log
@Sync with HEAD.
@
text
@a0 223
/*	$NetBSD: load.cpp,v 1.1.2.1 2001/02/11 19:09:54 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 <load.h>
#include <exec_coff.h>
#undef DPRINTF // trash coff_machdep.h 's define.

#include <console.h>
#include <memory.h>
#include <file.h>

#include <exec_elf.h>

Loader::Loader(Console *&cons, MemoryManager *&mem)
	: _mem(mem), _cons(cons)
{
	_file = 0;
	_page_tag_start = 0;
}

LoaderOps
Loader::objectFormat(File &file)
{
	union {
		Elf_Ehdr elf;
		coff_exechdr coff;
	} header;
	file.read(reinterpret_cast<void *>(&header), sizeof(header), 0);

	if (header.elf.e_ident[EI_MAG0] == ELFMAG0 &&
	    header.elf.e_ident[EI_MAG1] == ELFMAG1 &&
	    header.elf.e_ident[EI_MAG2] == ELFMAG2 &&
	    header.elf.e_ident[EI_MAG3] == ELFMAG3)
		return LOADER_ELF;
#ifdef COFF_BADMAG
	if (!COFF_BADMAG(&header.coff.f))
		return LOADER_COFF;
#endif // COFF_BADMAG

	return LOADER_UNKNOWN;
}

void
Loader::loadExtData(void)
{
	size_t sz;
	vaddr_t kv;

	sz = _file->size();
	kv = ROUND(_kernend, static_cast <vsize_t>(KERNEL_PAGE_SIZE));

	DPRINTF((TEXT("[file system image]")));
	_load_segment(kv, sz, 0, sz);
}

void
Loader::loadEnd(void)
{ 
	/* tag chain end */
	_load_segment_end();
}

void
Loader::tagDump(int n)
{
#ifdef PAGE_LINK_DUMP
	struct PageTag *p, *op;
	int i = 0;
  
	DPRINTF((TEXT("page tag start physical address: 0x%08x\n"),
		 _page_tag_start));
	p = reinterpret_cast <struct PageTag *>(_page_tag_start);
	do  {
		if (i < n || p->src == ~0)
			DPRINTF((TEXT("[%d] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
				 i, p->next, p->src, p->dst, p->sz));
		else if (i == n)
			DPRINTF((TEXT("[...]\n")));
		op = p;
		i++;
	} while ((p = reinterpret_cast <struct PageTag *>(p->next)) != ~0);
  
	DPRINTF((TEXT("[%d(last)] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
		 i - 1, op->next, op->src, op->dst, op->sz));
#endif // PAGE_LINK_DUMP
}

paddr_t
Loader::tagStart(void)
{ 
	return _page_tag_start;
}

void
Loader::_load_segment_start(void)
{
	vaddr_t v;
	paddr_t p;

	_nload_link = _n0clr_link = 0;
	_tpsz = _mem->getTaggedPageSize();

	// start of chain.
	_mem->getTaggedPage(v, p, &_pvec_clr, _pvec_clr_paddr);
#ifdef PAGE_LINK_DUMP
	_page_tag_start =(u_int32_t)_pvec_clr;
#else
	_page_tag_start = _pvec_clr_paddr;
#endif
	_pvec_prev = _pvec_clr++;
	_pvec_clr_paddr += sizeof(struct PageTag);
}

void
Loader::_load_segment_end(void)
{
	_opvec_prev->next = ~0; // terminate
	DPRINTF((TEXT("load link %d zero clear link %d.\n"),
		 _nload_link, _n0clr_link));
}

void
Loader::_load_segment(vaddr_t kv, vsize_t memsz, off_t fileofs, size_t filesz)
{
	int j, n;
	vaddr_t kv_start = kv;

	DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x ofs=0x%08x+0x%x\n"),
		 kv, memsz, kv + memsz, fileofs, filesz));
	if (filesz) {
		n = filesz / _tpsz;
		for (j = 0; j < n; j++) {
			_opvec_prev = _pvec_prev;
			_pvec_prev = _load_page(kv, fileofs,
						_tpsz, _pvec_prev);
			kv += _tpsz;
			fileofs += _tpsz;
			++_nload_link;
		}
		size_t rest = filesz % _tpsz;
		if (rest) {
			_opvec_prev = _pvec_prev;
			_pvec_prev = _load_page(kv, fileofs, rest, _pvec_prev);
			++_nload_link;
		}
	}

	// zero clear tag
	if (filesz < memsz) {
		_pvec_prev->src = ~0;
		_pvec_prev->dst = kv_start + filesz;
		_pvec_prev->sz = memsz - filesz;
#ifdef PAGE_LINK_DUMP
		_pvec_prev->next =(u_int32_t)_pvec_clr;
#else
		_pvec_prev->next = ptokv(_pvec_clr_paddr);
#endif
		DPRINTF((TEXT("[zero clear] ->0x%08x+0x%08x=0x%08x\n"), 
			 _pvec_prev->dst, _pvec_prev->sz,
			 _pvec_prev->dst + _pvec_prev->sz));
		_opvec_prev = _pvec_prev;
		_pvec_prev = _pvec_clr++;
		_pvec_clr_paddr += sizeof(struct PageTag);
		++_n0clr_link;
	}
	_kernend = kv + memsz;
}

struct PageTag *
Loader::_load_page(vaddr_t kv, off_t ofs, size_t sz, struct PageTag *prev)
{
	struct PageTag *pvec;
	paddr_t p, pvec_paddr;
	vaddr_t v;

	_mem->getTaggedPage(v, p, &pvec, pvec_paddr);      
	_file->read((void *)v, sz, ofs);
	prev->src = ptokv(p);
	prev->dst = kv;
	prev->sz = sz;
#ifdef PAGE_LINK_DUMP
	prev->next =(u_int32_t)pvec;
#else
	prev->next = ptokv(pvec_paddr);
#endif

	return pvec;
}
@


1.1.2.3
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.1.2.2 2001/03/27 15:30:48 bouyer Exp $	*/
a164 2
	_kernend = kv + memsz;

a200 29
}

void
Loader::_load_memory(vaddr_t kv, vsize_t memsz, void *data)
{
	struct PageTag *pvec;
	vaddr_t kv_start = kv, v;
	paddr_t p, pvec_paddr;

	DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x\n"),
		 kv, memsz, kv + memsz));
	if (memsz > _tpsz) {
		/* XXX failure */
		return;
	}

	_opvec_prev = _pvec_prev;
	_mem->getTaggedPage(v, p, &pvec, pvec_paddr);      
	memcpy((void *)v, data, memsz);
	_pvec_prev->src = ptokv(p);
	_pvec_prev->dst = kv;
	_pvec_prev->sz = memsz;
#ifdef PAGE_LINK_DUMP
	_pvec_prev->next =(u_int32_t)pvec;
#else
	_pvec_prev->next = ptokv(pvec_paddr);
#endif
	_pvec_prev = pvec;

a201 1
	++_nload_link;
@


1.1.4.1
log
@Catch up with -current.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.3 2001/03/22 18:23:08 uch Exp $	*/
a164 2
	_kernend = kv + memsz;

a200 29
}

void
Loader::_load_memory(vaddr_t kv, vsize_t memsz, void *data)
{
	struct PageTag *pvec;
	vaddr_t kv_start = kv, v;
	paddr_t p, pvec_paddr;

	DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x\n"),
		 kv, memsz, kv + memsz));
	if (memsz > _tpsz) {
		/* XXX failure */
		return;
	}

	_opvec_prev = _pvec_prev;
	_mem->getTaggedPage(v, p, &pvec, pvec_paddr);      
	memcpy((void *)v, data, memsz);
	_pvec_prev->src = ptokv(p);
	_pvec_prev->dst = kv;
	_pvec_prev->sz = memsz;
#ifdef PAGE_LINK_DUMP
	_pvec_prev->next =(u_int32_t)pvec;
#else
	_pvec_prev->next = ptokv(pvec_paddr);
#endif
	_pvec_prev = pvec;

a201 1
	++_nload_link;
@


1.1.4.2
log
@Catch up to -current.
@
text
@d1 1
a1 1
/*	$NetBSD: load.cpp,v 1.1.4.1 2001/04/09 01:52:39 nathanw Exp $	*/
d106 1
a106 1
	    _page_tag_start));
d111 1
a111 1
			    i, p->next, p->src, p->dst, p->sz));
d119 1
a119 1
	    i - 1, op->next, op->src, op->dst, op->sz));
d154 1
a154 1
	    _nload_link, _n0clr_link));
d164 1
a164 1
	    kv, memsz, kv + memsz, fileofs, filesz));
d172 1
a172 1
			    _tpsz, _pvec_prev);
d196 2
a197 2
		    _pvec_prev->dst, _pvec_prev->sz,
		    _pvec_prev->dst + _pvec_prev->sz));
d213 1
a213 1
	    kv, memsz, kv + memsz));
@
